-
1. Re: Incompatible class returned by EJB remote call
dmlloyd Jun 3, 2015 8:46 AM (in response to sergiu_pienar)You might be performing a local invocation instead of a remote invocation. Make sure you really are getting the remote interface when you make the call. Also make sure the client WAR has copies of all the classes involved in the invocation. If it doesn't, the invocation logic may fall back to deserializing a version of a class from the EAR, which might link against a class that is defined in both the EAR and the WAR (resulting in surprise ClassCastExceptions).
-
2. Re: Incompatible class returned by EJB remote call
sergiu_pienar Jun 3, 2015 10:43 AM (in response to dmlloyd)Hi, thanks for your input.
1.) How can I check that I really am getting the remote view ? The current lookup for the remote interface is:
lookup(null, "java:jboss/exported/myEAR/all-ejbs/RuleExecutorBean!com.rule.RuleExecutorRemote", com.rule.RuleExecutorRemote.class)
which returns Proxy for remote EJB StatelessEJBLocator{appName='myEAR', moduleName='all-ejbs', distinctName='', beanName='RuleExecutorBean', view='interface com.rule.RuleExecutorRemote'}
could it be that since I'm not passing any HashTable as the 1st argument to the lookup it will fallback to a local view ?
2.) I checked and the client war does have copies of all the classes involved under WEB-INF/classes.
Also, I've tried the same thing from a standalone app, calling the bean and checking for ConfigClass (returned one) instanceof ConfigClass and it all worked ok. The standalone app is using the getRemote(final Hashtable environment).