ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JavaCompute Node java.lang.NoClassDefFoundError [SOLVED]

Post new topic  Reply to topic
 JavaCompute Node java.lang.NoClassDefFoundError [SOLVED] « View previous topic :: View next topic » 
Author Message
jlalbor
PostPosted: Thu Apr 26, 2007 10:15 am    Post subject: JavaCompute Node java.lang.NoClassDefFoundError [SOLVED] Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 26, 2007 11:47 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Put the ojbdbc14.jar in shared-classes.

Restart the broker.

*Never* put anything into /bin or /classes.

The classloader tree (mostly) is http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/as24996_.htm

I have been told that it is missing a classloader, the "EG Shared" classloader, that is a child of Shared. This is the classloader that JCNs go into.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jlalbor
PostPosted: Thu Apr 26, 2007 2:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
jlalbor
PostPosted: Thu Apr 26, 2007 3:36 pm    Post subject: SOLVED Reply with quote

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
View user's profile Send private message
ak
PostPosted: Mon Jul 09, 2007 3:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JavaCompute Node java.lang.NoClassDefFoundError [SOLVED]
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.