OHDSI Home | Forums | Wiki | Github

Cpt4 utility not working

(Scott Jones) #1

I am trying to run the cpt4 utility to update the CONCEPT table but I am running into an issue. One thing I did notice is that there was no lib folder in my download. Here is the error I am receiving:

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/ws/Service
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.odhsi.utils.cpt.ApplicationContextServer.init(ApplicationContextServer.java:42)
at org.odhsi.utils.cpt.Application.main(Application.java:44)
Caused by: java.lang.ClassNotFoundException: javax.xml.ws.Service
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 11 more

Thanks in advance…

(Anna Karenina) #2

Hello @oksanascott,

This is only a warning, so it shouldn’t prevent the utility from working completely. Were there any other errors?
Also, if it’s possible, you could try using Java 8 to run this.

(Scott Jones) #3

Thanks for the reply. According to the logfile, the update failed:

[INFO ] 2019-11-15 08:19:10.380 [main] Application - Update failed. Usage: java -Dumls-user= -Dumls-password= -jar cpt4.jar
-Dumls-user is mandatory.
-Dumls-password is mandatory.
version is mandatory. Possible values are 4 or 5
output-file-name is optional.

I will try installing Java 8 and re-running.

(Scott Jones) #4

I re-ran using Java 8 and I get the same error. I downloaded the vocabularies 3 times and never got a lib folder with the downloads. It looks like maybe a java.xm.ws file is missing?

(Pascal Brandt) #5

I was able to resolve the java.lang.NoClassDefFoundError: javax/xml/ws/Service by using Java 8 and making sure my JAVA_HOME was correct (I use jenv).

I then ran:


However, my password has a $ in it, so I had to escape it. My command ended up looking something like:

./cpt.sh username “pa\$\$word”

@oksanascott, what command did you run, and which error did you see again?

EDIT: The same issue is also discussed here:

(Scott Jones) #6

I’m using Windows 10. I installed Java 8 and updated the PATH and JAVA_HOME variables.
I ran: java -Dumls-user=xxx -Dumls-password=xxx -jar cpt4.jar 5

My password has an ‘@’ in it, does it need to be escaped?

(Pascal Brandt) #7

I’m not sure if @ needs to be escaped, but it might be worth trying using quotes:

java -Dumls-user=“xxx” -Dumls-password=“xxx” -jar cpt4.jar 5

and escaping:

java -Dumls-user=“xxx” -Dumls-password=“x\@xx” -jar cpt4.jar 5

Can you share the full output that you are seeing, as well as the contents of the log file here?

Also, what does running the following show?

java -version

(Scott Jones) #8

I got it to work. I uninstalled Java 13 and installed Java 8 and then it worked. Just an FYI, I didn’t need to escape the ‘@’ in my password.

Thank you for all your help!

(Chetan) #9

@Chris_Knoll, @Christian_Reich

How to make the cpt4.jar file run with latest version of Java? I don’t have java8 on the machine.

(Yaroslav) #10

Сurrently only java version 8 is supported. Support for higher versions will be added in the next version.

(Pascal Brandt) #11

Assuming you have Docker installed, one simple solution is to navigate to the directory containing cpt.sh and then run:

docker run --rm -v ${PWD}:/ohdsi -w /ohdsi openjdk:8u232-jre ./cpt.sh user pass

Replacing user and pass with your UMLS credentials.

(Michael Gurley) #12

Any idea when the next version will be released to support later versions of Java?