Hi all,
I am trying something usually unadvisable in JBoss which is to deploy a WAR and an EAR in
the same JBoss instance (where the WAR accesses the EAR via JNDI/RMI).
I am using JBoss 4.0.5.GA EJB3RC9, and as one might expect I am swimming in a soup of
ClassCastExceptions whilst trying to use the object (remote interface) retrieved by a
context.lookup().
I have turned everything to Pass-by-Value (Naming, etc.) in jboss-service and
ejb-deployer.
My remote interface is:
@Remote
| public Interface ManagerRemote extends Serializable {
| ...
My SFSB is:
| @Stateful
| @Remote ({ManagerRemote.class}
| @RemoteBinding (jndiBinding="MYAPP/Manager/remote")
| public class ManagerBean implements ManagerRemote {
| ...
|
The client in the WAR attempts to access this remote interface by:
| Context context = new InitialContext();
| object = context.lookup("MYAPP/Manager/remote");
| ManagerRemote mr = (ManagerRemote) object;
|
I have printed the interfaces implemented by the object retrieved over JNDI, and it
definitely implements "ManagerRemote" as hoped. Sadly "ManagerRemote"
will not cast to "ManagerRemote", presumably because the JBoss classloader is
distinguishing between the ManagerRemote interface packaged in the EAR and the same
interface packaged in the WAR.
Investigations have shown alot of issues around this, and people talking about having to
play with settings like "Java2ClassLoadingCompliance",
"UseJBossWebLoader" and "java2ParentDelegation" to get any joy
(although I have not).
Is it really still that hard to have a WAR and an EAR in the same JBoss instance with the
same interfaces classes in each? (we are building this way as eventually the WAR and EAR
won't be colocated). Are there some instructions on how to achieve this kind of setup
in JBoss 4.0.5 EJB3 without an endless struggle of ClassCastExceptions ?
Thanks!
David
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984796#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...