5 Replies Latest reply on Jan 18, 2011 2:55 AM by jaikiran pai

    Service POJO deployment throws NullPointerException

    Jboss fan99 Newbie

      I'm stuck with this problem... will appreciate if someone can help me out.

      I have a very simple test service POJO that I'm trying to deploy to JBoss AS 6 on Linux. But it's failing with below execption:

       

      java class and interface are attached. Thanks!

       

      14:42:21,599 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:ear=foliage.ear,jar=foliageEJB.jar,name=CoolSystemInitService,service=EJB3 state=Configured: java.lang.NullPointerException

              at org.jboss.weld.integration.instantiator.Jsr299BeanInstantiator.locateWeldManager(Jsr299BeanInstantiator.java:102) [:6.0.0.20101110-CR1]

              at org.jboss.weld.integration.instantiator.Jsr299BeanInstantiator.getWeldManager(Jsr299BeanInstantiator.java:93) [:6.0.0.20101110-CR1]

              at org.jboss.weld.integration.instantiator.Jsr299BeanInstantiator.create(Jsr299BeanInstantiator.java:72) [:6.0.0.20101110-CR1]

              at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:997) [:1.6.3]

              at org.jboss.ejb3.service.ServiceContainer.create(ServiceContainer.java:205) [:1.6.3]

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]

              at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]

              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.Alpha9]

              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.Alpha9]

        • 1. Service POJO deployment throws NullPointerException
          Nicklas Karlsson Master

          Strange, how is it deployed? Does it have a beans.xml present? I don't quite see how it is involving CDI for that...

          • 2. Service POJO deployment throws NullPointerException
            Nicklas Karlsson Master

            I put them in a WAR and deployed it and got

             

            22:50:02,927 INFO  [org.jboss.ejb3.deployers.JBossASKernel] Created KernelDeployment for: Bug.war

            22:50:02,932 INFO  [org.jboss.ejb3.deployers.JBossASKernel] installing bean: jboss.j2ee:jar=Bug.war,name=CoolSystemInitService,service=EJB3

            22:50:02,932 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   with dependencies:

            22:50:02,932 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and demands:

            22:50:02,932 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss.ejb:service=EJBTimerService; Required: Described

            22:50:02,933 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss-switchboard:appName=Bug,module=Bug; Required: Create

            22:50:02,933 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and supplies:

            22:50:02,933 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jndi:CoolSystemInitService

            22:50:02,933 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           Class:fi.nik.bug.ICoolSystemInit

            22:50:02,939 INFO  [org.jboss.ejb3.deployers.JBossASKernel] Added bean(jboss.j2ee:jar=Bug.war,name=CoolSystemInitService,service=EJB3) to KernelDeployment of: Bug.war

            22:50:03,101 INFO  [org.jboss.ejb3.deployers.JBossASKernel] installing bean: jboss:service=ICoolSystemInit

            22:50:03,101 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   with dependencies:

            22:50:03,101 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and demands:

            22:50:03,101 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss.ejb:service=EJBTimerService; Required: Described

            22:50:03,101 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss.j2ee:jar=Bug.war,name=CoolSystemInitService,service=EJB3; Required: Described

            22:50:03,102 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss-switchboard:appName=Bug,module=Bug; Required: Create

            22:50:03,102 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and supplies:

            22:50:03,102 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jndi:CoolSystemInitService

            22:50:03,103 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           Class:fi.nik.bug.ICoolSystemInit

            22:50:03,103 INFO  [org.jboss.ejb3.deployers.JBossASKernel] Installing bean(jboss:service=ICoolSystemInit) into kernel

            22:50:03,115 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/Bug

            22:50:03,181 INFO  [STDOUT] CurrencyConverterMBean - Creating

             

             

            22:50:03,185 INFO  [org.jboss.ejb3.EJBContainer] STARTED EJB: fi.nik.bug.CoolSystemInitService ejbName: CoolSystemInitService

            • 3. Service POJO deployment throws NullPointerException
              Jboss fan99 Newbie

              Thanks for looking into it.

              I have an ear application and these classes are part of the EJB jar file. I just want a class that's invoked during server(jboss) startup, so I have these classes part of the EJB. I also have war file in the ear but the classes are not part of it.

              • 4. Service POJO deployment throws NullPointerException
                Nicklas Karlsson Master

                Could you post the EAR with the other classes stripped out? Leave the structure and XML files, though.

                 

                Another option could be a @Singleton @Startup?

                • 5. Service POJO deployment throws NullPointerException
                  jaikiran pai Master

                  By the way, a NullPointerException is always a bad sign. Please create a JIRA here https://jira.jboss.org/browse/JBAS with the details. If possible, please attach a sample application, to that JIRA, which reproduces this issue.