Author |
Message
|
paustin_ours |
Posted: Mon Sep 12, 2016 12:26 pm Post subject: execution group class loader |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
we deploy 5 copies of the same flow in an EG with different names of course listening on the same queue. [ its a different story why we are not using additional instances, that i dont want to bore you guys with]
the problem is, sometimes one or two of the deployed flow errors out with a class not found. On a re deploy it works fine.
it almost looks like an issue with the class loader and it looks like somehow the class loader completed before all jars are loaded since when we deploy the same flow 5 times, we are essentially over writing the same JCN jar 5 times.
assuming that is the issue, will setting up the java class loader configurable service might help?
anyone had similar problems? |
|
Back to top |
|
 |
vishBroker |
Posted: Mon Sep 12, 2016 1:06 pm Post subject: |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
We have done similar setup.
And we have used JavaClassLoader configurable service.
It is working fine.
Note - In our casae -
1. for use, even if the flow is similar (generated from pattern), each instance has some different configuration (different URI prefix).
(This is just to say..I have similar setup - same flow deployed multiple times with some different settings.) |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Sep 12, 2016 1:13 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Thanks. Thinking through this further, what i think is happening is when i deploy flow 1 and the class loader is loading the classes, flow 2 deployment comes along and replaces the jar file completely and then flow 3 gets deployed and so on, since the deploy is happening and overwriting the jars, ti is messing up the class loader.
if this theory is correct, setting up configurable service doesn't solve the issue right? |
|
Back to top |
|
 |
vishBroker |
Posted: Mon Sep 12, 2016 1:29 pm Post subject: |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
I don't think so ( simple reason is - it is working)
Anyhow, to understand the behaviour ( which we, always, want to do) -
we are using sharedJarPath
+++
The fully qualified file path of a single additional directory to be searched by the classloader. The directory must not be in the integration node file path or work path, as defined by the MQSI_FILEPATH and MQSI_WORKPATH environment variables.
+++
Now, this is how I understood it works -
1. When the first deployment is done and classLoader is defined - JVM classloader looks for the required classes in the specified directory.
2. When you are deploying for 2nd time, I do not think it will replace the previous flow's jar file, it will be a different JAR file.
3. Every flow (in our case every instance created from pattern) has different JAR fileName that gets deployed with the application(flow). |
|
Back to top |
|
 |
vishBroker |
Posted: Mon Sep 12, 2016 1:35 pm Post subject: Re: execution group class loader |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
paustin_ours wrote: |
...
the problem is, sometimes one or two of the deployed flow errors out with a class not found. On a re deploy it works fine.
...
|
Well, coming back to above point in your post - This looks like you are NOT having deployment time issue.
you are running into runtime issue. => Now, is it happening everytime or sporadic?
DOes it happen for the same class not being found? or everytime, it is different class?
Have you used 'java isolation' property on the BAR file? Is it checked (default setting) or unchecked?
In our case, we uncheck java-isolation ( we were running into deployment failure issues) |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Sep 12, 2016 1:58 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
I should clarify a couple of things
I am on v8004
Also my jar is part of the bar. The JCN jar.
I thought it overwrites the jar in the EG directory. I have to look.
I didn't think a jar file per flow is getting created. |
|
Back to top |
|
 |
vishBroker |
Posted: Mon Sep 12, 2016 5:19 pm Post subject: |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
paustin_ours wrote: |
I should clarify a couple of things
...
I didn't think a jar file per flow is getting created. |
You can look at the .bar file (generated Bar files)- there you can see a JAR file. THere will be JAR for in every .bar which has JCN |
|
Back to top |
|
 |
paustin_ours |
Posted: Tue Sep 13, 2016 5:50 am Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
thanks for taking the time again. i do see the jar file inside the BAR. My question is how is this jar file stored on the server when deployed. I am assuming that this jar files gets overwritten each time a copy of the flow is deployed.
if that is the case will it mess up the class loader somehow? if it can, then moving to configurable service would not solve the issue, at least i dont think. |
|
Back to top |
|
 |
vishBroker |
Posted: Tue Sep 13, 2016 4:29 pm Post subject: |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
Well, by definition, the classLoader is used to load the classes on NEED basis (on-demand).
Now,
1. I do not think, every time, you are doing the deployment the class loader is getting called.(configurableService classloader)
2. Remember the JavaClassLoader configurable service - points to the directory ( in our case) which contains required JAR files -> The classes - needed by the JCN class.
3. Now, as it is the same configurable service(used by multiple applications->flow->JCN) , and they are in the SAME JVM (EG) - the required classes are already been loaded.
(Required classes from the JAR files present in the directory pointed by configurableService).
4. When you deploy new flow - only the JAR file (which contains java class object for the JCN node) is loaded/copied in JVM.
It does not load other classes referred by JCN ( It need not load as mentioned in #3)
so, I do not think the JARs are getting overwritten each time a copy of the flow is deployed.
Also note that, even the classes (JCN) might have same code, for JVM they would be different classes. JVM looks at the fully qualified class name.
(you can import the JAR files - generated in the .bar , in sample java project and see the contents).
Well, this is what I think..or I understood ..how IIB works with classloader.
Experts might correct it.
Last edited by vishBroker on Tue Sep 13, 2016 4:33 pm; edited 1 time in total |
|
Back to top |
|
 |
vishBroker |
Posted: Tue Sep 13, 2016 4:32 pm Post subject: |
|
|
Centurion
Joined: 08 Dec 2010 Posts: 135
|
To add more,
It would be interesting to know your observations when you deploy 5 copies of the same flow using configurableService ( in sandbox - obviously) .
Do let me know - the results when you select 'Java Isolation' and when you don't.
You may want to go to IIB v9.005 or higher for java isolation option. |
|
Back to top |
|
 |
|