]
archana archana commented on JBPM-424:
--------------------------------------
hjh
JBPM on DB2: ModuleInstances in the instance variable of
ProcessInstance don't get persisted correctly
------------------------------------------------------------------------------------------------------
Key: JBPM-424
URL:
http://jira.jboss.com/jira/browse/JBPM-424
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM 3.0.1
Environment: JBoss 4.0.3 with JBM 3.0.1 and EJB's (spec 2.0, generated by
XDoclet) on Windows XP, DB2 on image (VMWare) of Win2K
Reporter: Frank Verbruggen
Assigned To: Tom Baeyens
Priority: Blocker
I have a SLSB that facades for the JBPM,
it is called FacadeBean (Remote Interface called: Facade),
and it offers a set of functions:
** FacadeBean **
/**
* Business method
* @ejb.interface-method view-type = "both"
* @ejb.transaction type = "Required"
*/
public Long createInstance(java.lang.String procesDefinitionName) {
JbpmSession jbpmSession = null;
try {
JbpmSessionFactory factory = JbpmSessionFactory.getInstance();
jbpmSession = factory.openJbpmSession();
ProcessDefinition procdef = jbpmSession.getGraphSession()
.findLatestProcessDefinition(procesDefinitionName);
ProcessInstance procinst = procdef.createProcessInstance();
log.debug("New process instance created (" + procinst.getId() + ")
based on latest definition of " + procesDefinitionName);
String size = procinst.getInstances() == null ? "null" : "" +
procinst.getInstances().size();
log.debug("instances of processInstance: " + size);
if (procinst.getInstances() != null) {
Iterator it = procinst.getInstances().values().iterator();
while (it.hasNext()) {
log.debug("Next processInstance.instance: " + it.next());
}
}
return new Long(procinst.getId());
} finally {
jbpmSession.close();
}
}
/**
* Business method
* @ejb.interface-method view-type = "both"
* @ejb.transaction type = "Required"
*/
public void sendSignal(java.lang.Long processInstanceId) {
JbpmSession jbpmSession = null;
try {
JbpmSessionFactory factory = JbpmSessionFactory.getInstance();
jbpmSession = factory.openJbpmSession();
log.debug("Loading processInstance " + processInstanceId);
ProcessInstance instance =
jbpmSession.getGraphSession().loadProcessInstance(processInstanceId.longValue());
log.debug("ProcessInstance " + processInstanceId + " loaded.");
ContextInstance contextInstance = instance.getContextInstance();
log.debug("Context retrieved");
String traceLog = (String) contextInstance.getVariable(CTX_INSTANCE_TRACE);
String traceLine = instance.getRootToken().getNode().getName() + "\n";
if (traceLog == null) {
contextInstance.createVariable(CTX_INSTANCE_TRACE, traceLine);
} else {
contextInstance.setVariable(CTX_INSTANCE_TRACE,
traceLog +
traceLine);
}
instance.signal();
} finally {
jbpmSession.close();
}
}
/**
* Business method
* @ejb.interface-method view-type = "both"
*/
public Boolean hasEnded(java.lang.Long processInstanceId) {
JbpmSession jbpmSession = null;
try {
JbpmSessionFactory factory = JbpmSessionFactory.getInstance();
jbpmSession = factory.openJbpmSession();
ProcessInstance instance =
jbpmSession.getGraphSession().loadProcessInstance(processInstanceId.longValue());
return new Boolean(instance.hasEnded());
} finally {
jbpmSession.close();
}
}
/**
* Business method
* @ejb.interface-method view-type = "both"
*/
public String getTraceLog(java.lang.Long processInstanceId) {
JbpmSession jbpmSession = null;
try {
JbpmSessionFactory factory = JbpmSessionFactory.getInstance();
jbpmSession = factory.openJbpmSession();
ProcessInstance instance =
jbpmSession.getGraphSession().loadProcessInstance(processInstanceId.longValue());
ContextInstance contextInstance = instance.getContextInstance();
return (String) contextInstance.getVariable(CTX_INSTANCE_TRACE);
} finally {
jbpmSession.close();
}
}
** End of Listing **
Now, I want to run the following code:
** Begin Listing **
private static String runProcess(Facade facade, String processDefinitionName) throws
RemoteException {
StringBuffer buffer = new StringBuffer();
try {
Long procId = facade.createInstance(processDefinitionName);
buffer.append("Process gecreerd met id " + procId + "\n");
while (!facade.hasEnded(procId).booleanValue()) {
facade.sendSignal(procId);
}
buffer.append(facade.getTraceLog(procId));
} catch (Throwable t) {
buffer.append(t);
}
return buffer.toString();
}
** End of Listing **
The instance gets created and I see the following four lines in my debug log:
** Begin Listing **
2005-10-27 11:25:49,483 DEBUG [nl.inkassounie.focus.jbpm.FacadeBean] New process instance
created (141) based on latest definition of inkassounie_uninterruped_flow
2005-10-27 11:25:49,483 DEBUG [nl.inkassounie.focus.jbpm.FacadeBean] instances van
processInstance: 2
2005-10-27 11:25:49,483 DEBUG [nl.inkassounie.focus.jbpm.FacadeBean] Next
processInstance.instance: org.jbpm.taskmgmt.exe.TaskMgmtInstance@1a498b6
2005-10-27 11:25:49,483 DEBUG [nl.inkassounie.focus.jbpm.FacadeBean] Next
processInstance.instance: org.jbpm.context.exe.ContextInstance@1ddd83c
** End of Listing **
So I know at creation time that the instances variable holds 2 values.
They exist in the DB
BUT
the NAME_ column in the JBPM_MODULEINSTANCE table does not contain any values (the other
columns do)
therefore the Map instances in ProcessInstance cannot be reformed from the DB.
The error I recieved:
** Begin Listing **
11:25:53,295 ERROR [LogInterceptor] RuntimeException in method: public abstract void
nl.inkassounie.focus.jbpm.Facade.sendSignal(java.lang.Long) throws
java.rmi.RemoteException:
org.hibernate.HibernateException: null index column for collection:
org.jbpm.graph.exe.ProcessInstance.instances
at
org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:652)
at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:222)
at org.hibernate.loader.Loader.readCollectionElement(Loader.java:994)
at org.hibernate.loader.Loader.readCollectionElements(Loader.java:635)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:579)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1916)
at
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
at
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1562)
at
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:85)
at
org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:160)
at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127)
at org.jbpm.graph.exe.ProcessInstance.getInstance(ProcessInstance.java:136)
at org.jbpm.graph.exe.ProcessInstance.getContextInstance(ProcessInstance.java:163)
at nl.inkassounie.focus.jbpm.FacadeBean.sendSignal(FacadeBean.java:149)
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.invocation.Invocation.performCall(Invocation.java:345)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
at
org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
at
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at
org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
** End of Listing **
I don't know how to fix this, but atm it is a showstopper for a big customer.
Plz let me know if this is a bug for JBPM (fverbruggen(a)solidium.nl).
I am inclined to believe it is since the exact same thing happens in my MySQL test DB
(which resides on my local system)
Kind regards,
Frank Verbruggen
Software Architect
Solidium ( Ordina J-Solutions )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: