[jBPM] - Different ClassLoader, ClassCastException
by Konrad Schuler
Konrad Schuler [http://community.jboss.org/people/pseudoJBoss] created the discussion
"Different ClassLoader, ClassCastException"
To view the discussion, visit: http://community.jboss.org/message/535208#535208
--------------------------------------------------------------
Hi,
first, something to the background.
I try to run a simple BPMN 2.0 Process on jbpm-4.4-SNAPSHOT, where the user tasks can be handled by a Portlet (JSF, Facelets) on Liferay 5.2.3. The AS is JBoss 5.1.
The deployment of the Process I do as follows
ProcessEngine pe=new Configuration().buildProcessEngine();
RepositoryService repositoryService = pe.getRepositoryService();
NewDeployment deployment = repositoryService.createDeployment();
deployment.addResourceFromClasspath("myprocess.bpmn.xml");
deployment.deploy();
and it works fine.
Than I start the process as follows
Customer customer=new Customer("Firstname", "Lastname");
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("customer", customer);
ProcessInstance pi = pe.getExecutionService().startProcessInstanceByKey("myprocess", variables);
and it also works fine.
Than in a JSF Bean I wand to read the "customer" variable to handle a user task. So I do the following.
String executionId=pe.getTaskService().getTask(currentTaskId).getExecutionId();
Customer customer=(Customer)pe.getExecutionService().getVariable(executionId, "customer");
And here I have a problem.
If the com.mycomp.Customer class is within my .war than there is a ClassNotFoundException .. com.mycomp.Customer...
If I put the com.mycomp.Customer class to the JBoss (global) libs, than there is a ClassCastException ... can not cast com.mycomp.Customer to com.mycomp.Customer ...
- I am sure that there is only one com.mycomp.Customer class within my JBoss
- And the com.mycomp.Customer class implements Serializable with a generated serial version id
I think the problem is the different ClassLoader. After debugging I've found out that the ClassLoader of the class of
pe.getExecutionService().getVariable(executionId, "customer")
is BaseClassLoader@c94114{vfsfile:/C:/Programms/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}
and the ClassLoader of
Customer customer...
is BaseClassLoader@12e43f8{vfsfile:/C:/Programms/jboss-5.1.0.GA/server/default/deploy/MyWebApp.war/}
So what can I do to solve the problem.
Thank you!!!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/535208#535208]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 6 months
[jBPM] - Error with asynchronous execution
by ABIDI Sami
ABIDI Sami [http://community.jboss.org/people/uaibys] created the discussion
"Error with asynchronous execution"
To view the discussion, visit: http://community.jboss.org/message/535199#535199
--------------------------------------------------------------
Hello,
I want to execute a jbpm process in asynchronous continuation mode, and here is a part of the source code that i used :
ProcessEngine processengine = new Configuration().buildProcessEngine();
RepositoryService repositoryservice = processengine.getRepositoryService();
ExecutionService executionservice = processengine.getExecutionService();
ManagementService managementService = processengine.getManagementService();
ProcessInstance processInstance = executionservice.startProcessInstanceById("Clef-4");
Job job = null;
job = managementService.createJobQuery().processInstanceId(processInstance.getId()).uniqueResult();
managementService.executeJob(job.getId());
I would like from this code to execute only the first task of my process.
As result, I have the first task executed, but I have also an error saying that jbpm couldn't load my class containing the task even if the task was executed.
Here is the error message :
15:06:33,684 FIN | [SQL]
select
jobimpl0_.DBID_ as DBID1_6_0_,
jobimpl0_.DBVERSION_ as DBVERSION3_6_0_,
jobimpl0_.DUEDATE_ as DUEDATE4_6_0_,
jobimpl0_.STATE_ as STATE5_6_0_,
jobimpl0_.ISEXCLUSIVE_ as ISEXCLUS6_6_0_,
jobimpl0_.LOCKOWNER_ as LOCKOWNER7_6_0_,
jobimpl0_.LOCKEXPTIME_ as LOCKEXPT8_6_0_,
jobimpl0_.EXCEPTION_ as EXCEPTION9_6_0_,
jobimpl0_.RETRIES_ as RETRIES10_6_0_,
jobimpl0_.PROCESSINSTANCE_ as PROCESS11_6_0_,
jobimpl0_.EXECUTION_ as EXECUTION12_6_0_,
jobimpl0_.CFG_ as CFG13_6_0_,
jobimpl0_.SIGNAL_ as SIGNAL14_6_0_,
jobimpl0_.EVENT_ as EVENT15_6_0_,
jobimpl0_.REPEAT_ as REPEAT16_6_0_,
jobimpl0_.CLASS_ as CLASS2_6_0_
from
JBPM4_JOB jobimpl0_
where
jobimpl0_.DBID_=?
15:06:33,684 FST | [LongType] binding '820002' to parameter: 1
15:06:33,694 FST | [StringType] returning 'ExeAct' as column: CLASS2_6_0_
15:06:33,694 FST | [IntegerType] returning '6' as column: DBVERSION3_6_0_
15:06:33,694 FST | [TimestampType] returning null as column: DUEDATE4_6_0_
15:06:33,694 FST | [StringType] returning 'error' as column: STATE5_6_0_
15:06:33,694 FST | [BooleanType] returning 'false' as column: ISEXCLUS6_6_0_
15:06:33,694 FST | [StringType] returning null as column: LOCKOWNER7_6_0_
15:06:33,694 FST | [TimestampType] returning null as column: LOCKEXPT8_6_0_
15:06:33,694 FST | [TextType] returning 'org.jbpm.pvm.internal.wire.JbpmClassNotFoundException: couldn't load class PE.Fonctions
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.construct(ObjectDescriptor.java:146)
at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:469)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:448)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:258)
at org.jbpm.pvm.internal.util.ReflectUtil.instantiateUserCode(ReflectUtil.java:310)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:63)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:47)
at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:57)
at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.execute(ExecuteActivityMessage.java:46)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)
at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: class 'PE.Fonctions' could not be found in deployment 540001
at org.jbpm.pvm.internal.repository.DeploymentClassLoader.findClass(DeploymentClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.construct(ObjectDescriptor.java:144)
... 29 more
' as column: EXCEPTION9_6_0_
Do someone have ideas about how to solve this problem?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/535199#535199]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 7 months
[jBPM] - Asynchronus execution error
by ABIDI Sami
ABIDI Sami [http://community.jboss.org/people/uaibys] created the discussion
"Asynchronus execution error"
To view the discussion, visit: http://community.jboss.org/message/535197#535197
--------------------------------------------------------------
Hello,
I want to execute a jbpm process in asynchronous continuation mode, and here is a part of the source code that i used :
ProcessEngine processengine = new Configuration().buildProcessEngine();
RepositoryService repositoryservice = processengine.getRepositoryService();
ExecutionService executionservice = processengine.getExecutionService();
ManagementService managementService = processengine.getManagementService();
ProcessInstance processInstance = executionservice.startProcessInstanceById("Clef-4");
Job job = null;
job = managementService.createJobQuery().processInstanceId(processInstance.getId()).uniqueResult();
managementService.executeJob(job.getId());
I would like from this code to execute only the first task of my process.
As result, I have the first task executed, but I have also an error saying that jbpm couldn't load my class containing the task even if the task was executed.
Here is the error message :
15:06:33,684 FIN | [SQL]
select
jobimpl0_.DBID_ as DBID1_6_0_,
jobimpl0_.DBVERSION_ as DBVERSION3_6_0_,
jobimpl0_.DUEDATE_ as DUEDATE4_6_0_,
jobimpl0_.STATE_ as STATE5_6_0_,
jobimpl0_.ISEXCLUSIVE_ as ISEXCLUS6_6_0_,
jobimpl0_.LOCKOWNER_ as LOCKOWNER7_6_0_,
jobimpl0_.LOCKEXPTIME_ as LOCKEXPT8_6_0_,
jobimpl0_.EXCEPTION_ as EXCEPTION9_6_0_,
jobimpl0_.RETRIES_ as RETRIES10_6_0_,
jobimpl0_.PROCESSINSTANCE_ as PROCESS11_6_0_,
jobimpl0_.EXECUTION_ as EXECUTION12_6_0_,
jobimpl0_.CFG_ as CFG13_6_0_,
jobimpl0_.SIGNAL_ as SIGNAL14_6_0_,
jobimpl0_.EVENT_ as EVENT15_6_0_,
jobimpl0_.REPEAT_ as REPEAT16_6_0_,
jobimpl0_.CLASS_ as CLASS2_6_0_
from
JBPM4_JOB jobimpl0_
where
jobimpl0_.DBID_=?
15:06:33,684 FST | [LongType] binding '820002' to parameter: 1
15:06:33,694 FST | [StringType] returning 'ExeAct' as column: CLASS2_6_0_
15:06:33,694 FST | [IntegerType] returning '6' as column: DBVERSION3_6_0_
15:06:33,694 FST | [TimestampType] returning null as column: DUEDATE4_6_0_
15:06:33,694 FST | [StringType] returning 'error' as column: STATE5_6_0_
15:06:33,694 FST | [BooleanType] returning 'false' as column: ISEXCLUS6_6_0_
15:06:33,694 FST | [StringType] returning null as column: LOCKOWNER7_6_0_
15:06:33,694 FST | [TimestampType] returning null as column: LOCKEXPT8_6_0_
15:06:33,694 FST | [TextType] returning 'org.jbpm.pvm.internal.wire.JbpmClassNotFoundException: couldn't load class PE.Fonctions
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.construct(ObjectDescriptor.java:146)
at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:469)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:448)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:258)
at org.jbpm.pvm.internal.util.ReflectUtil.instantiateUserCode(ReflectUtil.java:310)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:63)
at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:47)
at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:57)
at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.execute(ExecuteActivityMessage.java:46)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)
at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: class 'PE.Fonctions' could not be found in deployment 540001
at org.jbpm.pvm.internal.repository.DeploymentClassLoader.findClass(DeploymentClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.construct(ObjectDescriptor.java:144)
... 29 more
' as column: EXCEPTION9_6_0_
Do someone have ideas about how to solve this problem?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/535197#535197]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 7 months
[JBoss AOP] - Is there any article about using jboss AOP with EJB 2.X
by Doochul KIM
Doochul KIM [http://community.jboss.org/people/headiron] created the discussion
"Is there any article about using jboss AOP with EJB 2.X"
To view the discussion, visit: http://community.jboss.org/message/535188#535188
--------------------------------------------------------------
Hi.
These days I try to use jBoss AOP with EJB 2.X.
I make Aspect class and included on jar that will be include on ear.
And I add a xml file to set a rule.
( Create a new file, named 'jbosstest-aop.xml', and saved on jboss/server/default/deploy dolder. )
When server is started , message about depolying above xml file is displayed
But I try to using it , it isn't work.
Is there any article ( or document ) about using jboss AOP with EJB 2.X session bean?
I use jboss4.0.2 server and , test it with jbossAOP 1.3.1
- Content of 'jbosstest-aop.xml' -
<?xml version='1.0' encoding='UTF-8' ?>
<aop>
<aspect class="com.xxxx.report.util.ReportLimitHandler"/>
<bind pointcut="execution(public java.lang.String com.xxxx.business.report.engine.ReportManagerBean->generateReport(com.xxxx.report.vo.ReportParameterVO, com.xxxx.parameters.DBParameters, com.xxxx.parameters.LogParameters))">
<around aspect="com.xxxx.report.util.ReportLimitHandler" name="tract"/>
</bind>
</aop>
#com.xxxx.business.report.engine.ReportManagerBean is class implement SessionBean
-- Content of 'com.xxxx.report.util.ReportLimitHandler' --
package com.xxxx.report.util;
import org.jboss.aop.joinpoint.Invocation;
public class ReportLimitHandler {
public Object tract(Invocation invocation) throws Throwable {
try{
System.out.println("Entering anything");
return invocation.invokeNext();
}
finally{
System.out.println("Leaving anything");
}
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/535188#535188]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 7 months