johnperry/CTP

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

Opened this issue · 4 comments

howff commented

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

Actually this is a problem in the Util library, sorry for logging it here, follow up with
johnperry/Util#6

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