This is driving me absolutely nuts!
I am deploying to Weblogic 7, each of the following -:
1. An EAR contain a JAR with a Session bean.
2. A WAR containing a servlet that accesses the aforementioned Session bean.
The session bean has a remote interface, which I have successfully called from a command-line test harness. However, when I try to call the same Session Bean from the WAR, a ClassCastException is raised with the mess "Cannot narrow remote object to <package.Class>".
The WAR file maintains a standard WAR file structure, with the bean JAR file in the /lib directory.
The web.xml is in the /WEB-INF directory, along with a weblogic.xml. The important bits of their contents are listed below -:
* weblogic.xml -:
The code to access the problem bean is pretty standard-:
ProblemBeanHome problemHome = (ProblemBeanHome) PortableRemoteObject.narrow("ejb/ProblemBeanHome", com.bugger.ProblemBeanHome.class);
ProblemBeanRemote problem = problemHome.create();
Has anyone else had a similar problem before. I have tried absolutely everything I can think of? I have tried including the ejb JAR in the WAR with the generated ejb classes and without. I have made absolutely certain that the EJB JAR file is exactly the same version as the one deployed in the EAR. I have even tried not narrowing the bloody home interface in the servlet. The last thing I haven't tried, and would rather not have to do, is to extract the classes from the JAR into the /classes directory of the WAR. I discovered that the class that is being returned to the servlet is one of the generated ejb classes, which implements the ProblemBeanHome interface!
I just don't understand what is going wrong!
Please, can somebody help me.
Thanks in advance.
(sorry, I don't have that many points to give at the moment...)