-
1. Re: Invoking web service from an ExternalActivityBehaviour
rebody Jun 17, 2010 9:08 PM (in response to smalbequi)1 of 1 people found this helpfulHi Stephane,
Do you mean that when you run a process and in a acitivity, it will use a webservice to do some request. But jaxws cannot find the webservice interface class?
Because you packed externalActivityBehaviour and ws classes into .bar, when the process ran, jbpm4 will load these classes from database. At this time, jbpm4 will use a specified classloader to find these classes. And seems jaxws cannot find these classes, so I guess jaxws didn't know the jbpm4's classloader exists.
I don't know much about jaxws, If it could re-use threadContextClassLoader to find related classes, we could re-configure current thread contextClassLoader in the externalActivityBehaviour. like this:
ClassLoader original = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); // do ws } finally { Thread.currentThread().setContextClassLoader(original); }
But if jaxws couldnot re-use contextClassLoader, I am afraid you should find a way to let jaxws access the jbpm4 deployclassloader to achieve that.
And Good Luck.
-
2. Re: Invoking web service from an ExternalActivityBehaviour
sebastian.s Jun 18, 2010 2:34 AM (in response to rebody)In the jBPM 3.2 there is a configuration property to set the classloader. While running in quite a similar issue I managed to solve it by setting:
<string name="jbpm.class.loader" value="context" />
in jbpm.cfg.xml.
-
3. Re: Invoking web service from an ExternalActivityBehaviour
smalbequi Jun 18, 2010 4:18 AM (in response to rebody)Thanks a lot HuiSheng, it works like a charm!
-
4. Re: Invoking web service from an ExternalActivityBehaviour
rebody Jun 18, 2010 5:17 AM (in response to sebastian.s)Hi Sebastain,
I searched jbpm3 sources, and find this property is used in the org.jbpm.util.ClassLoaderUtil.java. It is used to decide which classLoade you will use, the class loaded jbpm or the current thread context class loader. It won't chane the current thread context loader, So event if we add this feature in jbpm4, it won't help to solve this problem.