handle server quits after ubuntu upgrade

361 views
Skip to first unread message

cpgr...@gmail.com

unread,
Nov 11, 2022, 11:17:40 AM11/11/22
to DSpace Technical Support
We did an upgrade to Ubuntu last night and now our handle server quits
immediately on trying to start it. Unfortunately, the person who set up
our handle server has left our organization.

Our handle-server.log reports:

"2022/11/11 10:27:43 EST" 25 Rotating log files
Error: null
        (see the error log for details.)

Shutting down...

and the error.log reports:

"2022/11/11 10:27:43 EST" 25 Started new run.
java.lang.UnsupportedOperationException
         at java.lang.Runtime.runFinalizersOnExit(Runtime.java:287)
         at java.lang.System.runFinalizersOnExit(System.java:1059)
         at net.handle.server.Main.initialize(Main.java:124)
         at net.handle.server.Main.main(Main.java:75)
Shutting down...

Can anyone help with what is going wrong or how to diagnose this further?

Edmund Balnaves

unread,
Nov 12, 2022, 6:36:46 AM11/12/22
to DSpace Technical Support

This is a problem with the latest release of java (openjdk version "1.8.0_352").  It has now removed the deprecated class runFinalizersOnExit

This class is used by the embedded handle.net jar classes to provide the resolver functions for the handle server.

This is distributed via the maven libraries.    There is testing going on upgraded to use a later handle.net distribution. 

I have tested a working alternative by rebuilding handle-6.2.jar with a minor change to ./net/handle/server/Main.java to comment out the now discontinued class at line 124
//System.runFinalizersOnExit(true);

After rebuild the handle jar and replacing it in the target directories, the Handle server starts successfully and I have tested with a live configuration - handle resolving completes successfuling.

This could provide alternative for some to get a server live.

Happy to share the build to project the above jar and/or the jar itself

Gives us a fall-back solution at least.  Hopefully formal fix will be out soon.

cpgr...@gmail.com

unread,
Nov 14, 2022, 10:03:43 AM11/14/22
to DSpace Technical Support
Thank you for your message.

We are considering rolling back our server to Nov 10th when the Ubuntu upgrade happened. Your fixed jar file would be a better quick fix.
Would you please send me a copy of the jar file and where I should put it? I notice multiple copies of that jar all over the server and I don't know which one it is crucial to replace and what to do to make it active.

Edmund Balnaves

unread,
Nov 14, 2022, 5:58:51 PM11/14/22
to DSpace Technical Support

The compiled handle.jar file is available at https://release.prosentient.com.au/handle62/handle.jar.gz
It can be used to replace the handle-6.2.jar reference in the dspace 6.4 build or copied directly to the target directly to the target directories - particularly of course lib

./lib/handle-6.2.jar
./webapps/jspui/WEB-INF/lib/handle-6.2.jar
./webapps/xmlui/WEB-INF/lib/handle-6.2.jar
./webapps/swordv2/WEB-INF/lib/handle-6.2.jar
./webapps/rdf/WEB-INF/lib/handle-6.2.jar
./webapps/rest/WEB-INF/lib/handle-6.2.jar
./webapps/sword/WEB-INF/lib/handle-6.2.jar
./webapps/oai/WEB-INF/lib/handle-6.2.jar

I have shared the build source at https://release.prosentient.com.au/handle62/handle6.2patched.tar.gz

The base is hdl 6.2.05 code from handle.net

Note that this does not contain the cnriutil references.

I compiled lib/cnriutil.jar derived from the classes in the dspace version of handle-6.2.jar

To achieve a distribution I modified the build.xml to remove references to the admintools. I'm guessing this must have been done before with the dspace distro.

I modified
./net/handle/server/Main.java
to remove System.runFinalizersOnExit(true);

Further work could be done to replace this with an alternative code
Runtime.addShutdownHook(new Runnable() {
public void run(){
// do whatever handle.net needs to exit cleaning on error();
}
});

However I have tested the above simple change successfully in an updated ubuntu server running the dspace handle resolver.
Not tested for long term service operation, so there is a risk the above change might lead to some memory leakage. However the fact that the handle service runs seperately makes it easy to monitor.

The build process is:
ant clean
ant server
ant distjar

The build output is in the dist folder

Hope this helps.

Edmund

Alan Orth

unread,
Nov 27, 2022, 4:45:09 AM11/27/22
to Edmund Balnaves, DSpace Technical Support
Ouch, this just hit us as well. As Edmund noticed, it's due to OpenJDK 1.8.0_352 removing the runFinalizersOnExit() method. See the release notes from the OpenJDK mailing list:


For now I've downgraded OpenJDK to the previous release on my Ubuntu 20.04 server (old versions are available on Launchpad) and told apt to hold them:

# apt-mark hold openjdk-8-jdk-headless:amd64 openjdk-8-jre-headless:amd64

DSpace version 6.x is now end of life (EOL) and we've really started to see more and more of these types of issues coming up. Need to plan to move to DSpace 7...

Regards,

--
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/9f3fa391-ce24-4e79-8a3c-2961fa573c02n%40googlegroups.com.


--

Sean Carte

unread,
Dec 12, 2022, 7:52:29 AM12/12/22
to Edmund Balnaves, DSpace Technical Support
Thank you for this, Edmund!

Sean

--

darryl....@usask.ca

unread,
Mar 24, 2023, 5:32:59 PM3/24/23
to DSpace Technical Support
A million thanks to you Edmund!  I patched our RHEL 7 server last night and got bit by this.  I was able to drop your JAR file into place and get us back up and running fairly quickly.

- Darryl

Reply all
Reply to author
Forward
0 new messages