2 Replies Latest reply on Feb 25, 2011 3:51 AM by thomas10

    Bug in EAR deployment

    thomas10

      Hello,

       

      I am using jboss 6.0.0 final and have a problem/bug/misunderstanding:

       

      I have an ear containing two ejb-jars. Each jar contains exactly one singleton ejb (Bean1 and Bean2 for simplicity). Bean1 has a Class-Path reference to Bean2 in its manifest. Both beans don't have interfaces.

       

      When this ear is deployed Bean2 is deployed twice. Also, the @PostConstruct method of this ejb is called twice.

       

      This seems to be a bug in the ear deployment process. Or have I just done something stupid?

       

      Things I've tried so far (nothing changed the behavior):

      - attach application.xml deployment descriptor

      - attach ejb-jar.xml deployment descriptors

      - exchange @Singleton with @Stateless

      - remove @Startup

      - test with jboss 6.1.0-SNAPSHOT downloaded on 2011-02-24.

       

       

      Attached is the offending app.ear file along with its source and eclipse .project files.

       

      To reproduce the behavior just deploy the app.ear and read the logs.

       

       

      Please can anyone confirm that this is a bug?

      Where should I file a bug report?

       

      Thanks,

           Thomas

        • 1. Re: Bug in EAR deployment
          jaikiran

          thomas10 wrote:

           

          Hello,

           

          I am using jboss 6.0.0 final and have a problem/bug/misunderstanding:

           

          . Bean1 has a Class-Path reference to Bean2 in its manifest.

          The Java EE spec says this:

           

           

          JavaEE 6 EE.8.5.2 Bullet 4:
          Note that the presence of component-declaring annotations in shared artifacts, such as libraries in the library directory and libraries referenced by more than one module through Class-Path references, can have unintended and undesirable consequences and is not recommended.
          

           

           

          So don't use the Class-Path attribute in MANIFEST.MF to point to a jar containing the bean implementations. Remove that Class-Path entry and you should get past the issue.

          • 2. Re: Bug in EAR deployment
            thomas10

            Thanks for your clarification.

             

            So is there a mechanism to share artifacts (with annoted ejbs in it) that I am not aware of? Of course I could declare interfaces for these offending beans but this restricts the no-interface ejbs to internal use only, right?