[
https://jira.jboss.org/jira/browse/JBPM-2692?page=com.atlassian.jira.plug...
]
Mauro Molinari commented on JBPM-2692:
--------------------------------------
I found the source of my problem. The token is null because the ProcessLog is referring to
a VariableInstance which has been deleted. More precisely, I have a VariableInstance whose
value is updated from a non-null value to a null value: the VariableInstance is not
deleted from the database (because of history reasons, I think) but some of its fields are
nulled, and the token is one of them. Then, when I iterate over the ProcessLogs, jBPM
cannot deserialize its value anymore because of the token being null.
I think that the problem could easily be solved by keeping a reference to the
ProcessDefinition in the VariableInstance (even if this is deleted) and by using that
definition to load classes for deserialization. Alternatively, maybe keeping the token
reference would be enough... I don't know which consequences this might have.
Still problems with variables of Serializable objects
-----------------------------------------------------
Key: JBPM-2692
URL:
https://jira.jboss.org/jira/browse/JBPM-2692
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.6.SP1
Environment: jBPM 3.2.6.SP1 embedded into a web application
Reporter: Mauro Molinari
There are times in which when calling org.jbpm.context.exe.VariableInstance.getValue(),
the proprty token is null. In this case, if the variable object is of a Serializable class
and this class is in the PAR, calling getValue() will fail with a ClassNotFound exception
if the process class loader is not the one who loaded the SerializableToByteArrayConverter
class. This is because the method
org.jbpm.context.exe.converter.SerializableToByteArrayConverter.revert(ByteArray) (without
the token) is called and a plain ObjectInputStream is used to do the deserialization.
I don't have a simple test case to reproduce, but this is what I am doing:
- my webapp application is retreiving all the logs associated to a ProcessInstance using
org.jbpm.db.LoggingSession.findLogsByProcessInstance(long)
- it is iterating over the collection and, for each ProcessLog instance, it is retreiving
the variable instance values (for example: org.jbpm.context.log.VariableCreateLog the
method org.jbpm.context.log.VariableLog.getVariableInstance() is called; for a
org.jbpm.context.log.VariableUpdateLog the methods
org.jbpm.context.log.VariableUpdateLog.getOldValue() and
org.jbpm.context.log.VariableUpdateLog.getNewValue() are called and so on)
- a ClassNotFoundException is launched; the class loader in use is that of the webapp, so
it's normal that the class of the variable value cannot be found, since it is a
serializable class provided by the PAR.
I don't know why token is null: should it be restored by Hibernate? Looking at
org.jbpm.context.exe.VariableInstance the only explicit code that sets the token property
is in org.jbpm.context.exe.VariableInstance.create(Token, String, Object).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira