[jboss-dev-forums] [Design of POJO Server] - Re: Scoping of war/jar file embedded in sar service archives

adinn do-not-reply at jboss.com
Wed Jul 9 04:48:47 EDT 2008


Hi Scott,

Thanks for looking at this. The problem was explained rather clumsily in the original post. Here is a picture of the setup which might make things clearer:


  | example.sar
  |     war1.war
  |         WEB-INFO/web.xml
  |             ...
  |             <listener>com.arjuna.Listener1</listener>
  |             ...
  |     war2.war
  |         WEB-INFO/web.xml
  |             ...
  |             <listener>com.arjuna.Listener2</listener>
  |             ...
  |     jar1.jar
  |         com/arjuna/Listener1.class
  |         com/arjuna/Sequencer.class
  |         ...
  |     jar2.jar
  |         com/arjuna/Listener2.class
  |         ...
  | 

Listener1 and Listener2 both refer to static array in class Sequencer. However, they appear to see two different versions of this array. Listener1 is supposed to see changes made by Listener2 and vice versa but this does not happen. I assume this is because they are each referring to different versions of the class and that this is something to do with the way the war classloader interacts with the sar/jar loaders. If I unjar the classes and place them in the sar at top level then the listeners all see the same version of Sequencer i.e. this works ok:


  | example.sar
  |     war1.war
  |         WEB-INFO/web.xml
  |             ...
  |             <listener>com.arjuna.Listener1</listener>
  |             ...
  |     war2.war
  |         WEB-INFO/web.xml
  |             ...
  |             <listener>com.arjuna.Listener2</listener>
  |             ...
  |     com/arjuna/Listener1.class
  |     com/arjuna/Sequencer.class
  |     com/arjuna/Listener2.class
  |     ...
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163225#4163225

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163225



More information about the jboss-dev-forums mailing list