[jbpm-commits] JBoss JBPM SVN: r5946 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/cfg and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 11 04:08:29 EST 2009


Author: jbarrez
Date: 2009-12-11 04:08:28 -0500 (Fri, 11 Dec 2009)
New Revision: 5946

Modified:
   jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.spring.cfg.xml
Log:
JBPM-2645: can't instantiate process engine when using Spring

Modified: jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml	2009-12-11 09:04:40 UTC (rev 5945)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/cfg/jbpm/spring.testsuite.jbpm.cfg.xml	2009-12-11 09:08:28 UTC (rev 5946)
@@ -9,6 +9,5 @@
   <import resource="jbpm.identity.cfg.xml" />
   <import resource="jbpm.businesscalendar.cfg.xml" />
   <import resource="jbpm.console.cfg.xml" />
-  <import resource="jbpm.mail.templates.examples.xml" />
 
 </jbpm-configuration>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java	2009-12-11 09:04:40 UTC (rev 5945)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java	2009-12-11 09:08:28 UTC (rev 5946)
@@ -22,18 +22,13 @@
 package org.jbpm.pvm.internal.cfg;
 
 import java.io.IOException;
-import java.util.List;
 
 import org.jbpm.api.ProcessEngine;
 import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Context;
+import org.jbpm.pvm.internal.env.EnvironmentFactory;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
 import org.jbpm.pvm.internal.env.PvmEnvironment;
 import org.jbpm.pvm.internal.env.SpringContext;
-import org.jbpm.pvm.internal.env.UserProvidedEnvironmentObject;
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.WireDefinition;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -76,6 +71,14 @@
   public ProcessEngine buildProcessEngine() {
     if (applicationContext == null) {
       applicationContext = new ClassPathXmlApplicationContext(System.getProperty("jbpm.test.cfg.applicationContext"));
+      
+      // If the property hasn't been set, fall back to the default applicationContext
+      if (applicationContext == null) {
+        if (log.isInfoEnabled()) {
+          log.info("Looking for applicationContext.xml on classpath ...");
+        }
+        applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
+      }
     }
 
     return super.buildProcessEngine();

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.spring.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.spring.cfg.xml	2009-12-11 09:04:40 UTC (rev 5945)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.spring.cfg.xml	2009-12-11 09:08:28 UTC (rev 5946)
@@ -3,11 +3,20 @@
 <jbpm-configuration>
 
   <process-engine-context>
-    <command-service>
+  
+    <command-service name="newTxRequiredCommandService">
       <retry-interceptor />
+      <environment-interceptor policy="requiresNew" />
+      <standard-transaction-interceptor />
+    </command-service>
+    
+    <!-- Default command service has a Spring transaction interceptor-->
+    <command-service name="txRequiredCommandService">
+      <retry-interceptor />
       <environment-interceptor />
       <spring-transaction-interceptor />
     </command-service>
+    
   </process-engine-context>
 
   <transaction-context>



More information about the jbpm-commits mailing list