[JBoss Seam] - jBPM and LIE
by pbrewer_uk
I'm new to using jBPM and am trying to query the jBPM database objects.
I run a query that returns summary data containing the process and the number of tasks for the process. The summary data is displayed, however, the user then trys to click a process to display a list of tasks for that process, but receives a LazyInitializationException instead.
How can I make the jBPM Session behave in similar manner to the seam managed PC? Is there anyway to make jBPM use seams entity manager instead?
Any ideas on how to solve this problem would be greatly appreciated.
Cheers, Pete.
Named query called jbpm.getProcesses
| SELECT
| count(t.processDefinition.id), t.processDefinition.id
| FROM
| org.jbpm.taskmgmt.exe.PooledActor pooledActor
| JOIN
| pooledActor.taskInstances ti
| JOIN
| ti.task t
| WHERE
| pooledActor.actorId in ( :actorIds )
| AND
| ti.actorId is null
| AND
| ti.isSuspended != true
| AND
| ti.isOpen = true
| GROUP BY
| t.processDefinition.id
|
Code that is used in a summary process list:
| public List<ProcessResult> getProcessSummary(List<String> pooledActorIds) {
| org.hibernate.Query taskQuery = jbpmContext.getSession().getNamedQuery("jbpm.getProcesses") ;
| taskQuery.setParameterList("actorIds", pooledActorIds) ;
| List<ProcessResult> results = new ArrayList<ProcessResult>() ;
| List<Object[]> queryResults = taskQuery.list() ;
| for (Object[] result : queryResults) {
| ProcessDefinition process = (ProcessDefinition) jbpmContext.getSession().load(ProcessDefinition.class, (Serializable)result[1]) ;
| results.add(new ProcessResult((Long)result[0], process)) ;
| }
| return results ;
|
Code that causes a LIE
| public Collection<Task> getTasksFromProcess(ProcessResult process) {
| if (process != null) {
| // next line causes LIE
| Map<String, Task> tasks = (Map<String, Task>) process.getProcess().getTaskMgmtDefinition().getTasks() ;
| return tasks.values() ;
| } else {
| return null;
| }
| }
|
|
The LIE in the log
| org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.graph.def.ProcessDefinition.definitions, no session or session was closed
| at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
| at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
| at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:151)
| at org.hibernate.collection.PersistentMap.get(PersistentMap.java:146)
| at org.jbpm.graph.def.ProcessDefinition.getDefinition(ProcessDefinition.java:431)
| at org.jbpm.graph.def.ProcessDefinition.getTaskMgmtDefinition(ProcessDefinition.java:444)
| 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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.def.ProcessDefinition_$$_javassist_95.getTaskMgmtDefinition(ProcessDefinition_$$_javassist_95.java)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion.getProcessSummary(JbpmExpansion.java:402)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion.addTaskNodes(JbpmExpansion.java:129)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion$$FastClassByCGLIB$$b998e405.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
| at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:37)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:154)
| at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:89)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion$$EnhancerByCGLIB$$9eed0613.addTaskNodes(<generated>)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion$JbpmType$3.addNodes(JbpmExpansion.java:68)
| at uk.co.iblocks.iflow.web.tree.expansion.JbpmExpansion.addNodes(JbpmExpansion.java:77)
| at uk.co.iblocks.iflow.web.TreeBean.exploreNode(TreeBean.java:270)
| at uk.co.iblocks.iflow.web.tree.TreeData$DebugNodeListener.exploreNode(TreeData.java:59)
| at uk.co.iblocks.iflow.web.tree.TreeData$DebugNodeListener.exploreNode(TreeData.java:59)
| at uk.co.iblocks.iflow.web.tree.TreeData$DebugNodeListener.exploreNode(TreeData.java:59)
| at uk.co.iblocks.iflow.web.tree.TreeData.setExpanded(TreeData.java:414)
| at com.icesoft.faces.component.tree.TreeRenderer.decode(TreeRenderer.java:109)
| at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:500)
| at com.icesoft.faces.component.tree.Tree.processDecodes(Tree.java:857)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIForm.processDecodes(UIForm.java:53)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:602)
| at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:135)
| at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:219)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.renderCyclePartial(BlockingServlet.java:473)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.receiveUpdates(BlockingServlet.java:442)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.executeRequest(BlockingServlet.java:324)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:186)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:393)
| 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:619)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029697#4029697
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029697
19Â years, 1Â month
[JBoss Seam] - Hypersonic Database Explorer no longer runs up.
by tony.herstellï¼ gmail.com
Hypersonic Database Explorer no longer works....
Go into the JMX console and start the database manager...
Wihtout my seam app deployed into the server it runs up (either through a cmd window or by starting the server in MyEclipse)..
However with my Seam app deployed into the server I get:
| 22:21:47,375 ERROR [HypersonicDatabase] Failed to start database manager
| 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.jboss.jdbc.HypersonicDatabase$1.run(HypersonicDatabase.java:517)
| Caused by: java.awt.HeadlessException
| at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
| at java.awt.Window.<init>(Window.java:317)
| at java.awt.Frame.<init>(Frame.java:419)
| at javax.swing.JFrame.<init>(JFrame.java:194)
| at org.hsqldb.util.DatabaseManagerSwing.main(Unknown Source)
| ... 5 more
|
Is this a Seam issue or an IceFaces issue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029696#4029696
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029696
19Â years, 1Â month
[Installation, Configuration & Deployment] - Upgrading JBoss 4.0.4 log4j 1.2.8 to 1.2.9
by amarsyed
We have installed JBoss 4.0.4 which uses log4j 1.2.8.
Our applications are compiled against 1.2.9 and when deployed to the JBoss AppServer we get a classnotfound exception due to the RootLogger class not being present.
We cannot downgrade our own version and nor can we change our usage back to the deprecated RootCategory. We can however upgrade log4j1.2.8 to 1.2.9 in the server lib folders of JBoss. Would this be safe as the following change notes seem to suggest so.
anonymous wrote : LOG4J Change History:
| The following shows the difference between both versions.
|
| - Release of version 1.2.9
|
| anonymous wrote : Log4j version 1.2.9, is identical to version 1.2.8, except that
| | several key methods have been deprecated in preparation for version
| | 1.3.0, the next major release of log4j. These changes are intended to
| | enforce the rule that client code should never refer to the Category
| | class directly, but use the Logger class instead. Similarly, client
| | code should not refer to the Priority class but to the Level class
| | instead.
| |
| | For a more detailed discussion, refer to the document entitled
| preparing for log4j 1.3 at:
|
| http://www.qos.ch/logging/preparingFor13.jsp
|
| February 19th, 2003
|
| - Release of version 1.2.8
|
| - Fixed bug #11570 whereby XMLAppender would throw a
| NullPointerException if the input message was null. Many thanks to
| David Vandegrift for reporting the bug and to Hendrik Brummermann for
| supplying the patch. *
|
| - Fixed bug #12366 whereby various versions of Xerces would not parse
| log4j configuration scripts expressed in XML format. *
|
| - Fixed bug #14827. The "removes" buffer used in the flushBuffer() method
| of JDBCAppender is now cleared, solving the memory leak. Thanks to John
| Landers for reporting the bug and suggesting the fix. *
|
| - Fixed bug #15599. SocketAppender now honors ReconnectionDelay of 0.
| Many thanks to Scott Schram for reporting the bug and providing the fix. *
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029695#4029695
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029695
19Â years, 1Â month