at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

DAO -

@PersistenceContext(unitName = "member", name = "member")

private EntityManager entityManager;

Query query = entityManager.createNamedQuery("Member.findByNetworkid"); - It is throwing NPE at this line.

It could be the same problem as mentioned by WFLY-6485, which is resolved for WildFly 10.1.0.Final. If the problem still occurs in the WildFly nightly build, let us know, so we can work towards a fix for WildFly 11.0.0.

From your details though, you mentioned using @PersistenceContext, but WFLY-6485 is for a NPE that occurs with CDI injection. So, perhaps that isn't your issue.

Let us know if you can recreate with the latest WildFly nightly build and we will ask you to collect the server.log on the clustered node that experiences the NPE. You may also need to enable (org.jboss.as.jpa) TRACE logging on the failing machine, to give us additional information about the possible cause.

If you are using CDI injection to inject the EntityManager into your Java class, you could experience the WFLY-6485 problem. In your question, you mentioned using @PersistenceContext, which doesn't use CDI injection, so you are probably not experiencing the same bug. You might look at the server.log on the machine that experienced the failure, to see if it (NullPointerException) happened before your application is completely deployed. You will want to get a sense for how long after the start of the application server, that the NullPointerException occurs and whether the NullPointerException continues to occur repeatedly. That might give us a hint as to the nature of the cause.

Regarding your QE/PreProd environments, it sounds to me like you have a good reason to run your testing there, so you can determine the cause. You need to recreate the failure with our nightly build, so we can know if the problem has been fixed or not.

at com.gearbox.webservice.mvt.experiment.builder.ExperimentBeanTransformer.fecthFullNameOfUser(ExperimentBeanTransformer.java:570) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.builder.ExperimentBeanTransformer.convertAuditTrackToAuditTrackBean(ExperimentBeanTransformer.java:70) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.builder.ExperimentBeanTransformer.convertAuditTrackToAuditTrackBean(ExperimentBeanTransformer.java:51) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.builder.ExperimentBeanTransformer.convertExperimentEntityToExperimentBean(ExperimentBeanTransformer.java:254) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.builder.ExperimentBeanTransformer.convertExperimentEntityListToExperimentBeanList(ExperimentBeanTransformer.java:181) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.service.impl.ExperimentServiceImpl.findExperimentByRange(ExperimentServiceImpl.java:205) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.experiment.service.impl.ExperimentServiceImpl.findAll(ExperimentServiceImpl.java:145) [gearbox-webservice-mvt-experiment-3.3.39-SNAPSHOT.jar:]

at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)

at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_04]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_04]

at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_04]

at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.6.Final.jar:]

at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.6.Final.jar:]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at com.enterprise.common.context.RequestContextHolderFilter.doFilter(RequestContextHolderFilter.java:88) [commons-1.78-Wildfly.jar:]

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at com.gearbox.webservice.common.framework.AcceptMediaTypeParameterFilter.doFilter(AcceptMediaTypeParameterFilter.java:45) [gearbox-webservice-common-3.3.39-SNAPSHOT.jar:]

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at com.gearbox.webservice.common.framework.GearBoxRequestParamFilter.doFilter(GearBoxRequestParamFilter.java:64) [gearbox-webservice-common-3.3.39-SNAPSHOT.jar:]

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at com.enterprise.common.context.AtcOverrideServletRequestFilter.doFilter(AtcOverrideServletRequestFilter.java:70) [commons-1.78-Wildfly.jar:]

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at com.enterprise.common.telemetry.TelemetryFilter.doFilter(TelemetryFilter.java:109) [commons-1.78-Wildfly.jar:]

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.handlers.MetricsHandler.handleRequest(MetricsHandler.java:62) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.core.MetricsChainHandler.handleRequest(MetricsChainHandler.java:59) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172) [undertow-servlet-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774) [undertow-core-1.2.8.Final.jar:1.2.8.Final]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

Caused by: java.lang.NullPointerException

at org.jboss.as.jpa.container.TransactionScopedEntityManager.createEntityManager(TransactionScopedEntityManager.java:169) [wildfly-jpa-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.as.jpa.container.TransactionScopedEntityManager.getOrCreateTransactionScopedEntityManager(TransactionScopedEntityManager.java:148) [wildfly-jpa-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.as.jpa.container.TransactionScopedEntityManager.getEntityManager(TransactionScopedEntityManager.java:80) [wildfly-jpa-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.as.jpa.container.AbstractEntityManager.createNamedQuery(AbstractEntityManager.java:375) [wildfly-jpa-9.0.0.Final.jar:9.0.0.Final]

at com.gearbox.webservice.mvt.member.integration.UserGroupManagementDAOImplementation.fetchMemberByNetworkId(UserGroupManagementDAOImplementation.java:68) [gearbox-webservice-mvt-member-3.3.39-SNAPSHOT.jar:]

at com.gearbox.webservice.mvt.member.service.UserGroupManagementServiceImplementation.fetchMemberByNetworkId(UserGroupManagementServiceImplementation.java:61) [gearbox-webservice-mvt-member-3.3.39-SNAPSHOT.jar:]

at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254) [wildfly-ejb3-9.0.0.Final.jar:9.0.0.Final]

You can enable org.jboss.as.jpa TRACE logging, as mentioned here, which will help you understand the sequence of events better, so your not guessing. You will have to recreate the failure but once you have, you should have enough information about the starting of the "member" persistence unit and the persistence unit lookup of the "member" persistence unit. It sounds to me like the persistence unit is not yet started as expected, when the @PersistenceContext looks it up.

You can enable the TRACE logging on your own machine, to see what the output in server.log, looks like. You should see an indication when a "PersistenceUnitSearch" for "member" is done and when the "member" persistence unit service is started.