9 Replies Latest reply on May 18, 2018 10:10 AM by mobe

    Wildfly 11 ignores ejb-jar.xml

    mobe

      Hi, I am having issues with deploying a war containing an ejb jar with an MDB to Wildfly 11. When I use @MessageDriven annotation, everything works fine but I need to use ejb-jar.xml to allow environment specific configuration of the MDB. When I remove the annotations and place an ejb-jar.xml under META-INF/ Wildfly does not start the MDB. It seems that the ejb-jar.xml is not even processed at all because no deployment errors are thrown when place invalid markup into it.

       

      Are there any working examples that I could look into to figure out what I am doing wrong? I would appreciate some help..

        • 1. Re: Wildfly 11 ignores ejb-jar.xml
          jaikiran

          Is this a .jar file or a .ear file? Either way, can you post the output of:

           

          jar -tf your-ejb-jar.jar

           

          There are plenty of examples in the WildFly testsuite which use ejb-jar.xml, so I don't expect this basic feature to be broken Here's one of the testcases wildfly/DDBasedEJBTestCase.java at master · wildfly/wildfly · GitHub

          • 2. Re: Wildfly 11 ignores ejb-jar.xml
            mobe

            jaikiran thanks for your response!

             

            The file is a .jar and is packaged into a .war under WEB-INF/lib.

             

            I have looked at the test case and still cannot figure out what I am doing wrong. Here is the requested output for my jar

             

            META-INF/MANIFEST.MF

            META-INF/

            com/

            com/ordami/

            com/ordami/geo/

            com/ordami/geo/sync/

            META-INF/maven/

            META-INF/maven/com.ordami.geo/

            META-INF/maven/com.ordami.geo/geo-sync/

            com/ordami/geo/sync/LocationUpdateConsumer.class

            META-INF/ejb-jar.xml

            META-INF/maven/com.ordami.geo/geo-sync/pom.properties

            META-INF/maven/com.ordami.geo/geo-sync/pom.xml

             

            As I said, even when I put completely invalid markup into ejb-jar.xml, Wildfly just does not care.

            • 3. Re: Wildfly 11 ignores ejb-jar.xml
              jaikiran

              The EJB spec states that if you are packaging your EJBs within a .war file, then the ejb-jar.xml should be placed in the .war/WEB-INF/ directory.

              • 4. Re: Wildfly 11 ignores ejb-jar.xml
                mobe

                OK I moved the ejb-jar.xml to /WEB-INF in the WAR but still the same issue. Here is the jar -tf output for the war:

                 

                META-INF/

                META-INF/MANIFEST.MF

                swagger-ui/

                WEB-INF/

                WEB-INF/classes/

                WEB-INF/classes/META-INF/

                WEB-INF/lib/

                META-INF/jboss-deployment-structure.xml

                swagger-ui/.npmignore

                swagger-ui/absolute-path.js

                swagger-ui/favicon-16x16.png

                swagger-ui/favicon-32x32.png

                swagger-ui/index.html

                swagger-ui/index.js

                swagger-ui/oauth2-redirect.html

                swagger-ui/package.json

                swagger-ui/README.md

                swagger-ui/swagger-ui-bundle.js

                swagger-ui/swagger-ui-bundle.js.map

                swagger-ui/swagger-ui-standalone-preset.js

                swagger-ui/swagger-ui-standalone-preset.js.map

                swagger-ui/swagger-ui.css

                swagger-ui/swagger-ui.css.map

                swagger-ui/swagger-ui.js

                swagger-ui/swagger-ui.js.map

                WEB-INF/beans.xml

                WEB-INF/classes/<some-java-classes>

                WEB-INF/classes/infinispan-cloud.xml

                WEB-INF/classes/infinispan-local.xml

                WEB-INF/classes/META-INF/persistence.xml

                WEB-INF/ejb-jar.xml

                WEB-INF/jboss-deployment-structure.xml

                WEB-INF/jboss-web.xml

                WEB-INF/lib/<lots-of-jars-including-the-one-containing-the-mdb>

                WEB-INF/web.xml

                META-INF/maven/com.ordami.geo/geo-server/pom.xml

                META-INF/maven/com.ordami.geo/geo-server/pom.properties

                 

                Again, I tried ejb-jar.xml with valid and invalid content - both deploy fine and none of them works.

                • 5. Re: Wildfly 11 ignores ejb-jar.xml
                  jaikiran

                  With the latest listing you posted, I don't see any obvious reason why that ejb-jar.xml isn't being picked up. Can you attach the application that reproduces this issue?

                  • 6. Re: Wildfly 11 ignores ejb-jar.xml
                    mobe

                    I noticed that this only happens when I deploy an exploded WAR from my IDE (IntelliJ). When I put the packaged .war into Wildfly deployments directory, everything works.

                    I inspected the contents of the exploded WAR directory and the layout is fine, i.e. I have WEB-INF/ejb-jar.xml in there. So why is it not picked up by the deployment in this case?

                    • 7. Re: Wildfly 11 ignores ejb-jar.xml
                      mobe

                      jaikiran is this a bug or is this wanted behavior?

                      • 8. Re: Wildfly 11 ignores ejb-jar.xml
                        jaikiran

                        If it's working fine without the IDE in picture, then it isn't a bug (at least not in WildFly). I don't really use IDEs for deploying applications, so I won't be able to help you much on that front to narrow down why it's behaving the way it is. Maybe someone familiar with IntelliJ's integration with WildFly maybe able to help you in solving the IDE part of this.

                        • 9. Re: Wildfly 11 ignores ejb-jar.xml
                          mobe

                          In case anybody else stumbles over this, I have created a issue for Intellij IDEA under https://youtrack.jetbrains.com/issue/IDEA-192275 .