Petals ESB Container

Impossible to cast the TransactionManager in a component when the classloader isolation is activated

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 3.1
  • Fix Version/s: 5.0.0
  • Component/s: Classloader
  • Security Level: Public
  • Description:
    Hide

    When PEtALS isolates the components classloaders, it is not possible to cast the TransactionManager instance in the component.
    The problem is that the ComponentContext interface defines a method that return an Object, not the TransactionManager, and that the TransactionManager instance is in fact a fractal binding which is a runtime generated class. It is thus not possible to defines the class in the isolated component classloader!
    The result is that it is not possible to use transaction when classloader isolation is activated!

    Show
    When PEtALS isolates the components classloaders, it is not possible to cast the TransactionManager instance in the component. The problem is that the ComponentContext interface defines a method that return an Object, not the TransactionManager, and that the TransactionManager instance is in fact a fractal binding which is a runtime generated class. It is thus not possible to defines the class in the isolated component classloader! The result is that it is not possible to use transaction when classloader isolation is activated!
  • Environment:
    OS:all

Issue Links

Activity

Roland Naudin made changes - Fri, 16 Jul 2010 - 11:35:16 +0200
Field Original Value New Value
Status New [ 10000 ] Open [ 10002 ]
Priority Minor [ 4 ]
Assignee Roland Naudin [ rnaudin ]
Victor NOËL made changes - Thu, 28 May 2015 - 14:07:11 +0200
Assignee Admin [ rnaudin ] Victor NOËL [ vnoel ]
Hide
Victor NOËL added a comment - Thu, 28 May 2015 - 14:12:10 +0200

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.

Show
Victor NOËL added a comment - Thu, 28 May 2015 - 14:12:10 +0200 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.
Victor NOËL made changes - Thu, 28 May 2015 - 14:28:09 +0200
Status Open [ 10002 ] In Progress [ 10003 ]
Victor NOËL made changes - Thu, 28 May 2015 - 14:35:00 +0200
Status In Progress [ 10003 ] Resolved [ 10004 ]
Fix Version/s 5.0.0 [ 10413 ]
Resolution Fixed [ 1 ]
Christophe DENEUX made changes - Thu, 28 May 2015 - 15:51:13 +0200
Link This issue depends on PETALSESBCONT-323 [ PETALSESBCONT-323 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
28m 37s
1
Roland Naudin
Fri, 16 Jul 2010 - 11:35:16 +0200
Open Open In Progress In Progress
1777d 2h 52m
1
Victor NOËL
Thu, 28 May 2015 - 14:28:09 +0200
In Progress In Progress Resolved Resolved
6m 51s
1
Victor NOËL
Thu, 28 May 2015 - 14:35:00 +0200



People

Dates

  • Created:
    Fri, 16 Jul 2010 - 11:06:39 +0200
    Updated:
    Thu, 28 May 2015 - 15:51:13 +0200
    Resolved:
    Thu, 28 May 2015 - 14:35:00 +0200