How are you application(s) packaged? Are the EJB jar and the war file, two separate
applications or are they part of an ear file?
Also, do have a look at this wiki page (if you havent already seen that )
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions
Additionally, in your code try using some debug statements like:
// lookup you ejb
| Object obj = ctx.lookup(".....");
| // i guess this is going to output Proxy$ or something similar
| System.out.println("Returned obj is of class: " + obj.getClass());
|
| // now lets see whether we can narrow that object
| if (obj instanceof MyHome ) {
| //where MyHome is the class name of the bean's home
| System.out.println("Everything looks fine. Lets do the
PortableRemoteObject.narrow");
| MyHome home = (MyHome) PortableRemoteObject.narrow(obj,MyHome.class);
| System.out.println("Success");
| } else {
| System.out.println("Most probably a classloader issue");
| System.out.println("Object returned was loaded by: " +
obj.getClass().getClassLoader());
| System.out.println("MyHome class in the servlet was loaded by: " +
MyHome.class.getClassLoader());
| }
|
|
|
|
P.S.: I havent tried this code, you might have to do any changes that are required. But it
might just give you some options to try out.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050599#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...