3 Replies Latest reply on Jul 8, 2008 4:59 PM by David West

    StackOverflowError with @CreateProcess

    David West Newbie

      Hi, I'm trying to use Seam's integration with jbpm to start a workflow


      My method is:


      @CreateProcess(definition="QaApprove")


      public void startWorkflow() {


      System.out.println("Starting new workflow");


      }


      I am getting a stack overflow error as shown below.  Any ideas what could cause this?  I'm using Seam 2.0.1GA and the jbpm jbpm.cfg.xml and hibernate.cfg.xml as in the dvd store sample.


      The partial stack trace is:


      Caused by: java.lang.StackOverflowError
           at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:64)
           at org.apache.log4j.Category.callAppenders(Category.java:203)
           at org.apache.log4j.Category.forcedLog(Category.java:388)
           at org.apache.log4j.Category.log(Category.java:853)
           at org.jboss.seam.log.Log4JProvider.debug(Log4JProvider.java:42)
           at org.jboss.seam.Component.initialize(Component.java:1382)
           at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
           at org.jboss.seam.Component.instantiate(Component.java:1268)
           at org.jboss.seam.Component.newInstance(Component.java:1966)
           at org.jboss.seam.Component.getInstance(Component.java:1873)
           at org.jboss.seam.Component.getInstance(Component.java:1852)
           at org.jboss.seam.Component.getInstance(Component.java:1829)
           at org.jboss.seam.Component.getInstance(Component.java:1824)
           at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
           at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:218)
           at org.jboss.seam.contexts.BusinessProcessContext.getContextInstance(BusinessProcessContext.java:205)
           at org.jboss.seam.contexts.BusinessProcessContext.get(BusinessProcessContext.java:56)
           at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:209)
           at org.jboss.seam.Component.getInstance(Component.java:1839)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
           at org.jboss.seam.ioc.spring.SpringTransaction.begin(SpringTransaction.java:70)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:35)
           at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
           at sun.reflect.GeneratedMethodAccessor582.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.unwrap(Component.java:2108)
           at org.jboss.seam.Component.getInstance(Component.java:1887)
           at org.jboss.seam.Component.getInstance(Component.java:1852)
           at org.jboss.seam.Component.getInstance(Component.java:1829)
           at org.jboss.seam.Component.getInstance(Component.java:1824)
           at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)
           at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:218)
           at org.jboss.seam.contexts.BusinessProcessContext.getContextInstance(BusinessProcessContext.java:205)
           at org.jboss.seam.contexts.BusinessProcessContext.get(BusinessProcessContext.java:56)
           at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:209)
           at org.jboss.seam.Component.getInstance(Component.java:1839)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
           at org.jboss.seam.ioc.spring.SpringTransaction.begin(SpringTransaction.java:70)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:35)
           at org.jboss.seam.bpm.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
           at sun.reflect.GeneratedMethodAccessor582.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.unwrap(Component.java:2108)
           at org.jboss.seam.Component.getInstance(Component.java:1887)
           at org.jboss.seam.Component.getInstance(Component.java:1852)
           at org.jboss.seam.Component.getInstance(Component.java:1829)
           at org.jboss.seam.Component.getInstance(Component.java:1824)
           at org.jboss.seam.bpm.ProcessInstance.instance(ProcessInstance.java:65)

        • 1. Re: StackOverflowError with @CreateProcess
          System Administrator Expert

          Is there anything logged that's interesting/suspicious in the server.log prior to that output?

          • 2. Re: StackOverflowError with @CreateProcess
            David West Newbie
            Thanks for the reply.

            Yes there is something interesting

            java.lang.IllegalStateException: Could not start transaction
                 at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:581)
                 at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:312)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
                 at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

            Debugging the SeamPhaseListener.begin method I see the exception is caused by the  Transaction.instance().begin(); in the render response phase.

            I am using postgres as my db, my jbpm.cfg.xml is:

              <jbpm-context>
                <service name="persistence">
                   <factory>
                      <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                         <field name="isTransactionEnabled"><false/></field>
                      </bean>
                   </factory>
                </service>
                <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
                <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
                <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
                <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
                <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
              </jbpm-context>

            The top of my hibernate.cfg.xml is:

                <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
                <property name="show_sql">false</property>
              <property name="connection.datasource">java:/MyDataSource</property>
              <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
              <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
              <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
              <property name="hbm2ddl.auto">create-drop</property>

            Any ideas what I might be doing wrong?
            Cheers
            • 3. Re: StackOverflowError with @CreateProcess
              David West Newbie
              After an exhaustive search of integrating a hello world type workflow application into my maven build and successively adding parts of my application, I narrowed it down to the spring integration, specifically the line in components.xml

              <spring:spring-transaction platform-transaction-manager="#{txManager}">

              I found the following article which I'm now going to follow:
              http://www.seamframework.org/9262.lace