[jbpm-issues] [JBoss JIRA] Commented: (JBPM-2428) BPM process action class loading issue

Mauro Molinari (JIRA) jira-events at lists.jboss.org
Fri Jan 15 11:01:47 EST 2010


    [ https://jira.jboss.org/jira/browse/JBPM-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12506334#action_12506334 ] 

Mauro Molinari commented on JBPM-2428:
--------------------------------------

If the original issue is the same as mine, the problem is actually that jBPM creates new classloader instances each time. This causes the problem.

On my own, I solved the problem by providing my own class loader factory that caches process class loaders for each process definition id: in this way I am sure that only one instance of a class object exists for classes deployed in the PAR. Otherwise, many instances can exist at the same time and "ClassCastException: class A cannot be cast to A" errors can occur.

> BPM process action class loading issue
> --------------------------------------
>
>                 Key: JBPM-2428
>                 URL: https://jira.jboss.org/jira/browse/JBPM-2428
>             Project: jBPM
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Runtime Engine
>    Affects Versions: jBPM 3.2.5.SP5
>         Environment: SOA-P 4.3 CP01
> JBoss server config = PRODUCTION
>            Reporter: Marek Baluch
>         Attachments: jbpm_classloader_anomaly.tar.gz
>
>
> Class loader which loaded a class instance which is stored in the process variable is different then the classloader that loaded the same class in ActionHandler. This issue will occure only if the process is undeployed after one or more runs and redeployed without restarting the server. Even deleting process instances using the JBPM Console didn't help.
> Steps to reproduce (use the quickstart in the attachment)
> ============================================
> ant deploy
> ant deployProcess
> ant startProcess
> ant undeploy
> start the quickstart
> ant deploy
> ant deployProcess
> ant startProcess
> A simple restart of the server after the first undeploy fixes the problem and the exception won't be reproduced.
> First run output
> ===========
> 2009-07-15 11:40:26,407 INFO  [STDOUT] ********** CandidateIntakeAction - Candidate object populated **********
> 2009-07-15 11:40:26,407 INFO  [STDOUT] Candidate name = Fidel
> 2009-07-15 11:40:26,407 INFO  [STDOUT] Candidate surname = Castro
> 2009-07-15 11:40:26,407 INFO  [STDOUT] Candidate email = fidel.castro at gmail.com
> 2009-07-15 11:40:26,407 INFO  [STDOUT] ************************************************************************
> 2009-07-15 11:40:26,515 INFO  [STDOUT] ********** SimpleBPMActionHandler **********
> 2009-07-15 11:40:26,515 INFO  [STDOUT] Object loaded with classloader: org.jboss.mx.loading.UnifiedClassLoader3 at 1769b56{ url=file:/home/mbaluch/work/build/jboss-soa-p.4.3.0.GA_CP01_CR7/jboss-as/server/production/deploy/Quickstart_jbpm_classloader_anomaly.esb/ ,addedOrder=60}
> 2009-07-15 11:40:26,516 INFO  [STDOUT] Given classloader for class Candidate: org.jboss.mx.loading.UnifiedClassLoader3 at 1769b56{ url=file:/home/mbaluch/work/build/jboss-soa-p.4.3.0.GA_CP01_CR7/jboss-as/server/production/deploy/Quickstart_jbpm_classloader_anomaly.esb/ ,addedOrder=60}
> 2009-07-15 11:40:26,516 INFO  [STDOUT] ********************************************
> Second run output
> ==============
> 2009-07-15 11:40:46,849 INFO  [STDOUT] ********** CandidateIntakeAction - Candidate object populated **********
> 2009-07-15 11:40:46,849 INFO  [STDOUT] Candidate name = Fidel
> 2009-07-15 11:40:46,849 INFO  [STDOUT] Candidate surname = Castro
> 2009-07-15 11:40:46,849 INFO  [STDOUT] Candidate email = fidel.castro at gmail.com
> 2009-07-15 11:40:46,849 INFO  [STDOUT] ************************************************************************
> 2009-07-15 11:40:47,041 INFO  [STDOUT] ********** SimpleBPMActionHandler **********
> 2009-07-15 11:40:47,041 INFO  [STDOUT] Object loaded with classloader: org.jboss.mx.loading.UnifiedClassLoader3 at 1769b56{ url=null ,addedOrder=60}
> 2009-07-15 11:40:47,041 INFO  [STDOUT] Given classloader for class Candidate: org.jboss.mx.loading.UnifiedClassLoader3 at 1300751{ url=file:/home/mbaluch/work/build/jboss-soa-p.4.3.0.GA_CP01_CR7/jboss-as/server/production/deploy/Quickstart_jbpm_classloader_anomaly.esb/ ,addedOrder=61}
> 2009-07-15 11:40:47,041 INFO  [STDOUT] !!! Classloader conflict between ClassName.class.getClassLoader() and instanceOfClassName.getClass().getClassLoader() !!!
> 2009-07-15 11:40:47,041 INFO  [STDOUT] !!! Process will throw a ClassCastException !!!
> 2009-07-15 11:40:47,042 ERROR [org.jbpm.graph.def.GraphElement] action threw exception: org.jboss.soa.esb.xml2pojo.object.Candidate
> java.lang.ClassCastException: org.jboss.soa.esb.xml2pojo.object.Candidate
> <Stack-Trace> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbpm-issues mailing list