NullPointerException while invocation of the @PostConstruct lifecycle method in WLS 12.1.2 (Doc ID 2108941.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle WebLogic Server - Version 12.1.2.0.0 to 12.1.3.0.0 [Release 12c]
Information in this document applies to any platform.
This issue is seen in Weblogic Server 12.1.2.0.6 & 12.1.3.0.4.

Symptoms

Getting below error during resource injection of entity manager in a singleton EJB during @PostConstruct life-cycle callback with application managed persistence context and transaction.
SEVERE: emf injection failed under weblogic
java.lang.NullPointerException
  at db.setup.CreateDatabase.startTestcase(CreateDatabase.java:39)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at com.oracle.pitchfork.inject.Jsr250Metadata.invokeLifecycleMethod(Jsr250Metadata.java:396)
  at com.oracle.pitchfork.inject.Jsr250Metadata.invokeLifecycleMethods(Jsr250Metadata.java:368)
  at com.oracle.pitchfork.intercept.InterceptionMetadata.invokeLifecycleMethods(InterceptionMetadata.java:403)
  at com.oracle.pitchfork.intercept.LifecycleEventCallbackInvocationContext.proceed(LifecycleEventCallbackInvocationContext.java:126)
  at com.oracle.pitchfork.intercept.LifecycleEventCallbackInvocationContext.proceed(LifecycleEventCallbackInvocationContext.java:150)
  at com.oracle.pitchfork.intercept.InterceptionMetadata.invokeLifecycleMethods(InterceptionMetadata.java:476)
  at weblogic.ejb.container.injection.EjbComponentCreatorImpl.invokePostConstruct(EjbComponentCreatorImpl.java:80)
  at weblogic.ejb.container.injection.InjectionBasedEjbComponentCreator.invokePostConstruct(InjectionBasedEjbComponentCreator.java:154)
  at weblogic.ejb.container.manager.SingletonSessionManager.constructAndInitBean(SingletonSessionManager.java:382)
  at weblogic.ejb.container.manager.SingletonSessionManager.access$300(SingletonSessionManager.java:67)
  at weblogic.ejb.container.manager.SingletonSessionManager$SingletonLifecycleManager.doActualInit(SingletonSessionManager.java:812)
  at weblogic.ejb.container.manager.SingletonSessionManager$SingletonLifecycleManager.initInternal(SingletonSessionManager.java:758)
  at weblogic.ejb.container.manager.SingletonSessionManager$SingletonLifecycleManager.init(SingletonSessionManager.java:645)
  at weblogic.ejb.container.manager.SingletonSessionManager.init(SingletonSessionManager.java:288)
  at weblogic.ejb.container.manager.SingletonSessionManager.perhapsInit(SingletonSessionManager.java:284)
  at weblogic.ejb.container.deployer.EJBDeployer.initializeBeans(EJBDeployer.java:1227)
  at weblogic.ejb.container.deployer.EJBDeployer.start(EJBDeployer.java:1124)
  at weblogic.ejb.container.deployer.EjbModuleExtension.start(EjbModuleExtension.java:168)
  at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:362)
  at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)
  at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
  at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)
  at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
  at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
  at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
  at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
  at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
  at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
  at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
  at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
  at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
  at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)
  at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
  at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
  at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:222)
  at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:414)
  at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
  at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
  at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
  at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
  at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
  at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
  at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:191)
  at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:99)
  at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
  at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:312)
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:264)>

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms