3 Replies Latest reply on Dec 4, 2006 5:40 PM by Pete Muir

    how to use taskinstance??

    Juan Giovanolli Newbie

      i'm trying to persist variables into the current taskInstance. for this i'm injecting the taskInstance object of jboss.seam.core. but it fails as you can see below:

      
      javax.faces.el.EvaluationException: /main.xhtml @13,49 value="#{taskManager.description}": Exception getting value of property description of base of type : com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$c41132d8
       at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
       at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:135)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.faces.el.EvaluationException: Bean: com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$c41132d8, property: description
       at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
       at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
       ... 36 more
      Caused by: java.lang.reflect.InvocationTargetException
       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:585)
       at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
       ... 42 more
      Caused by: org.jboss.seam.RequiredException: In attribute requires value for component: taskManager.taskInstance
       at org.jboss.seam.Component.getInstanceToInject(Component.java:1823)
       at org.jboss.seam.Component.injectFields(Component.java:1312)
       at org.jboss.seam.Component.inject(Component.java:1082)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:128)
       at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
       at com.santex.darwin.web.samp
      


      and the class where i'm trying to inject it is this:

      TaskBean.java
      package com.santex.darwin.web.sample;
      
      import javax.ejb.Remove;
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.CreateProcess;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.EndTask;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.StartTask;
      import org.jboss.seam.core.TaskInstance;
      
      import com.santex.darwin.service.core.workflow.WorkflowManager;
      
      /**
       *
       * @author Juan Giovanolli
       * 29/11/2006
       */
      @Name("taskManager")
      
      public class TaskBean implements Task
      {
      
       private String description;
      
       @In(create = true)
       WorkflowManager workflowManagerImpl;
      
      
       @In(create=true)
       TaskInstance taskInstance;
      
      
       public WorkflowManager getWorkflowManagerImpl()
       {
       return workflowManagerImpl;
       }
      
       public void setWorkflowManagerImpl(WorkflowManager workflowManagerImpl)
       {
       this.workflowManagerImpl = workflowManagerImpl;
       }
      
       /**
       * @return the description
       */
       public String getDescription()
       {
       return description;
       }
      
       /**
       * @param description the description to set
       */
       public void setDescription(String pDescription)
       {
       this.description = pDescription;
       }
      
       @StartTask
       public String startTask() {
       try {
       taskInstance.getTaskInstance().setVariable("a1", a);
       }
       catch (Exception e) {
       e.printStackTrace();
       }
       return "";
       }
      
       @EndTask
       public String endTask() {
       try {
       taskInstance.getTaskInstance().setVariable("a2", a);
       }
       catch (Exception e) {
       e.printStackTrace();
       }
       return "";
       }
      
       @Remove @Destroy
       public void destroy() {
      
       }
      
       @CreateProcess(definition = "ProcessAbstract")
       public String startProcess()
       {
       return "";
       }
      
      }
      
      



      Any ideas?? or still better: any examples?
      Thks.!

        • 1. Re: how to use taskinstance??
          Pete Muir Master

          I don't think you need @In(required=false) - you are only (presumably) interested in task instances already instantiated from JBPM. Then do a null check in your code (or get rid of required=false and make sure you don't call the manager except when a taskInstance is already in a context).

          • 2. Re: how to use taskinstance??
            Juan Giovanolli Newbie

            you has solved, in part my problem. now i'm getting a new error :

            16:36:30,281 ERROR [STDERR] org.hibernate.SessionException: Session is closed!
             at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
             at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:874)
             at org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
             at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
             at org.jbpm.db.GraphSession.loadProcessInstance(GraphSession.java:276)
             at org.jboss.seam.core.ProcessInstance$1.work(ProcessInstance.java:50)
             at org.jboss.seam.core.ProcessInstance$1.work(ProcessInstance.java:43)
             at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
             at org.jboss.seam.core.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
             at sun.reflect.GeneratedMethodAccessor436.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
             at org.jboss.seam.Component.callComponentMethod(Component.java:1738)
             at org.jboss.seam.Component.unwrap(Component.java:1764)
             at org.jboss.seam.Component.getInstance(Component.java:1597)
             at org.jboss.seam.Component.getInstance(Component.java:1564)
             at org.jboss.seam.Component.getInstance(Component.java:1546)
             at org.jboss.seam.core.ProcessInstance.instance(ProcessInstance.java:70)
             at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:213)
             at org.jboss.seam.contexts.BusinessProcessContext.getContextInstance(BusinessProcessContext.java:200)
             at org.jboss.seam.contexts.BusinessProcessContext.get(BusinessProcessContext.java:55)
             at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:149)
             at org.jboss.seam.Component.getInstance(Component.java:1556)
             at org.jboss.seam.Component.getInstanceToInject(Component.java:1789)
             at org.jboss.seam.Component.injectFields(Component.java:1312)
             at org.jboss.seam.Component.inject(Component.java:1082)
             at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
             at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
             at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
             at sun.reflect.GeneratedMethodAccessor413.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
             at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
             at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:128)
             at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
             at com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$90451471.destroy(<generated>)
             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:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
             at org.jboss.seam.Component.callComponentMethod(Component.java:1738)
             at org.jboss.seam.Component.callDestroyMethod(Component.java:1694)
             at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:186)
             at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:356)
             at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:239)
             at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRender(AbstractSeamPhaseListener.java:180)
             at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:83)
             at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
             at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
             at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
             at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo
            16:36:30,281 ERROR [STDERR] lTcpEndpoint.java:527)
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
             at java.lang.Thread.run(Thread.java:595)
            16:36:30,281 ERROR [GraphSession] org.hibernate.SessionException: Session is closed!
            16:36:30,281 WARN [Contexts] Could not destroy component: taskManager
            org.jbpm.JbpmException: couldn't load process instance '11'
             at org.jbpm.db.GraphSession.loadProcessInstance(GraphSession.java:281)
             at org.jboss.seam.core.ProcessInstance$1.work(ProcessInstance.java:50)
             at org.jboss.seam.core.ProcessInstance$1.work(ProcessInstance.java:43)
             at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
             at org.jboss.seam.core.ProcessInstance.getProcessInstance(ProcessInstance.java:39)
             at sun.reflect.GeneratedMethodAccessor436.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
             at org.jboss.seam.Component.callComponentMethod(Component.java:1738)
             at org.jboss.seam.Component.unwrap(Component.java:1764)
             at org.jboss.seam.Component.getInstance(Component.java:1597)
             at org.jboss.seam.Component.getInstance(Component.java:1564)
             at org.jboss.seam.Component.getInstance(Component.java:1546)
             at org.jboss.seam.core.ProcessInstance.instance(ProcessInstance.java:70)
             at org.jboss.seam.contexts.BusinessProcessContext.getProcessInstance(BusinessProcessContext.java:213)
             at org.jboss.seam.contexts.BusinessProcessContext.getContextInstance(BusinessProcessContext.java:200)
             at org.jboss.seam.contexts.BusinessProcessContext.get(BusinessProcessContext.java:55)
             at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:149)
             at org.jboss.seam.Component.getInstance(Component.java:1556)
             at org.jboss.seam.Component.getInstanceToInject(Component.java:1789)
             at org.jboss.seam.Component.injectFields(Component.java:1312)
             at org.jboss.seam.Component.inject(Component.java:1082)
             at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
             at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:55)
             at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
             at sun.reflect.GeneratedMethodAccessor413.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
             at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
             at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
             at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
             at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:128)
             at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
             at com.santex.darwin.web.sample.TaskBean$$EnhancerByCGLIB$$90451471.destroy(<generated>)
             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:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
             at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
             at org.jboss.seam.Component.callComponentMethod(Component.java:1738)
             at org.jboss.seam.Component.callDestroyMethod(Component.java:1694)
             at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:186)
             at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:356)
             at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:239)
             at org.jboss.seam.jsf.AbstractSeamPhaseListener.afterRender(AbstractSeamPhaseListener.java:180)
             at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:83)
             at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
             at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
             at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
             at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: org.hibernate.SessionException: Session is closed!
             at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
             at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:874)
             at org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
             at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
             at org.jbpm.db.GraphSession.loadProcessInstance(GraphSession.java:276)
             ... 98 more
            


            any ideas?

            • 3. Re: how to use taskinstance??
              Pete Muir Master

              Sorry, I typod. I meant you want

              @In(required=false)
              .

              Anyway, it looks like Seam/JBPM is having problems loading the taskInstance. Is JBPM and processes working properly elsewhere? And data is being persisted to the database? When does this error occur? When the component is instatiated or when you call a method?

              I've not seen such an error, so can't be much more help...