Page 1 of 1

jbmp error: failed to lazily initialize a collection

PostPosted:Sat Jan 09, 2016 6:20 pm
by bouskam
Hello!
Im trying develop my own workflow with forms.
Everything fine with first form, but when the second form should displayed, i got jbmp error instead: Image

this happens on 3 different servers (Ive tried 6.3.1builds 8235 and 8230 and also 6.3.0)
May I do something wrong ? ( Im using Jboss studio 9 with the jBPM3 )

thank You for any advice!


and here is the code:
workflow:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>

<process-definition 
  xmlns="urn:jbpm.org:jpdl-3.2"
  name="simple">
   <start-state name="start">
		<transition to="task-node1"></transition>
	</start-state>
   <task-node name="task-node1">
		<task name="decision">
			<assignment actor-id="okmAdmin"></assignment>
		</task>
		<transition to="task-node2" name="krok2"></transition>
	</task-node>

	<task-node name="task-node2">
		<task name="review">
			<assignment actor-id="okmAdmin"></assignment>
		</task>
		<transition to="end" name="toend"></transition>
	</task-node>
   <end-state name="end"></end-state>
</process-definition>
and also the forms are very simple:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.1//EN" "http://www.openkm.com/dtd/workflow-forms-2.1.dtd">

<workflow-forms>
  <workflow-form task="decision">
    <input name="first" label="first" type="text" />
    <button name="submit" label="OK" />
  </workflow-form>
  <workflow-form task="review">
    <input name="second" label="second" type="text" />
    <button name="submit" label="OK" />
  </workflow-form>
</workflow-forms>
catalina.log with this error:
Code: Select all
2016-01-09 18:16:29,516 [http-bio-0.0.0.0-8080-exec-3] WARN  org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog- Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
2016-01-09 18:16:29,545 [http-bio-0.0.0.0-8080-exec-3] WARN  org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog- Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
2016-01-09 18:16:29,743 [http-bio-0.0.0.0-8080-exec-2] WARN  org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog- Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
2016-01-09 18:16:29,776 [http-bio-0.0.0.0-8080-exec-2] ERROR com.openkm.servlet.frontend.WorkflowServlet- failed to lazily initialize a collection of role: org.jbpm.bytes.ByteArray.byteBlocks, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.bytes.ByteArray.byteBlocks, no session or session was closed
	at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
	at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
	at org.hibernate.collection.PersistentList.hashCode(PersistentList.java:490)
	at org.jbpm.bytes.ByteArray.hashCode(ByteArray.java:113)
	at java.lang.Object.toString(Object.java:237)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.bytes.ByteArray_$$_javassist_85.toString(ByteArray_$$_javassist_85.java)
	at java.lang.String.valueOf(String.java:2854)
	at com.openkm.util.GWTUtil.copy(GWTUtil.java:635)
	at com.openkm.util.GWTUtil.copy(GWTUtil.java:597)
	at com.openkm.servlet.frontend.WorkflowServlet.findUserTaskInstances(WorkflowServlet.java:127)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
and finaly the par file:
https://dl.dropboxusercontent.com/u/109859282/quo.par

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Sun Jan 10, 2016 5:12 pm
by jllort
At line 635 in GWTUtil class we have:
Code: Select all
if (obj instanceof FormElement) {
				variables.put(key, copy((FormElement) obj));
			} else {
				variables.put(key, String.valueOf(obj));
			}
In you case seems obj is not an instance of FormElement and is executing:
Code: Select all
variables.put(key, String.valueOf(obj));
What raises de the error.

Looking the form:
Code: Select all
<workflow-form task="review">
    <input name="second" label="second" type="text" />
    <button name="submit" label="OK" />
  </workflow-form>
Should be processed a FormElement but for some reason is not doing it. I suggest debug that line to understanding what kind of object is processing there.

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Tue Jan 12, 2016 9:44 am
by bouskam
Hello,
I figued it out - it was the same problem, as desribed under http://forum.openkm.com/viewtopic.php?t=9025#p22382:

HSQL database will not store workflow session data, dont use it !!!

In my opinion, either is this a BUG, or it should be at least mentioned in Wiki and/or installation guide, that workflows will not work with HSQL. It would save me 3 days of labouring with jBPM, althougt the problem was on server.

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Wed Jan 13, 2016 4:58 pm
by jllort
Moving to MySQL did you solved the problem ?
What is strange for us is that you get something running or HSQL ?

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Fri Jan 15, 2016 8:21 pm
by bouskam
Yeh, migrating to MySQL solved that.
Im running low on RAM on workstation, so I dont want to run server locally together with Eclipse. Therefore is server deployed on other machine and it was installed from bundle, not compiled from source.
HSQL was not my choice, it was configured from installer. If there was a warning, that I should migrate to Mysql after install, I would do that. But I was not warned, so I left the default engine.

If I can have a wish, please let other people know, that they should avoid HSQL.
Such warning can be placed either at wiki/workflow courses, or at the last step of installer, or at workflows administration page... there are many possibilities..
Thank You!

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Sun Jan 17, 2016 11:19 am
by jllort
We get your suggest and we will try doing something on that direction.

Re: jbmp error: failed to lazily initialize a collection

PostPosted:Mon Jan 18, 2016 12:58 pm
by pavila
I've included a warning message in the workflow administration listing.