[jboss-user] [JBoss Seam] - Using ManagedJbpmContext in TreeNode impls of rich:tree

fzaker do-not-reply at jboss.com
Thu Aug 23 12:19:44 EDT 2007


In my seam application, I have a rich:tree and some TreeNode implementations:
jsf code:

  | <rich:tree id="allTasksTree" switchType="ajax" style="width:300px"
  | 		 value="#{tasksRootNode}" var="item" nodeFace="#{item.class.name}">
  |   <rich:treeNode type="org.jbpm.graph.def.ProcessDefinition">
  |     <h:outputText value="#{item.name}" />
  |   </rich:treeNode>
  |   <rich:treeNode type="org.jbpm.taskmgmt.def.Task">
  |     <h:outputText value="#{item.name}" />
  |   </rich:treeNode>
  |   <rich:treeNode type="org.jbpm.taskmgmt.exe.TaskInstance">
  |     <h:outputText value="#{item.toString}" />
  |   </rich:treeNode>
  | </rich:tree>
  | 

TasksRootNode:

  | @Stateful
  | @Name("tasksRootNode")
  | public class TasksRootNode implements TreeNode {
  |   private void InitProcessNodesMap() {
  |     GraphSession graphSession = ManagedJbpmContext.instance().getGraphSession();
  | 	...
  |   }
  | 
  | ...
  | }
  | 

TaskNode:

  | @Stateful
  | public class TaskNode implements TreeNode {
  | ...
  |   private void InitTaskInstanceNodesMap() {
  |     GraphSession graphSession = ManagedJbpmContext.instance().getGraphSession();
  | 	...
  |   }
  | 
  | ...
  | }
  | 

The call to ManagedJbpmContext in RootTasksNode class is run perfectly with no problem.
But execution of TaskNode.InitTaskInstanceNodesMap raises the following (Adding @Transactional or @Interceptors(...) to TaskNode did not help).
Any idea? I doubt if having TreeNode implementations as SFSB is a good solution. Any idea?


  | Hibernate: select processdef0_.ID_ as ID1_14_, processdef0_.NAME_ as NAME2_14_, processdef0_.VERSION_ as VERSION3_14_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_14_, processdef0_.STARTSTATE_ as STARTSTATE5_14_ from JBPM_PROCESSDEFINITION processdef0_ order by processdef0_.NAME_, processdef0_.VERSION_ desc
  | 08:07:53,515 ERROR [ExceptionFilter] uncaught exception
  | javax.servlet.ServletException: JbpmContext may only be used inside a transaction
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  | 	at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  | 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  | 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 08:07:53,515 ERROR [ExceptionFilter] exception root cause
  | java.lang.IllegalStateException: JbpmContext may only be used inside a transaction
  | 	at org.jboss.seam.core.ManagedJbpmContext.getJbpmContext(ManagedJbpmContext.java:75)
  | 	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:20)
  | 	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
  | 	at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
  | 	at org.jboss.seam.Component.unwrap(Component.java:1860)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1657)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1622)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1599)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1594)
  | 	at org.jboss.seam.core.ManagedJbpmContext.instance(ManagedJbpmContext.java:117)
  | 	at org.darkoob.dtm.task.treeNodes.TaskNode.InitTaskInstanceNodesMap(TaskNode.java:71)
  | 	at org.darkoob.dtm.task.treeNodes.TaskNode.getChildren(TaskNode.java:88)
  | 	at org.richfaces.component.TreeDataModel.walk(TreeDataModel.java:79)
  | 	at org.richfaces.component.TreeDataModel.walkModel(TreeDataModel.java:217)
  | 	at org.richfaces.component.CacheableTreeDataModel.walkModel(CacheableTreeDataModel.java:92)
  | 	at org.richfaces.component.UITree.walkModel(UITree.java:299)
  | 	at org.richfaces.component.state.TreeState.visitNodes(TreeState.java:286)
  | 	at org.richfaces.component.state.TreeState.expandNode(TreeState.java:367)
  | 	at org.richfaces.component.state.events.ExpandNodeCommandEvent.execute(ExpandNodeCommandEvent.java:47)
  | 	at org.richfaces.component.state.events.TreeStateCommandEvent.processListener(TreeStateCommandEvent.java:61)
  | 	at org.richfaces.component.UITree.broadcast(UITree.java:449)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  | 	at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  | 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  | 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 08:07:53,546 ERROR [DebugPageHandler] redirecting to debug page
  | java.lang.IllegalStateException: JbpmContext may only be used inside a transaction
  | 	at org.jboss.seam.core.ManagedJbpmContext.getJbpmContext(ManagedJbpmContext.java:75)
  | 	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:20)
  | 	at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
  | 	at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
  | 	at org.jboss.seam.Component.unwrap(Component.java:1860)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1657)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1622)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1599)
  | 	at org.jboss.seam.Component.getInstance(Component.java:1594)
  | 	at org.jboss.seam.core.ManagedJbpmContext.instance(ManagedJbpmContext.java:117)
  | 	at org.darkoob.dtm.task.treeNodes.TaskNode.InitTaskInstanceNodesMap(TaskNode.java:71)
  | 	at org.darkoob.dtm.task.treeNodes.TaskNode.getChildren(TaskNode.java:88)
  | 	at org.richfaces.component.TreeDataModel.walk(TreeDataModel.java:79)
  | 	at org.richfaces.component.TreeDataModel.walkModel(TreeDataModel.java:217)
  | 	at org.richfaces.component.CacheableTreeDataModel.walkModel(CacheableTreeDataModel.java:92)
  | 	at org.richfaces.component.UITree.walkModel(UITree.java:299)
  | 	at org.richfaces.component.state.TreeState.visitNodes(TreeState.java:286)
  | 	at org.richfaces.component.state.TreeState.expandNode(TreeState.java:367)
  | 	at org.richfaces.component.state.events.ExpandNodeCommandEvent.execute(ExpandNodeCommandEvent.java:47)
  | 	at org.richfaces.component.state.events.TreeStateCommandEvent.processListener(TreeStateCommandEvent.java:61)
  | 	at org.richfaces.component.UITree.broadcast(UITree.java:449)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
  | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  | 	at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  | 	at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | 	at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
  | 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
  | 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077433#4077433

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077433



More information about the jboss-user mailing list