The problem is simpler than that: TransactionManager is not loaded as part of the common classloader (i.e. the JBI classloader) so in the issue context, it gets loaded twice:
- once in the container (TransactionManager(cont))
- once in the component (TransactionManager(comp))
Two loads of a class in two different classloaders are NOT considered the same class by the JVM.
Hence, the impossibility to cast the implementation of TransactionManager(cont) to a variable of type TransactionManager(comp).
The solution is straightforward: the JTA classes should be part of the JBI classloader in Petals. See PETALSESBCONT-323.
The problem is simpler than that: TransactionManager is not loaded as part of the common classloader (i.e. the JBI classloader) so in the issue context, it gets loaded twice:
Two loads of a class in two different classloaders are NOT considered the same class by the JVM.
Hence, the impossibility to cast the implementation of TransactionManager(cont) to a variable of type TransactionManager(comp).
The solution is straightforward: the JTA classes should be part of the JBI classloader in Petals. See
PETALSESBCONT-323.- once in the container (TransactionManager(cont))
- once in the component (TransactionManager(comp))
Two loads of a class in two different classloaders are NOT considered the same class by the JVM. Hence, the impossibility to cast the implementation of TransactionManager(cont) to a variable of type TransactionManager(comp). The solution is straightforward: the JTA classes should be part of the JBI classloader in Petals. SeePETALSESBCONT-323.