|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JavaCompute Node java.lang.NoClassDefFoundError [SOLVED] |
« View previous topic :: View next topic » |
Author |
Message
|
jlalbor |
Posted: Thu Apr 26, 2007 10:15 am Post subject: JavaCompute Node java.lang.NoClassDefFoundError [SOLVED] |
|
|
Apprentice
Joined: 18 Feb 2003 Posts: 38
|
We are using WMB 6 CSD3
OS AIX 5.2-9
I have create a JavaCompute Node that requieres the java library ojdbc14.zip file in order to connect to an Oracle DataBase using JDBC type 4 Driver.
In the Java Project I added this zip file in the Java Build Path.
I also copied the ojdbc14.zip to the WorkPath/shared-classes folder in the Broker runtime. (/var/mqsi/shared-classes), just as the documentation says.
The message flow deploys fine with the Jar of the JavaCompute node, but when the message flows executes the Java Custom node, it throws the following error:
bip number 4395
Unhandled exception in plugin method java.lang.NoClassDefFoundError
I also copied the jar file to the folder:
/opt/IBM/mqsi/6.0/classes
In both cases i restarted the broker (mqsistop and mqsistart) but for some reason the Broker does not load the ojdbc14.zip.
Finally I decided to add the ojdbc14.zip to the classpath and restarted the Broker, in this case the Java Compute node worked fine, the broker could load the class with no problem.
The question here is, why the Broker is not loading the jar file from the /var/mqsi/shared-classes ?
Adding the jar file to the classpath is correct?,
should i do it in any other way?
Here is what the Broker documentation says:
Quote: |
The Java code in a JavaCompute node might contain references to other Java projects in your Eclipse workspace (internal dependencies), or to external JAR files, for example the JavaMail API (external dependencies). If other JAR files are referenced, you must add the files to the project class path.
Right-click the project folder of the project that you are working on and click Properties.
Click Java Build Path on the left pane.
Click the Libraries tab.
Perform one of the following steps:
To add an internal dependency, click Add JARs..., select the JAR file that you want to add then click OK.
To add an external dependency, click Add External JARs..., select the JAR file that you want to add, then click Open. Copy the file to WorkPath/shared-classes where WorkPath is the full path to the working directory of the broker. If you do not copy the external dependencies here ClassNotFoundException exceptions are generated at run time. |
How does the WorkPath/shared-classes works?
Any suggestions or comments?
Thank you. _________________ Ing. José Luis Albor GarcÃa
IBM Certified System Administrator – WebSphere MQ V6.0
IBM Certified Solution Designer – WebSphere Message Broker V6.0
Last edited by jlalbor on Thu Apr 26, 2007 3:39 pm; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 26, 2007 11:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
jlalbor |
Posted: Thu Apr 26, 2007 2:56 pm Post subject: |
|
|
Apprentice
Joined: 18 Feb 2003 Posts: 38
|
Thanks jefflowrey for the answer
Maybe i did not explain myself correctly, but actually I put the ojdbc14.zip in the /var/mqsi/shared-classes folder, and restarted the broker, but apparently this is not enough because the broker still throws the java.lang.NoClassDefFoundError when the JavaCompute node is executed.
I had to add the reference /var/mqsi/shared-classes/ojdbc14.zip in the CLASSPATH environment variable and restart the Broker in order to have the JavaCompute Node work correctly.
My question is if this is how it should be done?
Is not the Broker supposed to load the zip file just by the fact that it is in the shared-classes folder?
Thanks you. _________________ Ing. José Luis Albor GarcÃa
IBM Certified System Administrator – WebSphere MQ V6.0
IBM Certified Solution Designer – WebSphere Message Broker V6.0 |
|
Back to top |
|
 |
jlalbor |
Posted: Thu Apr 26, 2007 3:36 pm Post subject: SOLVED |
|
|
Apprentice
Joined: 18 Feb 2003 Posts: 38
|
I have found that the Broker only loads jar files, not zip files. I have rename the ojdbc14.zip file to ojdbc14.jar and now the JavaCompute Node works fine without the need of adding the reference to the file in the CLASSPATH environment variable.
Thank you. _________________ Ing. José Luis Albor GarcÃa
IBM Certified System Administrator – WebSphere MQ V6.0
IBM Certified Solution Designer – WebSphere Message Broker V6.0 |
|
Back to top |
|
 |
ak |
Posted: Mon Jul 09, 2007 3:42 am Post subject: |
|
|
Apprentice
Joined: 07 Aug 2006 Posts: 48 Location: England
|
Am using a Java Compute Node in my message flow but I thought any external jars required would be automatically included in the bar file when I buiid it in the broker archive editor.
1. It definately didn't do it but instead created a jar file with which only include my new java class. This jar file however is still shown with a green icon with a red cross in the broker archive editor( apprently it means that it needs to be refreshed!!).
2. I also had to add the external jar files to workpath/shared-classes, for the broker to pick them up. is this right about the compute node? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|