3 Replies Latest reply on Feb 20, 2009 7:49 AM by Max Rydahl Andersen

    undeploying a JAR

    Niranjan Deshpande Newbie

      Hi users,

      I developed a simple EJB3.0 entity based applicaition and deployed it.

      I changed the persistence.xml file, undeployed the earlier jar from the server view, deleted the earlier jar from the project navigator, made a new jar and deployed it again on the server.

      I restarted the server. But I see -

      ObjectName: jboss.j2ee:service=EJB3,module=employee_new.jar
      State: FAILED
      Reason: java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: persistence.units:unitName=EntityService already registered.

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,module=employee_new.jar
      State: FAILED
      Reason: java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: persistence.units:unitName=EntityService already registered.


      I also see this in the log -

      You have not defined a jta-data-source for a JTA enabled persistence context named: EntityService

      The new persistence.xml contains the correction for the JTA. But I think the earlier JARS are still on the server.

      When I see the jboss.j2ee in the JMX-Console, i see all the three jars, namely:

      module=employee.jar,service=EJB3
      module=employee_new.jar,service=EJB3
      module=employee_test.jar,service=EJB3
      module=hello.jar,service=EJB3

      where as, the employee_new.jar is the latest.

      Why is the server caching the jars? How do I remove the jars and deploy only the employee_new.jar?

      My way of removing the jar is:
      1. in the server view remove the jar from the server
      2. in the project navigator, delete the jar
      3. select the spurce files and build a new jar
      4. right click on the new jar and click 'make deployable'
      5. restart the server.

      Please help me in removing the irrelevant jars.