Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Two problems occurred when integrating spring with jbpm Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Two problems occurred when integrating spring with jbpm

    Because of increasing scalability,our web server and app server exist on the different machines.We use the ejb to communicate.When not integrating with jbpm,no error occur.But when integrating spring with jbpm,we faced two problems.
    1)Because using ejb,ejb will make multiple instance,each creates its own bean factory.when using jbpm,it always throws exception "a beanFactoryReference already exists for key".Jbpm module allows only one bean factory exist.Now exist multiple bean factory,so exception is throwed.

    I tried to use SingletonBeanFactoryLocator to make only one bean factory even if multiple ejb instance.Something apparently run well.

    But when ejb throws exception or finishes work,spring will descrease the count of bean factory reference.When count is 0,Spring will destory the bean factory.But it does not destory the jbpm's JbpmFactoryLocator. Someone call ejb,jbpm will throw "a beanFactoryReference already exists for key".

    So I extend the SingletonBeanFactoryLocator ,when reference count descrease to 0,I will destory JbpmFactoryLocator.And improve the efficiency,when getInstance of SingletonBeanFactoryLocator, I increase the count number.This makes not loading bean factory and jbpm repeatedly.So even if nobody call ejb,bean factory reference will also be 1.

    But I dont know this is the best solution?

    2)In the configuration file,when using jbpmConfiguration bean
    Code:
    <bean id="jbpmConfiguration"
    		class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
    		<property name="sessionFactory" ref="hibernateSessionFactory" />
    		<property name="configuration" value="classpath:jbpm.cfg.xml" />
    		<property name="processDefinitions">
    			<list>
    				<ref local="simpleWorkflow" />
    			</list>
    		</property>
    	</bean>
    I must provide the processDefinitions property.That means when start the server,it will redeploy again.Deploy waste too much time.When I delete it from configuration file,always throws exception.But i dont know how to solve it.

  • #2
    Hi bobby_sz,

    1) you make a good point. I already have a report on this issue and I'll try to address it ASAP and include in the next release. The problem occurs since some static fields are used in order to bridge with JBPM but as you pointed out, the cleanup lets the static fields uninitialized. I'll try to find a workaround so restarts are possible.

    2) It is the simpleWorkflow processDefinition or the jbpm.cfg.xml configuration that takes too much time? Some time has to be spent on reading the information from the database - if you skip this step you can't persist your bpm to the database.
    What step is optional/redundant in this case?

    Comment


    • #3
      Thanks for your reply,costin.

      In LocalJbpmConfigurationFactoryBean,when set processDefinitions property,it will deploy process definition.That means jbpm will redeploy again when restart the server.But process definition is same,I do not want to do that.

      When I don't set processDefinitions property,jbpm will not redeploy unless deploy it manually,but some errors occur.I do not know what's wrong.

      Comment


      • #4
        Exception

        Exception just like that:
        Code:
        17:44:20,625 ERROR [ApplicationControllerBean] Application controller exception:[null]/[1165311851531113]:org.springframework
        .dao.InvalidDataAccessApiUsageException: org.jbpm.graph.def.ProcessDefinition; nested exception is org.hibernate.TransientObj
        ectException: org.jbpm.graph.def.ProcessDefinition
        Caused by: org.hibernate.TransientObjectException: org.jbpm.graph.def.ProcessDefinition
                at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:216)
                at org.hibernate.type.EntityType.getIdentifier(EntityType.java:108)
                at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:221)
                at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:476)
                at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:2900)
                at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:474)
                at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197
        )
                at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
                at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
                at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.ja
        va:76)
                at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
                at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
                at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
                at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
                at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:558)
                at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransacti
        onManager.java:540)
                at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManag
        er.java:510)
                at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAs
        pectSupport.java:310)
                at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
                at $Proxy60.perform(Unknown Source)
                at com.sinosafe.huafa.app.biz.ac.support.ApplicationControllerSupport.invokeAction(ApplicationControllerSupport.java:
        93)
                at com.sinosafe.huafa.app.biz.ac.support.ApplicationControllerSupport.dispatchService(ApplicationControllerSupport.ja
        va:54)
                at com.sinosafe.huafa.app.biz.ac.impl.ApplicationControllerBean.handleRequest(ApplicationControllerBean.java:58)
                at sun.reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
                at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
                at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
                at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
                at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
                at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
                at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:378)
                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
                at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
                at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
                at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
                at org.jboss.ejb.Container.invoke(Container.java:954)
                at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
                at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
                at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:206)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:192)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
                at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
                at $Proxy55.handleRequest(Unknown Source)
                at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(RmiClientInterceptorUtils.java:98)
                at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java
        :75)
                at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invoke(AbstractRemoteSlsbInvokerInterceptor.ja
        va:119)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
                at $Proxy57.handleRequest(Unknown Source)
                at com.sinosafe.huafa.web.controller.WebControllerTemplate.dispatchAction(WebControllerTemplate.java:95)
                at com.sinosafe.huafa.web.controller.WebControllerTemplate.execute(WebControllerTemplate.java:155)
                at com.sinosafe.claim.autoclaim.web.controller.acceptcase.ReportAcceptController.onSubmit(ReportAcceptController.java
        :45)
                at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:258)
                at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:250)
                at org.springframework.web.servlet.mvc.Abstr

        Comment


        • #5
          Seems that Hibernate doesn't know about your process definition. This has been reported before but there is not much Spring Modules can do here - I'm not sure how things are in JBPM but AFAIK, there is no API to verify if a process has been deployed or not. Spring Modules simply calls JBPM API which in turn does the hard redeploy of the mapping.
          If anybody knows a workaround, please shout!

          Comment


          • #6
            Thanks any way.

            Comment

            Working...
            X