5 Replies Latest reply on Sep 4, 2002 8:37 AM by Adrian Brock

    NullPointerException when deploying EAR

    Kristoffer Larsson Newbie

      I am trying to deploy an EAR file in JBoss 3.0, without success. I get these messages:

      15:42:45,311 ERROR [EARDeployer] Error in init step of ear deployment
      java.lang.NullPointerException

      [...]

      15:42:45,331 WARN [NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
      15:42:45,331 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@6cbf75de{ url=file:/D:/JBoss-3.0/server/default/deploy/Trapp.ear, deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: exception in init of file:/D:/JBoss-3.0/server/default/deploy/Trapp.ear; - nested throwable: (org.jboss.deployment.DeploymentException: Error in accessing application metadata: ; - nested throwable:
      (java.lang.NullPointerException))


      Now, my EAR file consists of one WAR file and two JAR files, as well as an application.xml file and a Manifest.MF file, both the inte META-INF directory of the EAR file.

      If I deploy the WAR file and the JAR files seperately, they get deployed okay, but deployment of the EAR file does not work, I get this exception ...

      Any help appreciated!

        • 1. Re: NullPointerException when deploying EAR
          Adrian Brock Master

          Post your application.xml

          Do you have a stack trace?

          Regards,
          Adrian

          • 2. Re: NullPointerException when deploying EAR
            Kristoffer Larsson Newbie

            Hm. I solved that problem, but now I have another problem that you perhaps also can solve? :)

            Here is my application.xml:

            <?xml version="1.0" encoding="UTF-8"?>


            <display-name>Trapp</display-name>



            <web-uri>Trapp.war</web-uri>
            <context-root>/trapp</context-root>




            Trapp-EJB.jar




            Now I get an exception telling me the following:

            16:54:33,937 INFO [MainDeployer] Starting deployment of package: file:/D:/JBoss
            -3.0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-cont
            ents/Trapp-EJB.jar
            16:54:34,688 INFO [EjbModule] Creating
            16:54:34,738 INFO [EjbModule] Deploying Dag
            16:54:35,008 INFO [EjbModule] Deploying Attestperiod
            16:54:35,038 INFO [EjbModule] Deploying Arbetspass
            16:54:35,058 INFO [EjbModule] Deploying Arbete
            16:54:35,098 INFO [EjbModule] Deploying Arbetad_Dag
            16:54:35,138 INFO [EjbModule] Deploying Person
            16:54:35,179 INFO [EjbModule] Deploying Kod
            16:54:35,199 INFO [EjbModule] Deploying Attest
            16:54:35,229 INFO [EjbModule] Deploying Projekt
            16:54:35,259 INFO [EjbModule] Deploying Aktivitet
            16:54:35,279 INFO [EjbModule] Deploying Aktivitetstyp
            16:54:35,329 INFO [EjbModule] Deploying Projektbehorighet
            16:54:35,719 INFO [EjbModule] Deploying Kund
            16:54:35,739 INFO [EjbModule] Deploying Tidredovisning
            16:54:36,951 INFO [EjbModule] Created
            16:54:36,951 INFO [EjbModule] Starting
            16:54:37,943 INFO [EjbModule] Started
            16:54:37,943 INFO [MainDeployer] Deployed package: file:/D:/JBoss-3.0/server/de
            fault/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-contents/Trapp-EJB
            .jar
            16:54:38,203 INFO [EjbModule] Registration is not done -> destroy
            16:54:38,223 ERROR [MainDeployer] could not create deployment: file:/D:/JBoss-3.
            0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-content
            s/Trapp-EJB.jar
            org.jboss.deployment.DeploymentException: error in create of EjbModule: file:/D:
            /JBoss-3.0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ea
            r-contents/Trapp-EJB.jar; - nested throwable: (javax.management.InstanceAlreadyE
            xistsException: jboss.j2ee:service=EjbModule,url=file%/D%/JBoss-3.0/server/defau
            lt/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.ja
            r already registered.)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:383)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:740)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:734)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:614)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:581)
            at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
            at $Proxy4.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:412)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
            ploymentScanner.java:607)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:480)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:202)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:191)
            Caused by: javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=E
            jbModule,url=file%/D%/JBoss-3.0/server/default/tmp/deploy/server/default/deploy/
            Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.jar already registered.
            at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistr
            y.java:657)
            at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMB
            eanRegistry.java:240)
            at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.jav
            a:949)
            at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
            254)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:366)
            ... 16 more
            16:54:38,273 ERROR [MainDeployer] could not create deployment: file:/D:/JBoss-3.
            0/server/default/deploy/Trapp.ear
            org.jboss.deployment.DeploymentException: error in create of EjbModule: file:/D:
            /JBoss-3.0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ea
            r-contents/Trapp-EJB.jar; - nested throwable: (javax.management.InstanceAlreadyE
            xistsException: jboss.j2ee:service=EjbModule,url=file%/D%/JBoss-3.0/server/defau
            lt/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.ja
            r already registered.)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:383)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:740)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:734)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:614)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:581)
            at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
            at $Proxy4.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:412)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
            ploymentScanner.java:607)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:480)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:202)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:191)
            Caused by: javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=E
            jbModule,url=file%/D%/JBoss-3.0/server/default/tmp/deploy/server/default/deploy/
            Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.jar already registered.
            at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistr
            y.java:657)
            at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMB
            eanRegistry.java:240)
            at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.jav
            a:949)
            at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
            254)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:366)
            ... 16 more
            16:54:38,333 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
            .scanner.URLDeploymentScanner$DeployedURL@6cbf75de{ url=file:/D:/JBoss-3.0/serve
            r/default/deploy/Trapp.ear, deployedLastModified=0 }
            org.jboss.deployment.DeploymentException: error in create of EjbModule: file:/D:
            /JBoss-3.0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ea
            r-contents/Trapp-EJB.jar; - nested throwable: (javax.management.InstanceAlreadyE
            xistsException: jboss.j2ee:service=EjbModule,url=file%/D%/JBoss-3.0/server/defau
            lt/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.ja
            r already registered.)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:383)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:740)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:734)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:614)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:581)
            at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
            nDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
            at $Proxy4.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
            tScanner.java:412)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
            ploymentScanner.java:607)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
            canner.java:480)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:202)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:191)
            Caused by: javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=E
            jbModule,url=file%/D%/JBoss-3.0/server/default/tmp/deploy/server/default/deploy/
            Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.jar already registered.
            at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistr
            y.java:657)
            at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMB
            eanRegistry.java:240)
            at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.jav
            a:949)
            at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
            254)
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:366)
            ... 16 more
            16:54:43,470 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
            Packages waiting for a deployer:

            Incompletely deployed packages:
            [org.jboss.deployment.DeploymentInfo@6cbf75de { url=file:/D:/JBoss-3.0/server/de
            fault/deploy/Trapp.ear }
            deployer: org.jboss.deployment.EARDeployer@878144
            status: Deployment FAILED reason: error in create of EjbModule: file:/D:/JBoss
            -3.0/server/default/tmp/deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-cont
            ents/Trapp-EJB.jar; - nested throwable: (javax.management.InstanceAlreadyExistsE
            xception: jboss.j2ee:service=EjbModule,url=file%/D%/JBoss-3.0/server/default/tmp
            /deploy/server/default/deploy/Trapp.ear/78.Trapp.ear-contents/Trapp-EJB.jar alre
            ady registered.)
            watch: file:/D:/JBoss-3.0/server/default/deploy/Trapp.ear
            lastDeployed: 1031064877953
            lastModified: 1031064873426
            mbeans:
            ]MBeans waiting for classes:

            MBeans waiting for other MBeans:

            • 3. Re: NullPointerException when deploying EAR
              Adrian Brock Master

              Does stopping and restarting the server fix this?

              Perhaps you have found a bug due to your
              NullPointerException?

              If you can remember the steps to reproduce this,
              post a bug report on www.sf.net/projects/jboss

              What was the NullPointerException problem? Somebody
              else might hit the same problem in the future.

              Regards,
              Adrian

              • 4. Re: NullPointerException when deploying EAR
                Kristoffer Larsson Newbie

                The reason for the NullPointerException was I had renamed one of the JAR files and forgot to change the reference in application.xml, which, thus, pointed to a non-existing JAR file.

                As for the other problem, I did my homework and search these forums and found the answer. Seems like you cannot reference a JAR file both in application.xml AND in a Manifest.MF file, since JBoss is then trying to deploy the JAR file twice.

                • 5. Re: NullPointerException when deploying EAR
                  Adrian Brock Master

                  Was,

                  There is for a fix for this in JBoss 3.0.2

                  Regards,
                  Adrian