3 Replies Latest reply on Aug 17, 2014 1:18 AM by Linus Lan

    it always appear problem: RuntimeManager with id spring-rm is already active

    Linus Lan Newbie

      when i visit my website twice , it appear problem: RuntimeManager with id spring-rm is already active.

      environment:struts2+hibernate4+spring3+jbpm6.1, jdk7, tomcat7, myeclipse10

      spring file:

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

        xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"

        xmlns:util="http://www.springframework.org/schema/util"

        xsi:schemaLocation="http://www.springframework.org/schema/beans

                 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 

                 http://www.springframework.org/schema/context

                 http://www.springframework.org/schema/context/spring-context-3.0.xsd 

                 http://www.springframework.org/schema/mvc

                 http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 

                 http://www.springframework.org/schema/util

                 http://www.springframework.org/schema/util/spring-util-3.0.xsd">

        <bean id="jbpmEMF"

        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

        <property name="persistenceUnitName" value="org.jbpm.persistence.jpa" />

        <property name="persistenceXmlLocation" value="classpath:persistence.xml" />

        <property name="dataSource" ref="dataSource" />

        </bean>

       

       

        <bean id="btmConfig" factory-method="getConfiguration"

        class="bitronix.tm.TransactionManagerServices">

        </bean>

       

       

        <bean id="BitronixTransactionManager" factory-method="getTransactionManager"

        class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig"

        destroy-method="shutdown" />

       

       

        <bean id="jbpmTxManager"

        class="org.springframework.transaction.jta.JtaTransactionManager">

        <property name="transactionManager" ref="BitronixTransactionManager" />

        <property name="userTransaction" ref="BitronixTransactionManager" />

        </bean>

        <bean id="process" factory-method="newClassPathResource"

        class="org.kie.internal.io.ResourceFactory">

        <constructor-arg>

        <value>jbpm/processes/Evaluation.bpmn</value>

        </constructor-arg>

        </bean>

       

       

        <bean id="runtimeEnvironment"

        class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">

        <property name="type" value="DEFAULT" />

        <property name="entityManagerFactory" ref="jbpmEMF" />

        <property name="transactionManager" ref="jbpmTxManager" />

        <property name="assets">

        <map>

        <entry key-ref="process">

        <util:constant static-field="org.kie.api.io.ResourceType.BPMN2" />

        </entry>

        </map>

        </property>

        </bean>

        <bean id="runtimeManager" class="org.kie.spring.factorybeans.RuntimeManagerFactoryBean"

        destroy-method="close">

        <property name="identifier" value="spring-rm" />

        <property name="runtimeEnvironment" ref="runtimeEnvironment" />

        <!-- <property name="type" value="PER_PROCESS_INSTANCE"/> -->

        </bean>

       

       

        <bean id="logService" class="org.jbpm.process.audit.JPAAuditLogService">

        <constructor-arg>

        <ref bean="jbpmEMF" />

        </constructor-arg>

        </bean>

        <!-- -->

        <bean id="taskService" class="org.kie.spring.factorybeans.TaskServiceFactoryBean"

        destroy-method="close">

        <property name="entityManagerFactory" ref="jbpmEMF" />

        <property name="transactionManager" ref="jbpmTxManager" />

        <property name="listeners">

        <list>

        <bean class="org.jbpm.services.task.audit.JPATaskLifeCycleEventListener" />

        </list>

        </property>

        </bean>

      </beans>