6 Replies Latest reply on Jun 21, 2010 8:41 AM by Thorbjørn Andersen

    Weld: ForwardingAnnotated throws NPE when restoring session.

    Thorbjørn Andersen Newbie
      I am migrating a web application to JEE 6 Web Profile to use Weld.  Recently my sessions started not surviving container restarts and now I looked into it and it appears that Weld throws a NPE.  I cannot be sure, but the introduction of beans.xml could well coincide with this.  We don't use Weld yet as such.

      This is with the Weld coming with Glassfish 3.0.

      Any suggestions how I can workaround this?

      Thanks,

      /Thorbjoern



      WARNING: WEB0517: Unable to restore sessions for web module [/XX] from previous deployment
      java.lang.NullPointerException
           at org.jboss.weld.introspector.ForwardingAnnotated.isAnnotationPresent(ForwardingAnnotated.java:50)
           at org.jboss.weld.injection.FieldInjectionPoint.<init>(FieldInjectionPoint.java:62)
           at org.jboss.weld.injection.FieldInjectionPoint.of(FieldInjectionPoint.java:55)
           at org.jboss.weld.injection.FieldInjectionPoint$SerializationProxy.readResolve(FieldInjectionPoint.java:169)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
           at java.util.ArrayList.readObject(ArrayList.java:593)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
           at org.apache.catalina.session.StandardSession.readRemainingObject(StandardSession.java:1818)
           at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1750)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
           at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
           at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
           at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
           at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
           at org.apache.catalina.session.StandardSession.deserialize(StandardSession.java:1063)
           at org.apache.catalina.session.StandardManager.readSessions(StandardManager.java:511)
           at com.sun.enterprise.web.WebModule.loadSessions(WebModule.java:1557)
           at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1935)
           at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605)
           at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
           at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
           at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
           at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
           at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
           at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
           at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
           at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
           at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
           at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
           at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
           at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
           at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
           at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
           at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
           at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
           at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
           at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
           at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
           at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
           at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
           at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
           at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
           at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
           at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
           at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
           at java.lang.Thread.run(Thread.java:619)