-
1. Re: Jboss 6.1.0.alpha - how to handle Asynchronous proxy using ejb2.1
georgesg Jun 7, 2013 12:58 AM (in response to georgesg)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 :
package org.jboss.ejb3.asynchronous;
import org.jboss.aspects.asynch.AsynchProvider;
import org.jboss.aspects.asynch.Future;
import org.jboss.ejb3.JBossProxy;
public class Asynch
{
public static Object getAsynchronousProxy(Object ejbRef)
{
JBossProxy proxy = (JBossProxy)ejbRef;
return proxy.getAsynchronousProxy();
}
public static Future getFutureResult(Object asynchProxy)
{
AsynchProvider provider = (AsynchProvider)asynchProxy;
return provider.getFuture();
}
}
-
2. Re: Jboss 6.1.0.alpha - how to handle Asynchronous proxy using ejb2.1
wdfink Jun 7, 2013 1:27 AM (in response to georgesg)Are you mixing the client library of AS4 with the EAP6?
-
3. Re: Jboss 6.1.0.alpha - how to handle Asynchronous proxy using ejb2.1
georgesg Jun 7, 2013 1:31 AM (in response to wdfink)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 ?
-
4. Re: Jboss 6.1.0.alpha - how to handle Asynchronous proxy using ejb2.1
wdfink Jun 7, 2013 2:21 AM (in response to georgesg)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.