1 Reply Latest reply on Jul 28, 2005 9:43 AM by andrewbetencourt

    Static Reference in EJB Container

    andrewbetencourt

      I have a JAR that contains some entity beans and session facades.

      After start jboss in all mode, the application call the session facades that call entity beans and finalize. OK!

      My application use ServiceLocator for find objects in JNDI Context.

      The problem is that after do redeploy (hot-deploy), the ServiceLocator instance not is null. The JbossApp keep the instance of the ServiceLocator in server memory. All references of the EJB LocalHome still they are in the Map(cache).

      I need clean whole context of my JAR´s. I need clean all static variables.

      Thanks.

      Andrew Thomas

        • 1. Re: Static Reference in EJB Container
          andrewbetencourt


          Solution:

          In Jboss.xml add code:

           <loader-repository>
           br.com.xxxx:loader=MyEntity.jar
           </loader-repository>
          


          where
          br.com.xxxx - unique name in Jboss Context
          MyEntity.jar - jar name

          This xml configuration create one ClassLoader for each application.

          Andrew Thomas Betencourt
          SCJP | SCWCD | SCBCD
          andrew@andrewthomas.com.br
          www.andrewthomas.com.br