3 Replies Latest reply on Aug 20, 2013 9:26 AM by Tomaz Cerar

    Shared library loading within jboss as 7.x

    Jernej Krmelj Newbie



      I have a question regarding shared library loading within jboss as 7.x.


      I have multiple war applications deployed within same instance of jboss as 7. They all use/have dependency on custom server module which includes a common jar library. Within this common jar library there are few singleton objects defined. The problem I have is that this singleton objects are shared among all applications. That's what I don't want. I would like to have these singleton objects to be singletons just inside single application. How can I achieve this?


      I know I can achieve this by packaging common jar library within single application war (and stop using module dependency). But this is not the option here, because I want to be able to update common library without repackaging application war.


      I assume this issue is related to jboss as 7 classloading mechanism where modules are loaded with separate module classloader.

      Is there any way to configure applications to load common module with application classloader? Or configure a module in some speciffic way?


      I use jboss AS 7.1.2


      Excuse me if similar question was already answered. Please point me to another forum thread in this case.


      Thank you.