6 Replies Latest reply on Mar 22, 2010 8:54 AM by Adesegun Adeyemo

    PersistenceContext EXTENDED throws NullPointerException

    Uros Majeric Newbie

      Hi,
      A have a simple component:


      import java.io.Serializable;
      import si.irose.itrack.entity.Keg;
      
      import javax.enterprise.context.SessionScoped;
      import javax.inject.Named;
      import javax.persistence.*;
      
      @Named
      @SessionScoped
      public class KegTest implements Serializable {
          @PersistenceContext(type=PersistenceContextType.EXTENDED)
          EntityManager entityManager;
      
          public KegTest() {
          }
          
          public Keg getKeg() {
              return entityManager.find(Keg.class, 80l);
          }
      }
      



      whenever I call


      #{kegTest.keg}



      I get the exception:



      java.lang.NullPointerException
              at com.sun.enterprise.container.common.impl.EntityManagerWrapper.find(EntityManagerWrapper.java:309)
              at si.irose.itrack.jsf.KegTest.getKeg(KegTest.java:20)
              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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
              at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
              at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
              at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
              at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
              at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
              at si.irose.itrack.jsf.KegTest_$$_javassist_89.getInit(KegTest_$$_javassist_89.java)
              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 javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
              at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
              at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
              at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
              at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
              at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:71)
              at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:217)
              at com.sun.faces.facelets.el.ELText$ELTextComposite.writeText(ELText.java:141)
              at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:78)
              at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:75)
              at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:176)
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
              at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
              at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
              at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
              at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
              at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
              at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
              at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
              at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
              at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
              at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
              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)



      I am using hibernate 3.5.0-CR-2 with Glassfish V3 (glassfish-v3u1-web-b08-03092010).


      any idea?

        • 1. Re: PersistenceContext EXTENDED throws NullPointerException
          Uros Majeric Newbie

          I forgot to mentioned if I use


          @PersistenceContext



          without


          type=EXTENDED



          , then it works, but I get LazyLoading Exception.


          thanks for help

          • 2. Re: PersistenceContext EXTENDED throws NullPointerException
            Nicklas Karlsson Master

            Have you tried the @Produces/@Inject that's recommended in the spec/refdoc?

            • 3. Re: PersistenceContext EXTENDED throws NullPointerException
              Uros Majeric Newbie

              Did you mean to try with this solution:



              @Qualifier
              @Retention(RUNTIME)
              @Target({METHOD, PARAMETER, FIELD})
              public @interface CustomerDatabase {
              
              }



              public class UserDatabaseProducer implements Serializable {
                  @Produces @CustomerDatabase @PersistenceContext(type=PersistenceContextType.EXTENDED)
                  public EntityManager userDatabase;
              }




              @Inject @CustomerDatabase EntityManager entityManager;



              I tried this. The error is the same.

              • 4. Re: PersistenceContext EXTENDED throws NullPointerException
                Nicklas Karlsson Master

                Can you test it on a JBoss AS 6.0 M2?


                Trying to narrow down if it's a GF integration thing. I recall seeing passing TCK tests for that case in JBoss...

                • 5. Re: PersistenceContext EXTENDED throws NullPointerException
                  Uros Majeric Newbie

                  I tried to test it on JBoss AS 6.0 M2, but I keep getting an error:


                  ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#itrackMonitor state=Create: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider
                       at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:46)
                       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:316)
                       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 org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:151)
                       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257)
                       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
                       at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202)
                       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:873)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:620)
                       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180)
                       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1660)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1378)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1399)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1319)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:918)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:633)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:898)
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:677)
                       at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                       at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
                       at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:873)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:620)
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:259)
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:100)
                       at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:860)
                       at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:441)
                       at java.lang.Thread.run(Thread.java:619)



                  So I took the example that comes with Weld 1.0.1-Final - weld-login and changed it. I only added a persistence.xml file, in pom.xml I added dependencies for hibernate:



                  <dependency>
                              <groupId>org.hibernate</groupId>
                              <artifactId>hibernate-core</artifactId>
                              <version>3.5.0-CR-2</version>
                          </dependency>
                          <dependency>
                              <groupId>org.hibernate</groupId>
                              <artifactId>hibernate-entitymanager</artifactId>
                              <version>3.5.0-CR-2</version>
                          </dependency>
                          <dependency>
                              <groupId>org.hibernate</groupId>
                              <artifactId>hibernate-annotations</artifactId>
                              <version>3.5.0-CR-2</version>
                          </dependency>





                  and added a class mentioned above (KegTest) and an entity:



                  import javax.persistence.*;
                  
                  /**
                   * Represents an beer keg
                   * 
                   * @author umajeric
                   * 
                   */
                  @Entity
                  @Table(name = "keg")
                  public class Keg implements java.io.Serializable {
                  
                      private Long id;
                      private String serial;
                  
                      public Keg() {
                      }
                  
                      @Id
                      @GeneratedValue
                      @Column(name = "id")
                      public Long getId() {
                          return id;
                      }
                  
                      public void setId(Long id) {
                          this.id = id;
                      }
                  
                      @Column(name = "serial", length = 20)
                      public String getSerial() {
                          return serial;
                      }
                  
                      public void setSerial(String serial) {
                          this.serial = serial;
                      }
                  
                      @Override
                      public String toString() {
                          return "Keg(id=" + id + ")";
                      }
                  }
                  



                  I tested on latest glassfish (glassfish-v3u1-web-b09-03172010), and the error is still here.



                  I also noticed that if war package was unziped (as directory) that I get this error (probably bug in JBoss 6):



                  ERROR [org.apache.catalina.core.StandardContext] Error starting static Resources: java.lang.IllegalArgumentException: Document base /home/apl/jboss6M2/server/jbossweb-standalone/deploy/weld-login/WEB-INF/web.xml does not exist or is not a readable directory
                       at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:148)
                       at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4088)
                       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4256)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:315)
                       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
                       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:462)
                       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:116)
                       at org.jboss.web.deployers.WebModule.start(WebModule.java:95)
                       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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
                       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
                       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                       at $Proxy41.start(Unknown Source)
                       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53)
                       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41)
                       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:918)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:633)
                       at org.jboss.system.ServiceController.doChange(ServiceController.java:671)
                       at org.jboss.system.ServiceController.start(ServiceController.java:443)
                       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:189)
                       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:102)
                       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:49)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1660)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1378)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1399)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1319)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:378)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2029)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1050)
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1289)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1213)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1107)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:918)
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:633)
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:898)
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:677)
                       at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409)
                       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294)
                       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                       at java.lang.Thread.run(Thread.java:619)



                  • 6. Re: PersistenceContext EXTENDED throws NullPointerException
                    Adesegun Adeyemo Newbie

                    Hi Uros,


                    You can't use Extended Persistent Context without Stateful Session Bean. It was design for SFSB not even SLSB or POJO. Put @Stateful on your class, it will work as expected.


                    Extended Persistent Context is not available for POJOs. If you need any further explanation, let me know.