I'm trying to lookup EJB in a remote machine from tomcat and i'm getting the following error
obs: i'm using jboss 3 RC2 and tomcat 4.0.1 in windows
:
 
Code:
 
Properties newProps = System.getProperties();
newProps.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
newProps.put("java.naming.provider.url","jnp://localhost:1099/");
newProps.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
System.setProperties (newProps);
 
InitialContext jndiContext = new InitialContext(newProps);
Object ref = jndiContext.lookup("ejb/CobrancaFacade");
CobrancaFacadeHome home = (CobrancaFacadeHome) PortableRemoteObject.narrow(ref,CobrancaFacadeHome.class);
cobrancaFacade = home.create();
 
 
Exception:
 
javax.naming.CommunicationException.  Root exception is java.rmi.ServerException: RemoteException oc
curred in server thread; nested exception is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
        java.net.MalformedURLException: no protocol: de
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:536)
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
 
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:368)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:352)
        at javax.naming.InitialContext.lookup(InitialContext.java:354)
        at br.com.sicredi.cobranca.cliente.bd.CobrancaBD.<init>(CobrancaBD.java:46)
        at br.com.sicredi.cobranca.cliente.web.PesquisaPracaAction.executa(PesquisaPracaAction.java:
112)
        at br.com.sicredi.fw.cliente.web.TemplateAction.execute(TemplateAction.java:37)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:437)
 
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:264)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:247)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

Reply via email to