[jboss-user] [EJB 3.0] - Re: java.lang.ClassCastException: $Proxy79 getting conext

rober-mpp do-not-reply at jboss.com
Tue Nov 18 20:17:16 EST 2008


Hi all, 

I'm having the ClassCastException issue, but I only have one remote interface.

This is my java code: 

        Hashtable<String, String> contextProperties = new Hashtable<String, String>();
  |         contextProperties.put( InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
  |         contextProperties.put( InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099" );
  |         
  |         InitialContext initialContext = new InitialContext( contextProperties );
  |         
  |         Object obj = initialContext.lookup( "ZaraServer/FachadaBean/remote" );
  |         
  |         FachadaInterfaz fachada = (FachadaInterfaz)obj;

The exception being throwed on the last line when trying to cast:

  | 23:01:47,984 ERROR [STDERR] java.lang.ClassCastException: $Proxy91 cannot be cast to zara.server.session.fachada.FachadaInterfaz
  | 23:01:48,000 ERROR [STDERR] 	at ws.RecibirEnvioATiendaSoapBindingImpl.inicializarFachada(RecibirEnvioATiendaSoapBindingImpl.java:95)
  | 23:01:48,000 ERROR [STDERR] 	at ws.RecibirEnvioATiendaSoapBindingImpl.recibirEnvioATienda(RecibirEnvioATiendaSoapBindingImpl.java:57)
  | 23:01:48,000 ERROR [STDERR] 	at ws.RecibirEnvioATiendaSoapBindingSkeleton.recibirEnvioATienda(RecibirEnvioATiendaSoapBindingSkeleton.java:56)
  | 23:01:48,000 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 23:01:48,000 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 23:01:48,000 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 23:01:48,000 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:597)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
  | 23:01:48,015 ERROR [STDERR] 	at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
  | 23:01:48,031 ERROR [STDERR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  | 23:01:48,031 ERROR [STDERR] 	at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
  | 23:01:48,031 ERROR [STDERR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
  | 23:01:48,031 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 23:01:48,031 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 23:01:48,031 ERROR [STDERR] 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 23:01:48,031 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 23:01:48,046 ERROR [STDERR] 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 23:01:48,046 ERROR [STDERR] 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 23:01:48,046 ERROR [STDERR] 	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
  | 23:01:48,046 ERROR [STDERR] 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 23:01:48,062 ERROR [STDERR] 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 23:01:48,062 ERROR [STDERR] 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 23:01:48,062 ERROR [STDERR] 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 23:01:48,062 ERROR [STDERR] 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 23:01:48,062 ERROR [STDERR] 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 23:01:48,062 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:619)
  | 

The JNDI namespace

Global JNDI Namespace
  | 
  |   +- XAConnectionFactory
  |   +- TopicConnectionFactory
  |   +- UIL2ConnectionFactory[link -> ConnectionFactory]
  |   +- UserTransactionSessionFactory (proxy: $Proxy39 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
  |   +- UIL2XAConnectionFactory[link -> XAConnectionFactory]
  |   +- QueueConnectionFactory
  |   +- ZaraServer
  |   |   +- AdministradorArticulosBean
  |   |   |   +- local (proxy: $Proxy74 implements interface zara.server.session.articulos.AdministradorArticulosInterfaz,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
  |   |   +- AdministradorVentasBean
  |   |   |   +- local (proxy: $Proxy80 implements interface zara.server.session.venta.AdministradorVentasInterfaz,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
  |   |   +- FachadaBean
  |   |   |   +- remote (proxy: $Proxy83 implements interface zara.server.session.fachada.FachadaInterfaz,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
  |   |   +- AdministradorPedidosBean
  |   |   |   +- local (proxy: $Proxy77 implements interface zara.server.session.pedidos.AdministradorPedidosInterfaz,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
  | 

I think I may be going crazy with this issue, but I can't make it work.

Thanks all for your help
Cheers.

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

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



More information about the jboss-user mailing list