Details
-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
None
-
None
Description
I modified a serializable object, part of an EJB3 Entity, during an MDB.onMessage() call. Hibernate attempts to update this serializable object during the transaction commit, but fails because it cannot load the class from the classloader. For example, if one modifies an entity such as:
@Entity
public class Foo {
Serializable bar;
...
}
in an MDB
public class MDB implements MessageListener {
@PersistenceContext
EntityManager em;
public void onMessage()
}
you get this error.
The thread context classloader is assigned when processing the message. Is it cleared after message processing or after transaction completion? From my limited understanding of the code, it seems like the former. There appears to be an invoker that sets and clears during processing, but the clear apparently happens before transaction commit.
Ordinarily, transaction commit does not require the context classloader of the .ear file, but in this case it does.