The problem is that, I am getting the below exception.
Caused by: java.lang.ClassCastException: com.cassis.queue.manager.service.QueueManagerLocal$$$view10 cannot be cast to org.jboss.ejb3.JBossProxy
at org.jboss.ejb3.asynchronous.Asynch.getAsynchronousProxy(Asynch.java:38) [jbossall-client-4.2.2.GA.jar:4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)]
at com.cassis.queue.manager.process.QueueProcess.queueRequestAsync(QueueProcess.java:125) [QueueManagerEjb-1.0.0-SNAPSHOT.jar:]
... 95 more
Code snippet from jbossall-client-4.2.2.GA.jar :
public class Asynch
public static Object getAsynchronousProxy(Object ejbRef)
JBossProxy proxy = (JBossProxy)ejbRef;
public static Future getFutureResult(Object asynchProxy)
AsynchProvider provider = (AsynchProvider)asynchProxy;
Are you mixing the client library of AS4 with the EAP6?
yes. Basically the client library is packaged as a part of the EAR Binary. So , the application picksup from EAR /Lib directory.
When i read the documents about Asynchronous proxy, understood that when we pass any ejbref as a parameter, it will be returned as an Asynchronous ejbref. But in this case, why this class cast excception is happening ? Any idea ?
You can not deploy a application packed with incompatible JBoss classes. If the classes are used you will have such CCE.
Your approach looks like not supported from the EJB2 spec. In EAP6 the class is not available as the code is rewritten with AS7.
I think the solution for your problem is to migrate the bean to EJB3 and use the asynchronous invocation which is part of this spec.