5 Replies Latest reply on Apr 17, 2003 9:17 AM by Stephane Nicoll

    EAR + -service.xml ???

    Stephane Nicoll Master

      I have two JAR files containing EJBs. One of the JAR file is used by the other so I decided to create an EAR file to group them.

      My problem is that each JAR needs to declare a custom DS. I have created a app1-service.xml and a app2-service.xml files that declares the DS.

      I tried to put them in the ear file, it's not setup (deployment failed because app1DS is not bound

      I tried to put each of them in they respective META-INF directory in the jars but does not work.

      Can somebody explain me how I can declare -service.xml files within an ear file?


        • 1. Re: EAR + -service.xml ???
          Adrian Brock Master

          Add a jboss-app.xml alongside application.xml




          Then put app1-service.xml in the ear.


          • 2. Re: EAR + -service.xml ???
            Stephane Nicoll Master

            Thans a lot for the explanation. One more question: will JBoss manages the dependencies (I mean first deploy the DS and then deploy the EJB)

            Would'nt be better I declare my JAR in the jboss-app.xml file as well (using sar file but I don't know much about it so far)

            • 3. Re: EAR + -service.xml ???
              Stephane Nicoll Master

              I tried this but does not seem to work :'(

              here my jboss-app.xml:







              Here is my ear :

              jar tf myapp.ear

              Then I got this in the log :

              2003-04-17 11:28:44,768 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@95193f28{ url=file:/var/jboss/server/default/deploy/myapp.ear, deployedLastModified=0 }
              org.jboss.deployment.DeploymentException: Failed to find module file: jmsdebug-postgres-service.xml
              at org.jboss.deployment.EARDeployer.init(Unknown Source)
              at org.jboss.deployment.MainDeployer.init(Unknown Source)
              at org.jboss.deployment.MainDeployer.deploy(Unknown Source)
              at org.jboss.deployment.MainDeployer.deploy(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(Unknown Source)
              at org.jboss.mx.server.MBeanServerImpl.invoke(Unknown Source)
              at org.jboss.util.jmx.MBeanProxy.invoke(Unknown Source)
              at $Proxy3.deploy(Unknown Source)
              at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(Unknown Source)
              at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(Unknown Source)
              at org.jboss.deployment.scanner.URLDeploymentScanner.scan(Unknown Source)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Unknown Source)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(Unknown Source)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(Unknown Source)

              but jmsdebug-postgres-service.xml is in the ear ...

              • 4. Re: EAR + -service.xml ???
                Adrian Brock Master

                You are correct.

                The -service.xml only works with unpacked
                deployments for reasons I don't understand
                (probably an oversight).

                You will have to create a sar
                e.g. debug-jbossmq.sar with the following file
                inside (the name is important)


                This should be a copy debug-jbossmq-service.xml


                • 5. Re: EAR + -service.xml ???
                  Stephane Nicoll Master

                  Thanks a lot. I figured that out as well in the meantime.

                  For those who might have the same problem, here is the solution:

                  1/ Create a sar file with only the jboss-service.xml in META-INF (a SAR file is just a JAR file with .sar extension)
                  2/ Craete your jar file and put the sar file inside
                  3/ Create an EAR file with the application.xml describing your modules (i.e. jar)

                  I just tested it and it works quite well. I can provide ant task if necessary (just contact me)

                  Thanks a lot for your help