johnperry / CTP

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

Configuration.java call to ClasspathUtil.listClasspath() method fails #25

Open howff opened 3 years ago

howff commented 3 years ago

Hi and sorry for the rookie question - I'm trying to use the git version of CTP in a standalone program but it is not working and I've tracked it down to this line

logger.info("Classpath:\n"+ClasspathUtil.listClasspath());

If I comment out that line then it works. Maybe I've got a bad version of ClasspathUtil or something? I seem to be using

     3175  2020-05-22 12:54   org/rsna/util/ClasspathUtil.class
howff commented 3 years ago

Actually this is a problem in the Util library, sorry for logging it here, follow up with https://github.com/johnperry/Util/issues/6

johnperry commented 3 years ago

Please put comments and questions on the RSNA MIRC CTP/TFS Google group (https://groups.google.com/g/rsnas-ctpmirc-user-group) so everyone will be able to follow.

In the transition from Java 8 to 9, the application classloader changed. In 8, it was a subclass of URLClassLoader. That provided a method for adding jars to, and listing, the classpath. In 9, the application classloader became its own class, and it provides neither of those features. Because CTP is designed to be extended without being rebuilt, it has to be able to update the classpath, so I changed the way that CTP starts to make it re-instantiate itself with a URLClassloader so the extension mechanism will work. See org.rsna.ctp.ClinicalTrialProcessor.java, lines 59-76 to see how it works.

If you are running CTP yourself in some way, you'll have to find your own way around the problem.

JP

howff commented 3 years ago

Thanks for your reply. Sorry I couldn't use the google group because my join request hasn't been allowed.

On Fri, 30 Oct 2020 at 12:55, John Perry notifications@github.com wrote:

Please put comments and questions on the RSNA MIRC CTP/TFS Google group ( https://groups.google.com/g/rsnas-ctpmirc-user-group) so everyone will be able to follow.

In the transition from Java 8 to 9, the application classloader changed. In 8, it was a subclass of URLClassLoader. That provided a method for adding jars to, and listing, the classpath. In 9, the application classloader became its own class, and it provides neither of those features. Because CTP is designed to be extended without being rebuilt, it has to be able to update the classpath, so I changed the way that CTP starts to make it re-instantiate itself with a URLClassloader so the extension mechanism will work. See org.rsna.ctp.ClinicalTrialProcessor.java, lines 59-76 to see how it works.

If you are running CTP yourself in some way, you'll have to find your own way around the problem.

JP

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johnperry/CTP/issues/25#issuecomment-719535577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXMD7BWCABF2QXU5T6OSTLSNKZTVANCNFSM4TE2ONIA .

johnperry commented 3 years ago

I spoke to Chris Carr at the RSNA. He checked, and you should be able to request to join the group.

There are several groups run by the RSNA. The one you want is called RSNA MIRC CTP/TFS User Group.

JP

From: howff Sent: Monday, November 02, 2020 10:06 AM To: johnperry/CTP Cc: John Perry ; Comment Subject: Re: [johnperry/CTP] Configuration.java call to ClasspathUtil.listClasspath() method fails (#25)

Thanks for your reply. Sorry I couldn't use the google group because my join request hasn't been allowed.

On Fri, 30 Oct 2020 at 12:55, John Perry notifications@github.com wrote:

Please put comments and questions on the RSNA MIRC CTP/TFS Google group ( https://groups.google.com/g/rsnas-ctpmirc-user-group) so everyone will be able to follow.

In the transition from Java 8 to 9, the application classloader changed. In 8, it was a subclass of URLClassLoader. That provided a method for adding jars to, and listing, the classpath. In 9, the application classloader became its own class, and it provides neither of those features. Because CTP is designed to be extended without being rebuilt, it has to be able to update the classpath, so I changed the way that CTP starts to make it re-instantiate itself with a URLClassloader so the extension mechanism will work. See org.rsna.ctp.ClinicalTrialProcessor.java, lines 59-76 to see how it works.

If you are running CTP yourself in some way, you'll have to find your own way around the problem.

JP

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johnperry/CTP/issues/25#issuecomment-719535577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXMD7BWCABF2QXU5T6OSTLSNKZTVANCNFSM4TE2ONIA .

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