Java Integration Stage NoClassDefFoundError:

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Java Integration Stage NoClassDefFoundError:

Post by betterthanever »

Hello,

I am trying to call a Java Program by extending processor class. When I ran the job by bundling a simple java program to invoke a public API it worked fine and I got a response back from the java program.

Then I tried a java program to call a Real API using the same method of bundling the java program into a .jar file and copying it to a location and giving that location as the class path in the java integration stage.

When I run the job, it is failing with a Class definition not found error below. Since it worked when I called the Public API, I assume it should work the same way in the second case as well. Am I missing something? I made sure the below class archive file and the class are available in the bundle .jar file. I appreciate any help on this.

IntValueGenerator: java.lang.NoClassDefFoundError: javax.ws.rs.core.MultivaluedMap
at java.lang.J9VMInternals.verifyImpl (J9VMInternals.java)
at java.lang.J9VMInternals.verify (J9VMInternals.java: 72)
at java.lang.J9VMInternals.initialize (J9VMInternals.java: 134)
at java.lang.J9VMInternals.newInstanceImpl (J9VMInternals.java)
at java.lang.Class.newInstance (Class.java: 1345)
at com.ibm.is.cc.javastage.connector.CC_JavaConnection.connect (CC_JavaConnection.java: 158)
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

If it is giving NoClassDefFoundError: javax.ws.rs.core.MultivaluedMap then either:
1) The jar that contains it isn't in the class path when it is being run by DataStage.
2) The class it found contains a dependency restriction, and is not the correct release for the current version of java being used.

I usually debug by trying to run the test app without DataStage in the picture - using a small java "caller" program. If it works, then I go check to insure DataStage is using the same environment variable settings - for example PATH, JAVA_HOME, etc.

I believe the class that contains MultivaluedMap may have different versions for Java 6 EE and Java 7 EE - you might want to confirm that first.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

thanks for the response.
I made sure the .jar bundled is using the same JAVA 6 and the standalone test with a main method in it is working fine. when we try to trigger from DataStage it is failing.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Try adding CLASSPATH straight to the job and append the path to your jar file.
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

I had to add the required .jars explicitly in the class path, even after bundling them in the main class .jar file. This is fixed now.
Post Reply