[jboss-user] [EJB 3.0] - @EJB injection after redeploy

vlotarev do-not-reply at jboss.com
Wed May 20 04:46:25 EDT 2009


I am trying deploy simple application: two stateless EJB3 beans packaged in one ejb module that, in turn, is packaged as EAR application. One EJB injects aonther by simple @EJB annotation (via local inteface):

    @EJB
  |     private SwServiceLocal swService;
  | 

Everything works just fine after first deployment but fails after re-deployment (the first access to injected EJB) injection fails with the following exception:

  java.lang.RuntimeException: Non matching type for inject of field: private com.foo.service.SwService com.foo.service.SV2ServiceBean.swService for type: $Proxy433 of jndiName env/com.foo.service.SV2ServiceBean/swService intfs: , com.foo.service.SwServiceLocal, org.jboss.ejb3.JBossProxy 12:03:11,589 ERROR [STDERR]     at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:128)
  |      at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:106)
  |      at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:63)
  |      at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:111)
  |      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:49)
  |      at org.jboss.ejb3.ThreadlocalPool.create(ThreadlocalPool.java:50)
  |      at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:90)
  |      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
  |      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
  |      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
  |      at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
  |      at $Proxy431.processAllOperations(Unknown Source)
  |      at fr.sncm.sgi.service.batchmanager.ServiceBatchManager.executeConnecteurInterface(ServiceBatchManager.java:789)
  |      at fr.sncm.sgi.service.batchmanager.ServiceBatchManager.programmeInterface(ServiceBatchManager.java:612)
  |      at fr.sncm.sgi.service.batchmanager.ServiceBatchManager.processPerformBatch(ServiceBatchManager.java:300)
  |      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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  |      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  |      at fr.sncm.sgi.interceptors.LogInterceptor.logThisMethod(LogInterceptor.java:31)
  |      at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
  |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |      at java.lang.reflect.Method.invoke(Method.java:597)
  |      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  |      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
  |      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
  |      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
  |      at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
  |      at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
  |      at $Proxy324.processPerformBatch(Unknown Source)
  |      at fr.sncm.sgi.mdb.GenericTopicMessageBean.onMessage(GenericTopicMessageBean.java:87)
  |      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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  |      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  |      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
  |      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
  |      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |      at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
  |      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
  |      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
  |      at $Proxy347.onMessage(Unknown Source)
  |      at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
  |      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:906)
  |      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
  |      at org.jboss.mq.SpySession.run(SpySession.java:323)
  |      at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
  |      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
  |      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
  |      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
  |      at java.lang.Thread.run(Thread.java:619)
  |  Caused by: java.lang.IllegalArgumentException: Can not set com.foo.service.SwService field com.foo.service.SV2ServiceBean.swService to $Proxy433
  |      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
  |      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
  |      at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
  |      at java.lang.reflect.Field.set(Field.java:657)
  |      at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:116)
  |      ... 88 more

Do I do something wrong? Can anybody help me?

Thanks in advance,
Vadim

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232135#4232135

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232135



More information about the jboss-user mailing list