I am relatively to JBoss/jBPM but have been having good sucess with it so far. 
However I have just hit a problem that has had me stumped for the better part 
of a day now.

I am using:

 - jboss-EJB-3.0_RC5-PFD
 - jbpm-3.1
 - jboss-4.0.4RC1

Most of it works fine, except I am having trouble with the execution of a jBPM 
process invoked from a @Stateless session bean.

I have a process definition deployed into my database that I can successfully 
invoke from a method in the stateless session bean. However if I attempt to 
trigger a custom ActionHandler from the process, jBPM complains that it cannot 
find the action handler class.

Here is an extract of my processdefinition.xml file:

anonymous wrote : 
  |   |    <start-state name="start">
  |   |       <transition name="" to="Invoke Call"></transition>
  |   |    </start-state>
  |   |    <state name="Invoke Call">
  |   |       <event type="node-enter">
  |   |          <action name="createCall" config-type="field" 
class="com.vieo.ccs.process.actions.CreateCallActionHandler" />
  |   |       </event>
  |   |       <transition name="ACTIVE" to="Setup Success"></transition>
  |   |    </state>
  |   | 

The exception I am getting is as follows:

anonymous wrote : 
  | 18:30:00,156 ERROR [GraphElement] action threw exception: couldn't get 
value for file 
'classes/com/vieo/ccs/process/actions/CreateCallActionHandler.class' 
org.jbpm.JbpmException: couldn't get value for file 
'classes/com/vieo/ccs/process/actions/CreateCallActionHandler.class'
  |         at 
org.jbpm.file.def.FileDefinition.getBytes(FileDefinition.java:186)
  |         at 
org.jbpm.instantiation.ProcessClassLoader.findClass(ProcessClassLoader.java:55)
  |         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  |         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  |         at 
org.jbpm.instantiation.Delegation.instantiate(Delegation.java:140)
  |         at 
org.jbpm.instantiation.Delegation.getInstance(Delegation.java:125)
  |         at 
org.jbpm.instantiation.Delegation$$FastClassByCGLIB$$6bae1598.invoke()
  |         at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  |         at 
org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:161)
  |         at 
org.jbpm.instantiation.Delegation$$EnhancerByCGLIB$$1e6cb7ea.getInstance()
  |         at org.jbpm.graph.def.Action.execute(Action.java:122)
  |         at 
org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:235)
  |         at 
org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
  | ...
  | <stuff cut>
  | ...
  | Caused by: org.jbpm.JbpmException: file 
'classes/com/vieo/ccs/process/actions/CreateCallActionHandler.class' not found 
in db
  | ...
  | <more stuff cut>
  | ...
  | 18:30:00,156 ERROR [StartProcessActionHandlerBean] JBPMException: 
org.jbpm.graph.def.DelegationException
  | 


Now, to me this looks like jBPM cannot find my ActionHandler class 
(com.vieo.ccs.process.actions.CreateCallActionHandler) so I wrote a little bit 
of code in my stateless session bean to test it:

anonymous wrote : 
  |   |                 try {
  |   |                         ClassLoader classloader = 
this.getClass().getClassLoader();
  |   |                         Class systemC = 
classloader.loadClass("com.vieo.ccs.process.actions.CreateCallActionHandler");
  |   |                         logger.info("Loaded system class: " + systemC);
  |   |                 } catch (ClassNotFoundException e) {
  |   |                         logger.error("Error system class loader! : " + 
e);
  |   |                 }
  |   |                 try {
  |   |                         // Test org.jbpm.util.ClassLoaderUtil
  |   |                         Class jbpmC = 
ClassLoaderUtil.loadClass("com.vieo.ccs.process.actions.CreateCallActionHandler");
  |   |                         if( jbpmC != null ) {
  |   |                                 logger.info("Loaded jbpm class: " + 
jbpmC);
  |   |                         } else {
  |   |                                 logger.info("Loaded jbpm class: null");
  |   |                         }
  |   |                 } catch (JbpmException e) {
  |   |                         logger.error("Error jbpm class loader! : " + e);
  |   |                 }
  |   | 

And sure enough, I can successfully access this class from my code, but for 
some reason if I use the jBPM ClassLoader then it cannot be found! 

Here is the output:

anonymous wrote : 
  | 18:30:00,109 INFO  [StartProcessActionHandlerBean] Loaded system class: 
class com.vieo.ccs.process.actions.CreateCallActionHandler
  | 18:30:00,125 ERROR [StartProcessActionHandlerBean] Error jbpm class loader! 
: org.jbpm.JbpmException: class not found 
'com.vieo.ccs.process.actions.CreateCallActionHandler'
  | 

My understanding is that, for some reason, jBPM cannot access my classes (which 
are currently deployed as a .jar within my .ear package).

How do I make the classes in my .ear visible to the installed jBPM instance? 
(jBPM was installed using 'ant -f build.deploy.xml create.jbpm.configuration' 
and I'm using the jbpm JBoss configuration).

Thanks for your help!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927406#3927406

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927406


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to