Community

Invoking web service from an ExternalActivityBehaviour

reply from HuiSheng Xu in jBPM - View the full discussion

Hi 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 cannot get the jbpm4's classloader.

 

I don't know much about jaxws,  If it could re-use threadContextClassLoader to find the class,  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.

Reply to this message by going to Community

Start a new discussion in jBPM at Community