0 Replies Latest reply on May 8, 2008 11:07 AM by senthil sathya

    Could not instantiate the Process Instance

    senthil sathya Newbie

      Hi,

      I am using Seam-2.0.2.CR1 with jBPM .I am running into an isssue,would

      apreciate if anyone could help me on that.

      I am trying to create a process from a JSF page.

      Code:


      <rich:panel styleClass="stack0" columns="1"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

      <rich:panel name="stack1a" styleClass="stack1">

      </rich:panel>



      <rich:panel name="stack4a" styleClass="stack4">
      <h:outputText>MAIN PORTION OF STACK</h:outputText>
      </rich:panel>

      <rich:panel name="stack5a" styleClass="stack5">
      <s:button id="Previous" value="Previous" action="#{salesProcessFlow.prev}"/>
      <s:button id="Next" value="Next" action="#{salesProcessFlow.next}"/>
      <s:button id="State" value="State" action="#{salesProcessFlow.createProcess}"/>
      <h:commandButton id="Cancel" value="Cancel" />
      </rich:panel>
      </h:form>
      <rich:panel name="stack6a" styleClass="stack6">
      <h:outputText>Timer</h:outputText>
      <!-- <rich:progressBar mode="client" id="timerBar"> -->
      <!-- </rich:progressBar> -->
      </rich:panel>

      </rich:panel>


      The "State" button invokes the createProcess method in my stateful bean



      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.bpm.CreateProcess;
      import org.jboss.seam.log.Log;
      import org.jbpm.graph.exe.ProcessInstance;
      import com.allconnect.viper.interfaces.local.SalesProcessFlowLocal;

      /

      @Stateful
      @Scope( ScopeType.SESSION )
      @Name( "salesProcessFlow" )
      public class SalesProcessFlow implements SalesProcessFlowLocal
      {
      private String processtokens = "start";

      @In(value="processInstance", required=false, scope=ScopeType.BUSINESS_PROCESS)
      @Out(value="processInstance", required = false )
      private ProcessInstance processInstance;

      @Logger
      private static Log logger;



      /**
      * Default Constructor.
      */
      SalesProcessFlow()
      {

      }

      /**
      * Method is used to retrieve token information.
      * {@inheritDoc}
      */

      @CreateProcess( definition = "SalesFlow" )
      public void createProcess()
      {

      }

      /**
      * {@inheritDoc}
      */
      @org.jboss.seam.annotations.bpm.ResumeProcess(definition="SalesFlow" )
      public void next()
      {
      logger.debug( "Got into Next Function" );
      logger.debug( "processInstance is " + processInstance );
      processInstance.signal( "Next" );
      }

      /**
      * {@inheritDoc}
      */
      public void prev()
      {
      // Do nothing right now.
      }


      public String getProcessTokens()
      {
      return processtokens;
      }

      public void setProcessTokens( final String processtokens )
      {
      this.processtokens = processtokens;
      }

      /**
      * Basic Destroy.
      */
      @Remove
      @Destroy
      public void destroy()
      {
      }

      }

      The the process definition file is within the deployed EAR.

      The "Next" button invokes the next method,which returns an error message.I have include the stack trace for re
      ference.
      I am not sure why the processInstance is not created..

      Error trace

      2008-05-07 12:40:53,945 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postRemov
      eVariable.salesProcessFlow
      2008-05-07 12:40:53,945 DEBUG [org.jboss.seam.ejb.RemoveInterceptor] Stateful component was removed:
      salesProcessFlow
      2008-05-07 12:40:53,945 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
      javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: task/process id may not be null
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173)
      at org.jboss.seam.navigation.Pages.callAction(Pages.java:643)
      at org.jboss.seam.navigation.Pages.preRender(Pages.java:296)
      at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:560)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:471)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144)
      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)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235
      )
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235
      )
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.ejb.EJBTransactionRolledbackException: task/process id may not be null
      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:
      110)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
      at $Proxy129.next(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      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.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
      at org.javassist.tmp.java.lang.Object_$$_javassist_6.next(Object_$$_javassist_6.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
      ... 51 more
      Caused by: java.lang.IllegalStateException: task/process id may not be null
      at org.jboss.seam.bpm.BusinessProcessInterceptor.getProcessOrTaskId(BusinessProcessInterceptor.java
      :159)
      at org.jboss.seam.bpm.BusinessProcessInterceptor.beforeInvocation(BusinessProcessInterceptor.java:7
      6)
      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:43)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyIntercep
      tor.java:26)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyIn
      terceptor.java:27)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
      at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:6
      3)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenc
      eContextPropagationInterceptor.java:57)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityMa
      nagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      ... 87 more
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.sea
      m.exception.exceptions
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.sea
      m.exception.exceptions
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.exception
      .exceptions
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.sea
      m.core.events
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.sea
      m.core.events
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.even
      ts
      2008-05-07 12:40:54,045 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.sea
      m.core.even


      Thanks in advance