Author |
Message
|
paerjohan |
Posted: Wed Mar 02, 2011 3:34 am Post subject: Problem with Java Classloader service in WMB 7.0.0.2 |
|
|
Newbie
Joined: 19 Jan 2010 Posts: 8
|
Hello
I have written a simple test flow with only an HTTPInput node and a JavaCompute node to test the Java classloader service in WMB 7.0.0.2. But when I deploy the flow I get a
ClassNotFoundException for the java class used by the JavaCompute node (the class given in the "Java class" property of the JavaCompute node).
Code: |
BIP4157E: The user-defined node 'Java Compute' could not be deployed. Details: java.lang.ClassNotFoundException: dk.atp.iet.test.CLTest_JavaCompute
The node could not be deployed because an error in the node's 'onInitialize' method prevented the node from initializing.
Review the details given above. Report the error to the node's writer if you cannot correct the error yourself.
BIP4395E: Java exception: 'java.lang.ClassNotFoundException'; thrown from class name: 'java.lang.ClassNotFoundException', method name: '<init>', file: 'ClassNotFoundException.java', line: '77'
The message contains that data associated with a Java exception.
No user action required. |
Here is my JavaClassLoader services:
Code: |
C:\wmb7>mqsireportproperties MB7BROKER -c JavaClassLoader -o AllReportableEntity
Names -r
JavaClassLoader
Template
includedDeployedJars='automatic'
sharedJarPath=''
atpws
includedDeployedJars='automatic'
sharedJarPath='C:\WMBJavaClassLoaderServices\atpws\'
BIP8071I: Successful command completion. |
I have tried both "atpws" and "Template" on the Java classloader service property of the JavaCompute node. In both cases I get the exception
when I deploy the flow. If I don't set the Java classloader service property, the flow in deployed successfully.
I also asked a colleugue to test the ClassLoader Service functionallity of WMB7 and she also got the same problem when deploying.
Pär-Johan |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 4:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Hi -
The comments about the OnInitialize failing are pretty clear? That's a problem with your code somewhere, likely not finding a resource it needs.
Take a service trace of the deployment.
Examine the console.txt file for the EG you are deploying to. |
|
Back to top |
|
 |
Esa |
Posted: Wed Mar 02, 2011 4:45 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Hello Pär Johan,
I bet you just need to restart the broker after adding the configurable classloader. And every time you have added a jar file in the SharedJarPath |
|
Back to top |
|
 |
paerjohan |
Posted: Wed Mar 02, 2011 5:03 am Post subject: |
|
|
Newbie
Joined: 19 Jan 2010 Posts: 8
|
Hello again
I'm only trying to deploy the skeleton code for the JavaCompute node (see below),
I have not added any extra code.
I can only deploy when the Classloader service property is not set.
Esa:
I have restarted the broker after added the configurable classloader, but I'm still getting the same error.
Code: |
package dk.atp.iet.test;
import com.ibm.broker.javacompute.MbJavaComputeNode;
import com.ibm.broker.plugin.*;
public class CLTest_JavaCompute extends MbJavaComputeNode {
public void evaluate(MbMessageAssembly assembly) throws MbException {
MbOutputTerminal out = getOutputTerminal("out");
MbOutputTerminal alt = getOutputTerminal("alternate");
MbMessage message = assembly.getMessage();
// ----------------------------------------------------------
// Add user code below
// End of user code
// ----------------------------------------------------------
// The following should only be changed
// if not propagating message to the 'out' terminal
out.propagate(assembly);
}
} |
|
|
Back to top |
|
 |
Esa |
Posted: Wed Mar 02, 2011 5:37 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Did you package your CLTest_JavaCompute class in a jar file and put the jar in your sharedJarPath (C:\WMBJavaClassLoaderServices\atpws) ? |
|
Back to top |
|
 |
paerjohan |
Posted: Wed Mar 02, 2011 5:57 am Post subject: |
|
|
Newbie
Joined: 19 Jan 2010 Posts: 8
|
Hello Esa
If I understand the documentation correct, the sharedJarPath is for additional classes.
If I choose automatic in the includedDeployedJars, the jar that contains the CLTest_JavaCompute class should be loaded, because this is the class associated by the JavaCompute node. So it should not be neccessary to add it to the sharedJarPath. Or have I misunderstood this completely? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 5:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I just ran some tests on this. I'm able to reproduce the error you're seeing.
I'm also able to resolve it by putting the JCN Jar file in the classloader folder, as Esa mentions.
However, that shouldn't be necessary with an includedDeployedJars of automatic.
I suspect the problem is the deployment order - that the message flow is being deployed before the jar file.
So try deploying just the JAR file and then just the message flow.
And then open a PMR and report this. Include a specific link to this discussion. |
|
Back to top |
|
 |
paerjohan |
Posted: Wed Mar 02, 2011 6:12 am Post subject: |
|
|
Newbie
Joined: 19 Jan 2010 Posts: 8
|
Yes, I'm also able to resolve it if I'm putting JCN Jar file in the classloader folder.
I've also tried to deploy the jar-file first and then the flow. I can deploy the jar-file, but when I try to deploy to messageflow only I get the same error.
I will open a PMR, and while waiting for a fix I will use Esa's method.
Thank you |
|
Back to top |
|
 |
Esa |
Posted: Wed Mar 02, 2011 6:20 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
I recall I never managed to make automatic work. But I soon ended up calling the JCN from a separate subflow project, and then automatic was not an option any more.
Did you try the third option, assigning a semicolon separated list of jar file names to IncludedDeployedJars? |
|
Back to top |
|
 |
paerjohan |
Posted: Wed Mar 02, 2011 6:27 am Post subject: |
|
|
Newbie
Joined: 19 Jan 2010 Posts: 8
|
Quote: |
Did you try the third option, assigning a semicolon separated list of jar file names to IncludedDeployedJars? |
Yes, I have tried it. It didn't help . |
|
Back to top |
|
 |
lalit999 |
Posted: Sat Apr 07, 2012 9:32 am Post subject: Same issue |
|
|
Newbie
Joined: 07 Apr 2012 Posts: 3
|
We are facing the same issue with WMB 7.0.0.1. Can someone please post the solution if any. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 09, 2012 5:11 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
"We are facing the same issue"?
paerjohan overwrote the default classloader which caused him to not be able to load classes from the standard locations.
Did you do this also? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
lalit999 |
Posted: Mon Apr 09, 2012 10:27 am Post subject: |
|
|
Newbie
Joined: 07 Apr 2012 Posts: 3
|
Yes, I have created java class loader configurable service and had set the SharedDeploypath to local folder where all jar's are present.
While deploying the .bar file getting ClassNotFound exception for one of the class eventhough it is present in the Shared deployed path.
Please advise |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 09, 2012 10:46 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Since this is a different problem than what paerjohan had, why not create a new thread instead of opening an old one.
Collect MustGather artifacts and post relevant parts of the service trace in your new thread, surrounded by [c o d e] tags.
Alternately, you could open a PMR with same. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 09, 2012 10:49 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
|