7 Replies Latest reply on Dec 11, 2008 3:52 PM by henk de boer

    JbossAS5 doesn't support multiple -service.xml files in ear/

    henk de boer Master

      I have an EAR application that runs fine on Jboss 4.2.x. This application has multiple xxx-service.xml files in the META-INF directory of the root of the EAR.

      When I try to run this application on Jboss 5 however, I get a bunch of error messages which apparently seem to say that I'm only allowed to have a single xxx-service.xml file:


      Caused by: java.lang.IllegalArgumentException: Multiple matching files not allowed: [FileHandler@19081722[path=myapp_operation_server.ear/META-INF/NSJMSdestinations-service.xml context=file:/opt/jboss-5.0.0.GA/server/default/deploy/ real=file:/opt/jboss-5.0.0.GA/server/default/deploy/myapp_operation_server.ear/META-INF/NSJMSdestinations-service.xml], FileHandler@26810410[path=myapp_operation_server.ear/META-INF/NSDependent-service.xml context=file:/opt/jboss-5.0.0.GA/server/default/deploy/ real=file:/opt/jboss-5.0.0.GA/server/default/deploy/myapp_operation_server.ear/META-INF/NSDependent-service.xml], FileHandler@105044[path=myapp_operation_server.ear/META-INF/quartz-service.xml context=file:/opt/jboss-5.0.0.GA/server/default/deploy/ real=file:/opt/jboss-5.0.0.GA/server/default/deploy/myapp_operation_server.ear/META-INF/quartz-service.xml]]
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.handleMultipleFiles(AbstractVFSParsingDeployer.java:324)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:241)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:330)
       ... 22 more
      
      


      Is it really true that I can only have 1 file now, or am I doing something else wrong?

        • 1. Re: JbossAS5 doesn't support multiple -service.xml files in
          jaikiran pai Master

          Please post the entire exception stacktrace. Also do you have a META-INF/jboss-app.xml in your EAR which lists down the service modules? If not, try moving the *-service.xml from the META-INF folder to the root of the EAR and add a jboss-app.xml with the following contents:

          <jboss-app>
           <module>
           <service>myserviceone-service.xml</service>
           </module>
          
          
           <module>
           <service>myservicetwo-service.xml</service>
           </module>
          </jboss-app>


          • 2. Re: JbossAS5 doesn't support multiple -service.xml files in
            superDev superDev Newbie

            I have the same problem, thanks a lot for Jaikiran's reply! I moved *-service.xml from the META-INF folder to the root of the EAR and it worked! But when these *-service.xml files are under META-INF folder, I'll get the following errors:

            15:15:42,797 ERROR [AbstractKernelController] Error installing to Parse: name=vfsfile:/opt/jboss-5.0.0.GA/server/default/deploy/my_server.ear/ state=Not Installed mode=Manual requiredState=Parse
            org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/opt/jboss-5.0.0.GA/server/default/deploy/my_server.ear/
             at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
             at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:337)
             at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:297)
             at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:269)
             at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:230)
             at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
             at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
             at org.jboss.Main.boot(Main.java:209)
             at org.jboss.Main$1.run(Main.java:547)
             at java.lang.Thread.run(Thread.java:636)
            Caused by: java.lang.IllegalArgumentException: Multiple matching files not allowed: [FileHandler@25471566[path=my_server.ear/META-INF/JMSdestinations-service.xml context=file:/opt/jboss-5.0.0.GA/server/default/deploy/ real=file:/opt/jboss-5.0.0.GA/server/default/deploy/my_server.ear/META-INF/JMSdestinations-service.xml], FileHandler@13176484[path=my_server.ear/META-INF/quartz-service.xml context=file:/opt/jboss-5.0.0.GA/server/default/deploy/ real=file:/opt/jboss-5.0.0.GA/server/default/deploy/my_server.ear/META-INF/quartz-service.xml]]
             at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.handleMultipleFiles(AbstractVFSParsingDeployer.java:324)
             at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:241)
             at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:330)
             ... 22 more


            So can I say that in JBoss 5 GA we should put *-service.xml files under EAR root but NOT under other locations?

            • 3. Re: JbossAS5 doesn't support multiple -service.xml files in
              jaikiran pai Master

               

              "sunnyDev" wrote:

              So can I say that in JBoss 5 GA we should put *-service.xml files under EAR root but NOT under other locations?


              Ideally, you should be able to place your files anywhere you want to in the EAR. Its a different question whether they will be picked up or not :) But right now, it looks like the deployment framework does not like the -service.xml files to be placed under the META-INF folder. Not sure whether this restriction is intended.



              • 4. Re: JbossAS5 doesn't support multiple -service.xml files in
                Emanuel Muckenhuber Master

                Can you try to edit - server/.../conf/bootstrap/deployers.xml
                And add a attribute to the SarDeployer:

                 <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer">
                 <property name="allowMultipleFiles">true</property>
                 </bean>
                


                • 5. Re: JbossAS5 doesn't support multiple -service.xml files in
                  arjan tijms Novice

                   

                  "emuckenhuber" wrote:
                  Can you try to edit - server/.../conf/bootstrap/deployers.xml
                  And add a attribute to the SarDeployer:

                   <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer">
                   <property name="allowMultipleFiles">true</property>
                   </bean>
                  


                  I was hit by the same problem too. The above solution (haven't tried it yet though) would be a little less attractive for me, as I'd like to hand over people an .ear file that they can run directly on a stock Jboss. Having them to alter their config is sometimes troublesome.

                  Any chance that, if this indeed works, it can become the default in Jboss? Are there any disadvantages by setting allowMultipleFiles to true by default?

                  • 6. Re: JbossAS5 doesn't support multiple -service.xml files in
                    Ales Justin Master

                     

                    "atijms" wrote:

                    Any chance that, if this indeed works, it can become the default in Jboss? Are there any disadvantages by setting allowMultipleFiles to true by default?

                    This should work.
                    We probably just forgot to set it to true.

                    I'll write some tests and change it to true by default.

                    • 7. Re: JbossAS5 doesn't support multiple -service.xml files in
                      henk de boer Master

                       

                      "alesj" wrote:
                      "atijms" wrote:

                      I'll write some tests and change it to true by default.


                      Thanks a lot everyone for all your help and proposals for a solution! :)