7 Replies Latest reply on Mar 11, 2012 1:57 PM by viggo.navarsete

    Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"

    viggo.navarsete

      I'm currently upgrading an application from JBoss 6.1.0.Final to JBoss 7.1.0.Final, and I get the following stacktrace:

       

      14:45:32,568 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named CertificateLoaderFactoryBean in deployment unit deployment "tix-5.1.5-SNAPSHOT.war" are as follows:

       

       

                java:global/tix-5.1.5-SNAPSHOT/CertificateLoaderFactoryBean!com.tracetracker.tix.config.CertificateLoaderFactoryBean

                java:app/tix-5.1.5-SNAPSHOT/CertificateLoaderFactoryBean!com.tracetracker.tix.config.CertificateLoaderFactoryBean

                java:module/CertificateLoaderFactoryBean!com.tracetracker.tix.config.CertificateLoaderFactoryBean

                java:global/tix-5.1.5-SNAPSHOT/CertificateLoaderFactoryBean

                java:app/tix-5.1.5-SNAPSHOT/CertificateLoaderFactoryBean

                java:module/CertificateLoaderFactoryBean

       

       

      14:45:33,015 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."tix-5.1.5-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."tix-5.1.5-SNAPSHOT.war".INSTALL: Failed to process phase INSTALL of deployment "tix-5.1.5-SNAPSHOT.war"

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

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

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

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: java.lang.IllegalArgumentException: Empty name segment is not allowed for env

                at org.jboss.msc.service.ServiceName.of(ServiceName.java:85) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceName.append(ServiceName.java:112) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.as.naming.deployment.ContextNames.buildServiceName(ContextNames.java:178)

                at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:190)

                at org.jboss.as.naming.deployment.ContextNames$BindInfo.<init>(ContextNames.java:181)

                at org.jboss.as.naming.deployment.ContextNames.bindInfoFor(ContextNames.java:136)

                at org.jboss.as.ee.component.LookupInjectionSource.getResourceValue(LookupInjectionSource.java:70)

                at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:227)

                at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:194)

                at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)

                at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:162)

                at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:155)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                ... 5 more

       

       

      14:45:33,397 INFO  [org.jboss.as.server] (management-handler-threads - 2) JBAS015870: Deploy of deployment "tix-5.1.5-SNAPSHOT.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"tix-5.1.5-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"tix-5.1.5-SNAPSHOT.war\".INSTALL: Failed to process phase INSTALL of deployment \"tix-5.1.5-SNAPSHOT.war\""}}

      14:45:33,817 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment tix-5.1.5-SNAPSHOT.war in 410ms

      14:45:33,821 INFO  [org.jboss.as.controller] (management-handler-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."tix-5.1.5-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."tix-5.1.5-SNAPSHOT.war".INSTALL: Failed to process phase INSTALL of deployment "tix-5.1.5-SNAPSHOT.war"

       

       

      How can I figure out what is wrong? Is it something about the last EJB that is printed, or something else? I can't find any indication where to start looking..

        • 1. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
          kabirkhan

          The error normally means that a configured value is null. Unfortunately I'm not familiar enough with the EJB stuff to know what that could be from the stacktrace posted

          • 2. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
            jaikiran

            Somewhere in your application you have a resource-ref or a ejb-ref whose lookup element (in deployment descriptor) or is being passed as empty string.

             

            Do you have any ejb-jar.xml or web.xml or even @Resource or @EJB annotations?

            • 3. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
              viggo.navarsete

              resource-ref: no

              ejb-ref: no

              ejb-jar.xml: no

              web.xml: yes

              @Resource: yes

              (injecting queues)


              @Resource( mappedName = TIX_IMPORT_QUEUE_NAME )

              Queue importQueue;



              @Resource( mappedName = TIX_IMPORT_ERROR_QUEUE_NAME )

              Queue importErrorQueue;

               

               


              @Resource( mappedName = "/ConnectionFactory" )

              ConnectionFactory factory;

               

               

              @EJB: yes, a few, but mostly @Inject. Perhaps change all into @Inject?

               

              Another question: Has the hornetq version changed since JBoss 6.1.0.Final, do I need to do any changes in this part?

              • 4. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
                viggo.navarsete

                I got further by defining the queues in standalone-full.xml, and I've also changed all @EJB to @Inject.

                 

                Now my problem is about

                Caused by: java.lang.NoClassDefFoundError: org/hornetq/api/jms/management/JMSQueueControl

                          at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_26]

                          at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_26]

                          at java.lang.Class.getDeclaredMethods(Class.java:1791) [rt.jar:1.6.0_26]

                          at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                          ... 10 more

                Caused by: java.lang.ClassNotFoundException: org.hornetq.api.jms.management.JMSQueueControl from [Module "deployment.tix-5.1.5-SNAPSHOT.war: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.performLoadClassChecked(ConcurrentClassLoader.java:423)

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

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

                          ... 15 more

                 

                 

                The org.hornetq.api.jms.management.JMSQueueControl is used from a @RequestScoped bean, used to stop/start and get size of queue. The missing class is part of hornetq-jms-2.2.11.Final.jar, which can be found in <jboss.home>/modules/org/hornetq/main/, and I haven't bundled it myself (which should be correct, right?). So, why is JBoss complaining about the class when it's bundled with JBoss?

                • 5. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
                  viggo.navarsete

                  jaikiran: I added hornetq-jms-2.2.11.jar to my WAR file, then I could get a bit further, but WHY did I have to add it?

                  • 6. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
                    kabirkhan

                    Viggo Navarsete wrote:

                     

                    jaikiran: I added hornetq-jms-2.2.11.jar to my WAR file, then I could get a bit further, but WHY did I have to add it?

                    That is wrong, you should not add the jar itself you should add a dependency. https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7 You can probably get away with Dependencies entry in META-INF/MANIFEST.MF

                    • 7. Re: Upgrading from JBoss 6.1.0.Final to 7.1.0.Final gives "Empty name segment is not allowed for env"
                      viggo.navarsete

                      I finally narrowed down my issue, and it was related to two things:

                      1. Wrong JNDI names for my queues, I didn't have java:/ as the start of the JNDI reference, e.g I had queues/myqueue instead of java:/queues/myqueue

                      2. I had to had to add org.hornetq to MANIFEST.MF in order to start playing with JMSQueueControl class from my code. I fixed this by doing this to the mave-war-plugin in pom.xml:




                      <plugin>




                      <groupId>org.apache.maven.plugins</groupId>




                      <artifactId>maven-war-plugin</artifactId>




                      <version>2.1.1</version>




                      <configuration>





                      <failOnMissingWebXml>false</failOnMissingWebXml>



                               <archive>



                                  <manifestEntries>







                      <Dependencies>org.hornetq</Dependencies>



                                  </manifestEntries>



                                </archive>











                      </configuration>



                      </plugin>

                       

                       

                      As Kabir says, I don't need the hornetq-jms dependency bundled with my WAR file, it should have provided scope!