Hide Forgot
Date of First Response: 2009-03-17 10:56:10 project_key: SOA SOA Platform ships at least 2 jbpm-jpdl.jars: - seamfp\lib\jbpm-jpdl.jar - this one is included with any MySeamApp.ear that is created - jboss-as\server\default\deploy\jbpm.esb\jbpm-jpdl.jar - this one is already "in container" If you take Seam DVDStore and include a use of EsbNotifier or EsbActionHandler in its JPDL (e.g. ordermanagement1.jpdl.xml) like so: <action name="ShipItAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbNotifier"> <esbCategoryName>FirstServiceESB</esbCategoryName> <esbServiceName>SimpleListener</esbServiceName> </action> The result is a classcastexception since we have two copies of jBPM
From Jay B: "The problem is that /server/default/deploy/jbpm.esb is in a different classloader branch and so the jar is not visible out side of it. If the jar is in the /server/default/lib then it would ( or should ) be shared by all below it - i.e. the deployed apps"
Assigned to Ondrej Skutka, JBoss SEam QE
My bad, I don't think this should go to Ondrej yet. Unassigned.
Is this the Seam FP? I thought the FP had the same versions of jBPM as the SOA-P GA?
This is related to "seamfp" in the distro, it could be that the JARs are identical but the problem is that we are loading this both twice and that the container could be instantiating the EsbActionHandler (or EsbNotifier) from one classloader (e.g. jbpm.esb/jbpm-jpdl.jar) and the jBPM Action interface from mySeamApp.ear. The Seam recommendation is to place jbpm-jpdl.jar in your Seam-based .ear. Or as Jay B stated "remove the jar from both locations and drop into default/lib" which I've not tried. Note: the solution should also apply to the drools jars as well.
More detailed steps to reproduce: 1) quickstart\helloworld - ant deploy 2) quikcstart\helloworld - ant runtest (verify it work) 3) Add EsbNotifier targeting Hello World into seamfp\examples\dvdstore\resources\ordermanagement1.jpdl.xml like so <action name="ShipItAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbNotifier"> <esbCategoryName>FirstServiceESB</esbCategoryName> <esbServiceName>SimpleListener</esbServiceName> </action> 4) in seamfp\examples\dvdstore - ant 5) copy the generated .ear to the deploy directory 6) http://localhost:8080/seam-dvd 7) buy a DVD as user1, password 8) sign-in as manager 9) Approve/ship the order - get to the point in the workflow that triggers EsbNotifier.
Potential work-around: 1. Ensure that the ONLY copy of jbpm-jpdl.jar exists in $SOAP_HOME/jbpm-jpdl. This means that you'll have to get rid of a few copies of said jar, including the one that seam-gen will try to install in your WAR/EAR. 2. In your Seam components.xml file, add the following. Note that you will NOT be specifying the process definitions here, even if they exist within the EAR. My process definitions did for the example app that I wrote. <bpm:jbpm> <bpm:process-definitions></bpm:process-definitions> <bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm> 3. Next, let's modify the jbpm-cfg.xml file in the jbpm.esb archive (found in $JBOSS_HOME/server/$JBOSS_SERVER/deploy). Here, you'll need to change the persistence service factory from the JtaPersistenceServiceFactory to org.jbpm.persistence.db.DbPersistenceServiceFactory. 4. Do *not* include a copy of hibernate.cfg.xml or jbbpm.cfg.xml in the Seam EAR that you deploy. Also, do not include the process definitions in that EAR. Instead, export the process as a .par and deployed it through jBPM admin tool (step 6). 5. Now comes the jBPM/ESB integration. We can start by using the ESB service node that's available OOTB from jBPM -- just point it to your desired web service. 6. Now, deploy your process archive (.par) to BPM using the BPM deployer, and make sure that your ESB archive is deployed as well.
Please note, there is an issue with the workaround included by Burr wrt the jBPM configuration. I am already working through this with a consultant.
I believe the following modified seam ManagedJbpmContext is necessary in order to use the jBPM jta persistence.
Attachment: Added: ManagedJbpmContext.java
The attached ManagedJbpmContext manages the jBPM context around the transaction lifecycles, closing the jBPM context prior to the transaction termination and recreating on subsequent transactions.
Link: Added: This issue is related to JBSEAM-4110
Link: Added: This issue is duplicated by JBPAPP-1883
Further work was done on this and the following diffs were provided to the seam team.
Attachment: Added: seam.diffs
Link: Added: This issue is a dependency of JBQA-2518
Link: Added: This issue is a dependency of SOA-1673
I have added this draft text to the Release Notes: https://jira.jboss.org/jira/browse/SOA-1234 There is a problem running Seam applications, such as the "DVDStore" sample, causing ClassCastExceptions. This error occurs because Seam assumes that jBPM is embedded within the deployment, resulting in two copies being run.
This issue is not approved for SOA 4.3 CP03. If this needs to be reconsidered, please raise the issue with the SOA PM team.
issues documented as far as possible for the 5.0.0 release, will need further work for a final resolution.