[jboss-user] [EJB 3.0] - ClassCastExeption while invoking a Bean

Ulmer do-not-reply at jboss.com
Tue May 15 04:14:47 EDT 2007


hi, 

evaluating a simpliest ejb3 I get the following exception

anonymous wrote : 
  | java.lang.ClassCastException
  | 	com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
  | 	javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
  | 	mypackage.MyClientClass.testBeanInvocation(MyClientClass.java:50)
  | 	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	java.lang.reflect.Method.invoke(Method.java:597)
  | 	org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:351)
  | 	org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:305)
  | 	org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
  | 	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
  | 	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
  | 	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
  | 	org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
  | 	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  | 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | root cause
  | 
  | java.lang.ClassCastException: org.jnp.interfaces.NamingContext cannot be cast to org.omg.CORBA.Object
  | 	com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
  | 	javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
  | 	mypackage.MyClientClass.testBeanInvocation(MyClientClass.java:50)
  | 	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	java.lang.reflect.Method.invoke(Method.java:597)
  | 	org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:351)
  | 	org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:305)
  | 	org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
  | 	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
  | 	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
  | 	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
  | 	org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
  | 	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  | 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  | 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | 

the executing code:


  | Object ref = ctx.lookup("MyBean");
  | Object narrow = PortableRemoteObject.narrow( ref, MyRemote.class); //exception comes here
  | 
  | 

The bean to be invoked is a stateful session bean, deployed in the /server/default/deploy as a *.jar.

Does anybody have an idea?

Environment:
Jboss 4.2.0 RC2
Java 6
Windows XP

Regards,

Ulmer

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

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



More information about the jboss-user mailing list