[jboss-user] [EJB 3.0] - Re: Can you Inject Local EJB from separate ear file?

jfrankman do-not-reply at jboss.com
Fri Jul 11 10:25:46 EDT 2008


Thanks for the tip. Your suggestion solved my problem. I also found that I had to change the jboss config to use callbyvalue per this article:

http://wiki.jboss.org/wiki/ClassLoadingConfiguration

Now I am almost there. I can inject the session bean and call a method, but now the object returned by the session beans method cannot be cast into my class:

NexusEventDefinition def= nexusEventsService.findNexusEventDefinitionByName("Synchronous event that does neat things.");

I get a class cast exception:

anonymous wrote : 
  | java.lang.ClassCastException: com.idfbins.nexusevents.vo.NexusEventDefinition
  | 	at $Proxy175.findNexusEventDefinitionByName(Unknown Source)
  | 	at com.idfbins.keybank.KeyBankCheckImagesMessageHandler.onMessage(KeyBankCheckImagesMessageHandler.java:76)
  | 	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:585)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  | 	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  | 	at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
  | 	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | 	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
  | 	at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
  | 	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:585)
  | 	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.invokeInNoTx(TxPolicy.java:66)
  | 	at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
  | 	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 $Proxy103.onMessage(Unknown Source)
  | 	at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
  | 	at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
  | 	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:595)

Any idea why I am getting the class cast exception?

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

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



More information about the jboss-user mailing list