[
https://jira.jboss.org/browse/JBPM-2692?page=com.atlassian.jira.plugin.sy...
]
Mauro Molinari updated JBPM-2692:
---------------------------------
Attachment: Patch per JBTM-2692.patch
I'm attaching a new version of my patch for jBPM 3.2.7. Things have changed a bit in
jBPM 3.2.7, because now the process definition is natively used as a key to get the
correct class loader, rather than the token. So my ProcessDefinitionContextConverter is no
longer needed and the patch is smaller. However the problem with the fact that the
ProcessInstance reference is set to null when a variable instance is deleted still
applies, so the reference to the process definition in JBPM_VARIABLEINSTANCE is still
needed.
Still problems with variables of Serializable objects
-----------------------------------------------------
Key: JBPM-2692
URL:
https://jira.jboss.org/browse/JBPM-2692
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.6.SP1, jBPM 3.2.7
Environment: jBPM 3.2.6.SP1 embedded into a web application
Reporter: Mauro Molinari
Attachments: Patch per JBTM-2692.patch, patch_for_JBPM-2692.txt
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/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira