4 Replies Latest reply on Mar 3, 2014 3:14 PM by Steve Krall

    NullPointerException in org.jboss.weld.bootstrap.Validator

    Sergiy Barlabanov Newbie

      Hi,

      we are facing some strange problem, which occurs sporadically during the deployment of our Web application in Glassfish 3.1.2 with Weld 1.1.4.Final. Sometimes the deployment fails with NullPointerException coming from Weld (see below for the stack trace). No more explanations are logged. Only this exception. If we deploy the same application again. It succeeds. After several attempts it occurs again. So it occurs quite sporadically. We debugged the Weld code (it is Weld 1.1.4.Final, but with Weld 1.1.8.Final the problem is still there) and found out that injectionTarget argument in Validator.validateInjectionTarget is null. And it comes when Weld tries to process the EJBs contained in the deployment. If we patch the place in such a way, that the null is ignored, everything deploys and works fine without problems. So for me it seems a kind of concurrency issue when Weld tries to collect candidates for managed beans. Maybe it does some kind of parallel processing in this case and some null value comes into the list of injectionTargets sporadically? I do not know exactly how the list of injectionTargets used by InjectionTargetValidator is populated . Is this a bug? May be we are doing something wrong, but in this case I assume we would get some better exception message, wouldn't we?

       

      java.lang.NullPointerException

      at org.jboss.weld.bootstrap.Validator.validateInjectionTarget(Validator.java:311)

      at org.jboss.weld.manager.InjectionTargetValidator.validate(InjectionTargetValidator.java:37)

      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:367)

      at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:199)

      at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)

      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:313)

      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)

      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)

      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)

      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)

      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)

      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)

      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)

      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)

      at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)

      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)

      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)

      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)

      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)

      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

      at java.lang.Thread.run(Thread.java:722)