Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2692

Still problems with variables of Serializable objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • jBPM 3.2.15
    • jBPM 3.2.6.SP1, jBPM 3.2.7
    • Runtime Engine
    • None

      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).

            marco.rietveld Marco Rietveld (Inactive)
            mauromol_jira Mauro Molinari (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: