[jboss-user] [Beginners Corner] - Re: ClassCastException from PortableRemoteObject.narrow in J

AceFrehley do-not-reply at jboss.com
Wed Jan 7 11:51:39 EST 2009


I experienced the same problem, but I didn't have any jars deployed in the wrong place. My problem was that I wasn't casting to the EXACT interface name that I had annotated with @Remote. My interface was extending from an interface that was annotated with @Remote. It was only when I:

1.) Cast to the exact interface that contains the actual @Remote annotation
2.) Specified the JNDI lookup name suffixed with /remote

Did it finally work for me... Here is the syntax that worked in my case:

			
  | OrderManager orderManagerEjb = (OrderManager) jndiContext.lookup("OrderManagerBean/remote");
  | 

Where OrderManager has the @Remote annotation. 

Hope this helps somebody.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200137#4200137

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200137



More information about the jboss-user mailing list