5 Replies Latest reply on Feb 13, 2013 2:29 PM by tholewebgods

    Deployment fails when specifying --name=xyz (JBoss CLI deploy)

    tholewebgods

      Hello.

       

      I'm trying to deploy my Application using the JBoss CLI deploy command with --name switch.

      Without specifying --name, the deployment works perfectly. With specifying any name (only [a-z]) it will fail with vague error message.

       

      11:17:51,754 INFO  [org.jboss.as.server] (management-handler-thread - 12) JBAS015870: Deploy of deployment "xyz" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.xxx.POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.xxx.POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"xyz\"

          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: xxx.xxx.xxx.xxx.xxx.SomeOtherClass from [Module \"deployment.xxx:main\" from Service Module Loader]

          Caused by: java.lang.ClassNotFoundException: xxx.xxx.xxx.xxx.xxx.SomeOtherClass from [Module \"deployment.xxx:main\" from Service Module Loader]"}}

      11:17:51,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment xxx in 4ms

      11:17:58,298 INFO  [org.jboss.as.repository] (management-handler-thread - 9) JBAS014901: Content removed from location /home/jboss/EAP-6.0.1/jboss-eap-6.0/standalone/data/content/77/4b820957b57e3f758a38dd8ff7a9e6a4505187/content

      11:18:20,942 INFO  [org.jboss.as.repository] (management-handler-thread - 11) JBAS014900: Content added at location /home/jboss/EAP-6.0.1/jboss-eap-6.0/standalone/data/content/77/4b820957b57e3f758a38dd8ff7a9e6a4505187/content

       

      When compared to deployment without --name, where JBoss tries to read the persistence.xml successfully it seems to stop there, when using --name.

       

      This works well, when omitting --name:

       

      11:49:39,377 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for xyzPU

      11:49:39,560 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment xxx-0.5-SNAPSHOT.war

      11:49:39,571 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named SomeClass in deployment unit deployment "xxx-0.5-SNAPSHOT.war" are as follows:

      ...

      11:49:39,571 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named SomeOtherClass in deployment unit deployment "xxx-0.5-SNAPSHOT.war" are as follows:

      ...

       

      As we can see, the Read persistence.xml is missing in the first log, so we can assume it doesn't get this far. So does it have to do with the persistence.xml?

       

       

      Environment:

      • x86-64
      • RedHat 6
      • EAP 6.0.1 / JBoss 7.1.3 (evaluation package)
      • Oracle 1.7 JDK
      • standalone-full profile

       

       

      Please help me.

        • 1. Re: Deployment fails when specifying --name=xyz (JBoss CLI deploy)
          jaikiran

          Is that the entire exception stacktrace? There should be more (perhaps in server.log). Also, please attach a sample application which reproduces this.

          • 2. Re: Deployment fails when specifying --name=xyz (JBoss CLI deploy)
            tholewebgods

            Thank you for your quick response.

             

            Yes it is the entire exception stack trace. It shows the output when running JBoss foregrounded through standalone.sh and is the same as in server.log.

             

            I'll try an basic project using a Maven arche type and if it fails too, I'll submit that.

            • 3. Re: Deployment fails when specifying --name=xyz (JBoss CLI deploy)
              tholewebgods

              I'm astounded.

               

              I've created a sample WAR application using a Maven archetype. It has the same issues.

               

              $ mvn archetype:generate -DarchetypeArtifactId=jboss-javaee6-webapp-archetype -DarchetypeGroupId=org.jboss.spec.archetypes  -DarchetypeVersion=7.1.2.Final

               

               

              Archetype generated Maven project attached as jboss-example-war_jobss_community_thread_221251.zip.

               

              The output:

               

               

              15:25:08,787 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "test"

              15:25:08,797 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit.test.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit.test.POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "test"

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]

                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

                      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

              Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: net.noorg.service.MemberRegistration from [Module "deployment.test:main" from Service Module Loader]

                      at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:228)

                      at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:98)

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

                      ... 5 more

              Caused by: java.lang.ClassNotFoundException: net.noorg.service.MemberRegistration from [Module "deployment.test:main" from Service Module Loader]

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                      at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getEjbClass(BusinessViewAnnotationProcessor.java:226)

                      ... 7 more

               

              15:25:08,800 INFO  [org.jboss.as.server] (management-handler-thread - 30) JBAS015870: Deploy of deployment "test" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.test.POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.test.POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"test\"

                  Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: net.noorg.service.MemberRegistration from [Module \"deployment.test:main\" from Service Module Loader]

                  Caused by: java.lang.ClassNotFoundException: net.noorg.service.MemberRegistration from [Module \"deployment.test:main\" from Service Module Loader]"}}

              15:25:08,804 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment test in 4ms

               

               

               

              The same error occurs with the original, out-of-box standalone-full.xml.

               

               

              Edit:

              Deploying, for example, the MySQL connector using the --name works perfect.

              So, I assume it has to do with WAR files in general.

               

              $ jboss-example-war_jobss_community_thread_221251.zip

               

              This works quiet fine.

               

               

              Geetings.

              • 4. Re: Deployment fails when specifying --name=xyz (JBoss CLI deploy)
                brian.stansberry

                My guess is that the name you are choosing does not include a file extension (.war, .jar etc). Many of the AS's deployment unit processors use that extension to determine whether they need to deal with the deployment, so without it things you expect to happen won't happen.

                 

                The CLI deploy command includes a couple params related to naming:

                 

                --name          the unique name of the deployment. If the file path

                                     argument is specified the name argument is optional with

                                     the file name been the default value. If the file path

                                     argument isn't specified then the command is supposed to

                                     enable an already existing but disabled deployment, and in

                                     this case the name argument is required.

                 

                 

                --runtime-name    optional, the runtime name for the deployment.

                 

                 

                Inside the server, the deployment unit processors use the runtime-name. If the user doesn't provide one (normally they don't), we'll internally set it to the value of "name".

                 

                If for some reason you don't want to include the extension in your --name value (e.g. you plan to have several versions of the app available on the server with only one enabled, so name is "xyz_V1", "xyz_V2" etc), then do this:

                 

                deploy --name=xyx --runtime-name=xyz.war path/to/file

                • 5. Re: Deployment fails when specifying --name=xyz (JBoss CLI deploy)
                  tholewebgods

                  Brian you're great. Using --name=name.war did the trick. I left --runtime-name away.

                   

                  I should note, that deploying the MySQL connector with --name specified worked well without an extension. But that might be related to its different module/driver nature.

                   

                  I can live with that. The only reason I wanted to set the name was, to get rid of the version number within the package to allow my deploment scripts to undeploy a general name before deploying.

                   

                  Using --force would only be a workaround for me.