johnperry / CTP

Clinical Trial Processor
http://mircwiki.rsna.org/index.php?title=CTP_Articles
65 stars 55 forks source link

Java versions supported #26

Open jhuguetn opened 3 years ago

jhuguetn commented 3 years ago

I have recently upgraded the OS of a machine hosting a CTP service and along with the OS, Java also got updated. Now I am at version 11. Attempting to start CTP as a service I get into the following issue,

Feb  9 13:00:19 XXX systemd[1]: Started CTP Service.
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: Starting CTP
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: java -Xmx2048m -Xms2048m -Djava.ext.dirs=null -jar libraries/CTP.jar
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: stderr: Error: Could not create the Java Virtual Machine.
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: stderr: Error: A fatal exception has occurred. Program will exit.
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: stderr: exit
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: stdout: -Djava.ext.dirs=null is not supported.  Use -classpath instead.
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: stdout: exit
Feb  9 13:00:20 XXX ctp-wrapper.sh[19460]: Exit: code 1
Feb  9 13:00:21 XXX ctp-wrapper.sh[19460]: Runner: exit.

Seems like after Java version 8 the command line directive -Djava.ext.dirs was deprecated with the recommendation to use -classpath instead. So CTP command offended Java version 11 and failed to run it as expected.

At this point I see 2 options, (a) install Java 8 and use it for running CTP (b) update CTP and see if it takes care of such deprecation and supports newer versions of Java

@johnperry, do latest versions of CTP support Java 9+ or still require Java 8 to run? What would your advice be here?

Thanks

johnperry commented 3 years ago

Jordi:

I think I need more information.

You said you are running as a service, and from the messages you listed, it appears that you are running Linux.

I don't see a –D parameter in any of the sh files in the CTP/linux directory. Can you look at the file that you are running to start your service and see if it contains a –D parameter? If so, remove it and see what happens.

I assume that your service starts CTP by running the Runner.jar program. That program only includes the –D parameter if the Java on which it is running is version 8 or less. Is it possible that your CTP is out of date?

JP

From: Jordi Huguet Sent: Tuesday, February 09, 2021 6:31 AM To: johnperry/CTP Cc: John Perry ; Mention Subject: [johnperry/CTP] Java versions supported (#26)

I have recently upgraded the OS of a machine hosting a CTP service and along with the OS, Java also got updated. Now I am at version 11. Attempting to start CTP as a service I get into the following issue,

Feb 9 13:00:19 strmaragall01 systemd[1]: Started CTP Service. Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: Starting CTP Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: java -Xmx2048m -Xms2048m -Djava.ext.dirs=null -jar libraries/CTP.jar Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: stderr: Error: Could not create the Java Virtual Machine. Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: stderr: Error: A fatal exception has occurred. Program will exit. Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: stderr: exit Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: stdout: -Djava.ext.dirs=null is not supported. Use -classpath instead. Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: stdout: exit Feb 9 13:00:20 strmaragall01 ctp-wrapper.sh[19460]: Exit: code 1 Feb 9 13:00:21 strmaragall01 ctp-wrapper.sh[19460]: Runner: exit. Seems like after Java version 8 the command line directive -Djava.ext.dirs was deprecated and the recommendation to use -classpath instead. In the past, java.ext.dirs was used to instruct the JRE from where to load additional class and jar files.

I see 2 options, (a) install Java 8 and use it for running CTP (b) update CTP and see if it takes care of such deprecation and supports newer versions of Java

@johnperry, do latest versions of CTP support Java 9+ or still require Java 8 to run? What would your advice be here?

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jhuguetn commented 3 years ago

Thanks for your help John.

Yes, my CTP instance is rather outdated, CTP Build: 2018.01.26 at 11:28:26 CST on Java 1.7

To clarify, I created a while ago a systemd daemon service for running CTP in a Linux system in a stable-ish mode. That's been working fine for some time and basically runs as follows (see processes),

/usr/bin/java -jar /opt/ctp/bin/Runner.jar start
\_ java -Xmx2048m -Xms2048m -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext -jar libraries/CTP.jar

As you can see above, is the Java process spawned by Runner.jar the one with such -D parameters. I am afraid I cannot do much to remove them.

johnperry commented 3 years ago

Jordi:

I think if you just remove the text

-Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext

from the start command, it will run.

JP

From: Jordi Huguet Sent: Tuesday, February 09, 2021 11:56 AM To: johnperry/CTP Cc: John Perry ; Mention Subject: Re: [johnperry/CTP] Java versions supported (#26)

Thanks for your help John.

Yes, my CTP instance is rather outdated, CTP Build: 2018.01.26 at 11:28:26 CST on Java 1.7

To clarify, I created a while ago a systemd daemon service for running CTP in a Linux system in a stable-ish mode. That's been working fine for some time and basically runs as follows (see processes),

/usr/bin/java -jar /opt/ctp/bin/Runner.jar start _ java -Xmx2048m -Xms2048m -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext -jar libraries/CTP.jarAs you can see above, is the Java process spawned by Runner.jar the one with such -D parameters. I am afraid I cannot do much to remove them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.