0 Replies Latest reply on Dec 27, 2007 11:32 AM by john miller

    How JAR files are loaded from EAR file

    john miller Newbie


      I have a question about how JAR files are deployed from within a single EAR file. This is using the clustered JBoss 4.2.2 AS.

      My app is deployed as an EAR file that contains B.jar and C.jar. B.jar contains a @Stateless B class that @Depends upon class C in C.jar, which is marked as a JBoss @Service. So the C service should start first, and then that can be injected into class B via the @EJB annotation.

      When I deploy this EAR file, C fails to start before B is created despite the @Depends annotation, so B fail to start properly. If I move classes B and C inside the same JAR, or if I rename C.jar to A.jar, it works fine, so it seems that JBoss is loading the JAR files from within the EAR in alphabetical order.

      Is there a way to specify the order in which the JARs from my EAR are loaded? Possibly in the application.xml file?

      Thanks in advance,