2 Replies Latest reply on Jan 13, 2011 4:57 AM by Anup Unawane

    Are singleton classes shared between 2 wars of same application?

    Anup Unawane Newbie

      Currently we are working on JBOSS 5.1.0.GA and windows XP with SP3. JAVA environment is 1.5.0_22.


      We had set 2 wars of same web application with different context name. These 2 wars are stored in <JBOSS>\server\default\deploy with directory names as APP1.war and APP2.war respectively. JBOSS is running with default configuration. We did not changed any configuration file for jboss except HTTP connector port in these two files:

      1. jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\server.xml

      2. jboss-5.1.0.GA\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml


      The problem we are facing is as

      when we start jboss, 1st war get deployed correctly. but while deployment of 2nd war it refers singleton classes from 1st war.

      This has been confirmed with displaying singleton class's hashcode.

      (Note: we had not overridden hashcode method.)

      We tested this scenario with Tomcat 6.0.24. Its working fine with tomcat.