Author |
Message
|
Bichu |
Posted: Mon Aug 19, 2019 5:09 am Post subject: JAR file not loading from shared library |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
Hi Guys,
I have an application build in IIB v10 where i am referencing a java routine from esql. I have created the java class as an independent resource, then exported it as a JAR file and placed it in a folder under C://lib. There was an existing configuration service for java class loader which also pick yet another jar file from C://lib. I then amended the existing configuration service for Java Class loader with the new jar name and its path. Also, did a restart of the broker and inspected via mqsireportbroker command and webconsole to confirm the new jar has been updated in the configuration service. Now when i deploy the BAR file to the server, I am getting the below error.
Code: |
BIP3202E: (com.xxxx.soa.xx.xxx.createMD5Hash, 1.12) : An error occurred when trying to resolve the Java class or method 'com.xxxx.gen.createMD5.createMD5Hash' which is referred to by the routine 'createMD5Hash'.
Further messages are generated that explain the error in more detail.
Correct the syntax of your Java expression in node 'com.xxxx.soa.xx.xxx.createMD5Hash', around line and column '1.12', then redeploy the message flow.
BIP2943E: The Java Method 'com.xxxx.gen.createMD5.createMD5Hash' could not be found as its containing class could not be found in the deployed bar file or in the 'workpath/shared-classes/' directory.
The specified Java Method 'com.xxxx.gen.createMD5.createMD5Hash' belongs to a class that could not be found in the deployed bar file or the 'workpath/shared-classes/' directory. Ensure that the fully qualified name of the method is correct and that its containing class or jar file is in the deployed bar file or in the 'workpath/shared-classes/' directory.
Examine and correct the SQL program. |
When I put the jar file under workpath/shared-classes directorey, its working. But I want the jar file to take from the shared class librarry which is C://lib. What am I missing in this case? |
|
Back to top |
|
 |
urufberg |
Posted: Mon Aug 19, 2019 7:26 am Post subject: |
|
|
Apprentice
Joined: 08 Sep 2017 Posts: 28
|
Hi,
Your problem is that you're adding an external dependency. In this this document is specified that
Quote: |
If you do not copy the JAR file to a valid shared-classes directory, ClassNotFoundException exceptions are generated at run time. |
You need to either add an internal dependency or use shared-classes.
Regards |
|
Back to top |
|
 |
timber |
Posted: Mon Aug 19, 2019 7:56 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Any reason why you are not using a shared library for this Java class? |
|
Back to top |
|
 |
Bichu |
Posted: Tue Aug 20, 2019 12:58 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
timber wrote: |
Any reason why you are not using a shared library for this Java class? |
Bcz I want to have all the JAR files under a single folder so that in case of any future migrations, the list of jar files can be easily retrieved rather than going for individual integration server folders. |
|
Back to top |
|
 |
Bichu |
Posted: Tue Aug 20, 2019 1:01 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
urufberg wrote: |
Hi,
Your problem is that you're adding an external dependency. In this this document is specified that
Quote: |
If you do not copy the JAR file to a valid shared-classes directory, ClassNotFoundException exceptions are generated at run time. |
You need to either add an internal dependency or use shared-classes.
Regards |
I saw the command on the link(https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/an37200_.htm ) and understood that jars can be placed in a shred folder too.
mqsicreateconfigurableservice IB9NODE -c JavaClassLoader
-o myJavaClassLoader
-n includedDeployedJars,sharedJarPath
-v "jcnapp1.jar","/var/app1/jars"
Is my understanding correct? |
|
Back to top |
|
 |
timber |
Posted: Tue Aug 20, 2019 4:51 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Not sure, but it's probably easy to try it out.
I'm not sure that I understand why having a single folder is so important. Seems to me that a simple directory search would quickly discover all of the jar files that have been deployed. Or a text search in your deployment script. |
|
Back to top |
|
 |
abhi_thri |
Posted: Tue Aug 20, 2019 4:55 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
Bichu wrote: |
I saw the command on the link(https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/an37200_.htm ) and understood that jars can be placed in a shred folder too.
mqsicreateconfigurableservice IB9NODE -c JavaClassLoader
-o myJavaClassLoader
-n includedDeployedJars,sharedJarPath
-v "jcnapp1.jar","/var/app1/jars"
Is my understanding correct? |
hi...yes, you can use a config service to load the external classes but in V10 as Java isolation is enabled by default in order to use a JavaClassLoader config service the includedDeployedJars need to be set as none.
Quote: |
Note Inside applications or shared libraries that have Java isolation enabled, you can use a JavaClassLoader configurable service only if the includedDeployedJars property is set to none. Deployed JAR files inside applications or shared libraries with Java isolation enabled are not visible to JavaClassLoader configurable services. For more information, see Java isolation.
|
https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/bn28733_.htm
How many jar files are we talking here, if it is just a few ones and the deployment of which via a shared library doesn't take ages then I guess a Shared library might be a better fit here.
Bichu wrote: |
Bcz I want to have all the JAR files under a single folder so that in case of any future migrations, the list of jar files can be easily retrieved rather than going for individual integration server folders. |
If are you maintaining the jars via a shared library you just need to deploy that along with the applications in future as well, no need to search through individual integration server folders.
Having said that I've seen scenarios where JavaClassLoader config service were used successfully where we had to include many external jars file (deployment of which directly to Broker via Bar file usually times out due to the size of the bar file) |
|
Back to top |
|
 |
|