tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Upgrading OpenEJB Standalone to 7.0.3
Date Wed, 24 May 2017 10:57:51 GMT
How is the deployment/packaging? Can it be a scanning issue? You dont add
@Interceptor on the interceptor?


Le 24 mai 2017 11:28, "JumpStart" <geoff.callender.jumpstart@gmail.com> a
écrit :

> I’m upgrading from 4.5.2 to 7.0.3. Since the upgrade, I have an
> interceptor that fails and consequently session beans can’t be invoked. I
> found the same error when I tried to upgrade to 4.6.0.2. Was there a JNDI
> change between 4.5.2 and 4.6.0.2?
>
>
>  WARN [LogStreamAsync.Thread] (Log4jLogStream.java:59) - Injection data
> not found in JNDI context: jndiName='comp/env/com.goxpro.
> xpro.business.domain.base.BaseService/context', target=com.goxpro.xpro.
> business.domain.base.BaseService/context
>  WARN [LogStreamAsync.Thread] (Log4jLogStream.java:59) - Injection data
> not found in JNDI context: jndiName='comp/env/com.goxpro.
> xpro.business.domain.base.UsernameCacheRefresher/context',
> target=com.goxpro.xpro.business.domain.base.UsernameCacheRefresher/context
>  WARN [LogStreamAsync.Thread] (Log4jLogStream.java:59) - Injection data
> not found in JNDI context: jndiName='comp/env/com.goxpro.
> xpro.business.domain.base.UsernameCacheRefresher/context',
> target=com.goxpro.xpro.business.domain.base.UsernameCacheRefresher/context
>  WARN [LogStreamAsync.Thread] (Log4jLogStream.java:59) - Injection data
> not found in JNDI context: jndiName='comp/env/com.goxpro.
> xpro.business.domain.base.UsernameCacheRefresher/context',
> target=com.goxpro.xpro.business.domain.base.UsernameCacheRefresher/context
> ERROR [LogStreamAsync.Thread] (Log4jLogStream.java:51) -
> EjbTransactionUtil.handleSystemException: null
> java.lang.NullPointerException
>         at com.goxpro.xpro.business.domain.base.UsernameCacheRefresher.
> refreshUsernameCache(UsernameCacheRefresher.java:38)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.openejb.core.interceptor.
> ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.
> java:205)
>         at org.apache.openejb.core.interceptor.
> ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
>         at org.apache.openejb.monitoring.StatsInterceptor.record(
> StatsInterceptor.java:181)
>         at org.apache.openejb.monitoring.StatsInterceptor.invoke(
> StatsInterceptor.java:100)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.openejb.core.interceptor.
> ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.
> java:205)
>         at org.apache.openejb.core.interceptor.
> ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
>         at org.apache.openejb.core.interceptor.InterceptorStack.
> invoke(InterceptorStack.java:85)
>         at org.apache.openejb.core.stateless.StatelessContainer._
> invoke(StatelessContainer.java:252)
>         at org.apache.openejb.core.stateless.StatelessContainer.
> invoke(StatelessContainer.java:212)
>         at org.apache.openejb.core.ivm.EjbObjectProxyHandler.
> synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
>         at org.apache.openejb.core.ivm.EjbObjectProxyHandler.
> businessMethod(EjbObjectProxyHandler.java:260)
>         at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(
> EjbObjectProxyHandler.java:89)
>         at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(
> BaseEjbProxyHandler.java:347)
>         at com.sun.proxy.$Proxy206.passivateEligibleClients(Unknown
> Source)
>         at com.goxpro.xpro.web.daemons.InactiveClientsManagerTask.doNext(
> InactiveClientsManagerTask.java:65)
>         at com.goxpro.xpro.web.daemons.AbstractTaskRunner.run(
> AbstractTaskRunner.java:124)
>         at java.util.TimerThread.mainLoop(Timer.java:555)
>         at java.util.TimerThread.run(Timer.java:505)
>
>
> The NPE line is indicated in this source...
>
>
> public class UsernameCacheRefresher {
>
>         @Resource
>         private javax.ejb.SessionContext context;
>
>         private static final Logger logger = LoggerFactory.getLogger(
> BaseService.class);
>
>         @AroundInvoke
>         public Object refreshUsernameCache(InvocationContext ic) throws
> Exception {
>
>                 Principal callerPrincipal = context.getCallerPrincipal();
> <<< Line 38. NPE happens here.
>
>                 if (callerPrincipal != null) {
>                         UsernameCache.setThreadUsername(
> callerPrincipal.getName());
>                 }
>                 else {
>                         // Is this even possible? Isn't there a default
> principal of guest (OpenEJB) or anonymous (JBoss)?
>                         logger.error("WATCH OUT - UsernameCacheRefresher
> found callerPrincipal is null!!!!!!!!!!!!!");
>                         UsernameCache.setThreadUsername(null);
>                 }
>
>                 return ic.proceed();
>         }
>
> }
>
>
> Here’s an example of how it gets used…
>
>
> @Stateless
> @Local(IEmailManagerServiceLocal.class)
> @Remote(IEmailManagerServiceRemote.class)
> @Interceptors({ UsernameCacheRefresher.class })
> public class EmailManagerService extends BaseService implements
> IEmailManagerServiceLocal, IEmailManagerServiceRemote {
> …
> }
>
>
> Thanks in advance,
>
> Geoff

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message