Handle-server cannot start

861 views
Skip to first unread message

Fatih Güneş

unread,
Aug 19, 2022, 7:12:26 AM8/19/22
to DSpace Technical Support
Hi, when I start handle-server I get the error below. Any idea is appreciated.

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletContextHandler
    at net.handle.server.Main.configureDefaultRootWebApp(Main.java:373)
    at net.handle.server.Main.initEmbeddedJetty(Main.java:348)
    at net.handle.server.Main.initialize(Main.java:273)
    at net.handle.server.Main.main(Main.java:122)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.ServletContextHandler
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 4 more

Tim Donohue

unread,
Aug 19, 2022, 10:16:14 AM8/19/22
to Fatih Güneş, DSpace Technical Support
Hi Fatih,

You haven't given us enough information to help.  What version of DSpace is this?  Are there any other errors in your DSpace logs?  

Based on what you've provided, my best guess is you may have had a build or install error which resulted in this.  Missing classes (NoClassDefFoundError) tend to result from a build problem, or maybe an upgrade problem... it's essentially saying that a class which DSpace depends on is missing from your DSpace installation.  You also should verify your basic prerequisites are correct...e.g. that you are running a supported version of Java & Maven.

Good luck and let us know on this list if you find any more clues or error messages.

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of Fatih Güneş <fa...@selensoft.com.tr>
Sent: Friday, August 19, 2022 4:48 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Handle-server cannot start
 
--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/1351d5b9-cb03-40ba-a414-b47e03786f5cn%40googlegroups.com.

Fatih Güneş

unread,
Aug 20, 2022, 2:13:29 AM8/20/22
to DSpace Technical Support
Dear Tim,
This is an upgraded instance from 6.x to 7.3
We have OpenJDK 11.0.16 and Maven 3.6.3. These seems compliant with prerequisites.
The log output in my previous mail is from handle-server.log. In standard log files I see no errors. 
How can I dig more to find out what is missing?

Tim Donohue

unread,
Aug 22, 2022, 11:03:31 AM8/22/22
to Fatih Güneş, DSpace Technical Support
Hi Fatih,

That error is basically saying that (at least part of) "jetty-server" is missing, when that's a core dependency in the main DSpace 7 POM: 

So, this implies to me that your build/install is somehow not valid.  I'm not sure why that is...maybe you have an old version of that "jetty-server" hanging around?  Maybe you've somehow customized this POM?

At the very least, you may want to try a rebuild using "mvn -U clean package" (-U will tell maven to try to update all your dependencies) and then redeploy via "ant update".

Hopefully, that'll help fix it.  If not, you may want to look closely at your upgrade and see if somehow you have old versions of JARs (from DSpace 6) in your DSpace 7 installation (if so, you should remove them and update everything to what DSpace 7 expects).

Tim

Sent: Saturday, August 20, 2022 1:13 AM

To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] Handle-server cannot start
 

Fatih Güneş

unread,
Sep 26, 2022, 6:43:40 AM9/26/22
to DSpace Technical Support
Hello Tim,
We did some updates. Now I get no error message about Jetty-server. But handle-server still does not start. Below is a part from dspace.log.

2022-09-26 13:31:47,687 WARN  unknown unknown org.dspace.servicemanager.DSpaceServiceManager @ Unable to locate bean by name or id=dsprop. Will try to look up bean by type next.

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dsprop' available

   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:872) ~[spring-beans-5.3.20.jar:5.3.20]

   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1344) ~[spring-beans-5.3.20.jar:5.3.20]

   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:309) ~[spring-beans-5.3.20.jar:5.3.20]

   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) ~[spring-beans-5.3.20.jar:5.3.20]

   at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1160) ~[spring-context-5.3.20.jar:5.3.20]

   at org.dspace.servicemanager.DSpaceServiceManager.getServiceByName(DSpaceServiceManager.java:426) [dspace-services-7.3.jar:7.3]

   at org.dspace.scripts.ScriptServiceImpl.getScriptConfiguration(ScriptServiceImpl.java:33) [dspace-api-7.3.jar:7.3]

   at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:125) [dspace-api-7.3.jar:7.3]

   at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:98) [dspace-api-7.3.jar:7.3]


below is related lines from start-handle-server file

# Read parameters from DSpace config

DSPACEDIR=`$BINDIR/dspace dsprop --property dspace.dir`

HANDLEDIR=`$BINDIR/dspace dsprop --property handle.dir`


Both parameters exist in dspace.cfg.

Do you have any idea why I still cannot start handle-server?


Gabriella Harangi

unread,
Sep 26, 2022, 8:47:35 AM9/26/22
to DSpace Technical Support
Dear Faith and Tim,

We have the same problem with the handle server as Faith mentioned it in his first e-mail.
We upgraded from Dspace 4.1, but we installed the Dspace 7.3 to a fresh new server so its like a new installation. We didn't modify the pom.xml, but getting the following error message:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletContextHandler
    at net.handle.server.Main.configureDefaultRootWebApp(Main.java:373)
    at net.handle.server.Main.initEmbeddedJetty(Main.java:348)
    at net.handle.server.Main.initialize(Main.java:273)
    at net.handle.server.Main.main(Main.java:122)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.ServletContextHandler
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 4 more

Do you have any suggestion to solve this problem?

Thanks,
Gabi

Mark H. Wood

unread,
Sep 26, 2022, 10:55:18 AM9/26/22
to dspac...@googlegroups.com
On Mon, Sep 26, 2022 at 03:43:40AM -0700, Fatih Güneş wrote:
> Hello Tim,
> We did some updates. Now I get no error message about Jetty-server. But
> handle-server still does not start. Below is a part from dspace.log.
>
> 2022-09-26 13:31:47,687 WARN unknown unknown
> org.dspace.servicemanager.DSpaceServiceManager @ Unable to locate bean by
> name or id=dsprop. Will try to look up bean by type next.

I think this is not related to the problem. The command line tool has
two ways of discovering which commands exist. It first tries the new
"script"s, apparently using the command's name itself. If not found
that way, it looks the command up in the older 'launcher.xml' which
maps it to the implementing class.

So the ServiceManager will always log this warning for a command which
is defined in launcher.xml.

If the real issue is logged, it is probably after this entry.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Gabriella Harangi

unread,
Sep 27, 2022, 6:20:04 AM9/27/22
to DSpace Technical Support
I've tried to start the handle server on our production server, which is a fresh 7.3 install, and it doesn't work, it throws the same exception as mentioned above. Then I've tried it on our test server, which is also a dspace 7.3, but upgraded from dspace 7.2. The handle server doesn't start there either (same exception). I've also tried it in docker with no success.
Always got the same error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet/ServletContextHandler

Please, give me any suggestion, how can I fix the handle server.

Gabriella Harangi

unread,
Sep 27, 2022, 7:30:34 AM9/27/22
to DSpace Technical Support
If anybody has the same problem: the followng jars are missing for the handle server to work:
jetty-deploy, jetty-security, jetty-servlet, jetty-servlets, jetty-xml, jetty-webapp

Gabi

Mark H. Wood

unread,
Sep 27, 2022, 9:18:03 AM9/27/22
to dspac...@googlegroups.com
On Tue, Sep 27, 2022 at 03:20:04AM -0700, Gabriella Harangi wrote:
> I've tried to start the handle server on our production server, which is a
> fresh 7.3 install, and it doesn't work, it throws the same exception as
> mentioned above. Then I've tried it on our test server, which is also a
> dspace 7.3, but upgraded from dspace 7.2. The handle server doesn't start
> there either (same exception). I've also tried it in docker with no success.
> Always got the same error:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/jetty/servlet/ServletContextHandler
>
> Please, give me any suggestion, how can I fix the handle server.

It seems that the JAR which contains this class is not installed by
7.3. That class is found in the 'jetty-servlet' artifact. I think
that if you add 'jetty-servlet-9.4.44.v20210927.jar' to the 'lib'
directory, this problem will be fixed. You can find it here:
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlet/9.4.44.v20210927/jetty-servlet-9.4.44.v20210927.jar
It may already be in your local repository (~/.m2/repository).


I haven't figured out why the JAR is not installed. I can't find it
in my development/test instances.

The 'log/handle-server.log' is probably the best place to be looking
for clues, should there be further problems.
> > 317-274-0749 <(317)%20274-0749>
> > www.ulib.iupui.edu
> >
>
> --
> All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> ---
> You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/c9602b1f-5639-4e39-8e8f-06e889a079d9n%40googlegroups.com.
signature.asc

Olayiwola Lawal

unread,
Sep 27, 2022, 2:13:58 PM9/27/22
to DSpace Technical Support
Hello, I am facing the same issue on a fresh 7.3 installation. we just got our prefix today. when I run the script to start the Handle-Server I get no confirmation prompt or errors. CNRI says they can't reach our handle server. From the handle-server/log I got this error after I have copied the jetty-servlet to the lib directory.

Anny further assistance please?

"2022-09-27 18:07:11.300Z" 25 Started new run.
"2022-09-27 18:07:11.304Z" 25 Handle.net Server Software version 9.3.0
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/security/SecurityHandler

        at net.handle.server.Main.configureDefaultRootWebApp(Main.java:373)
        at net.handle.server.Main.initEmbeddedJetty(Main.java:348)
        at net.handle.server.Main.initialize(Main.java:273)
        at net.handle.server.Main.main(Main.java:122)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.security.SecurityHandler

        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 4 more

Gabriella Harangi

unread,
Sep 27, 2022, 2:37:14 PM9/27/22
to Olayiwola Lawal, DSpace Technical Support
Hi!

As I wrote in my previous e-mail, you need 6 jars. Beside the jetty-servlet, you need jetty-deploy, jetty-security,, jetty-servlets, jetty-xml, jetty-webapp
Download these jar files also, and copy them to the lib directory.


Gabi

You received this message because you are subscribed to a topic in the Google Groups "DSpace Technical Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dspace-tech/lr7kfeLLEjg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/51b7a11a-b0bf-4864-ad1d-a81be1e0633cn%40googlegroups.com.

Olayiwola Lawal

unread,
Sep 27, 2022, 2:54:37 PM9/27/22
to DSpace Technical Support
Thanks, all fine now after downloads are copied to the lib directory

Fatih Güneş

unread,
Sep 27, 2022, 3:07:30 PM9/27/22
to DSpace Technical Support
Hi Gabi,
We made our handle-server work with your help. Thank you very very much. 
The link to download missing jars is https://mvnrepository.com/artifact/org.eclipse.jetty
I add a screenshot of all jetty jars in our server and  two screenshots showing how to download the correct files.

I also want to thank Mark and Tim for their attention. 
download-jar.pngjetty-version.pngjetty-jars_list.png

Tim Donohue

unread,
Sep 29, 2022, 5:04:42 PM9/29/22
to DSpace Technical Support
Hi all,

Thanks for your patience.  It took me a while to get back to this thread, but I think you all have found a bug.  It appears that during a recent update, we accidentally filtered out several of the Jetty JARs from being included in DSpace.

I've just created a small PR to try and fix this bug: https://github.com/DSpace/DSpace/pull/8498

If any of you are interested in trying this PR out locally, I *think* it might fix this bug with the handle-server not starting properly.   I have not had a chance to fully test it yet, but I can verify that with this PR the missing Jetty JARs are now a part of DSpace again.

Tim

Tim Donohue

unread,
Oct 3, 2022, 3:09:26 PM10/3/22
to DSpace Technical Support
All,

After more testing, we are more certain that this PR should fix the "start-handle-server" issues with missing Jetty JARs: https://github.com/DSpace/DSpace/pull/8498

That PR has been approved & merged, and this fix will be in the upcoming 7.4 release.

Tim

Mehmet Demirel

unread,
Feb 19, 2024, 12:30:16 PM2/19/24
to DSpace Technical Support
A similar problem occurred in version 7.6.1.

Guillermo Castellano Casas

unread,
Mar 13, 2024, 9:07:26 AM3/13/24
to DSpace Technical Support
Hi all,

Mehmet is right. We have also experienced this issue in a fresh 7.6.1 install.

Here is the error logged in [dspace]/handle-server/log/error.log-202403:

"2024-03-12 12:48:55.725+0100" 25 Started new run.
"2024-03-12 12:48:55.726+0100" 25 Handle.net Server Software version 9.3.0
Exception in thread "main" java.lang.NoClassDefFoundError: com/sleepycat/je/DatabaseException
at net.handle.server.HandleServer.initTxnQueue(HandleServer.java:732)
at net.handle.server.HandleServer.<init>(HandleServer.java:382)
at net.handle.server.AbstractServer.getInstance(AbstractServer.java:120)
at net.handle.server.Main.initialize(Main.java:255)
at net.handle.server.Main.main(Main.java:122)
Caused by: java.lang.ClassNotFoundException: com.sleepycat.je.DatabaseException

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
... 5 more

We resolved it by downloading the je-18.1.11.jar from Maven Repository and adding it to [dspace]/lib.

Hope this helps!

BR,

Guillermo
Reply all
Reply to author
Forward
0 new messages