Hi all, I've a problem with EJB3 on JBOSS 4.2.2. I have a ejb-jar.jar in app server(remote), but I want test client with ECLIPSE(from my computer) and I try it in a main class, but I have a error.
jndi.properties: java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs = org.jboss.naming:org.jnp.interfaces java.naming.provider.url = jnp://Remote-IP:1099 public static void main(String[] args) { /*System.setProperty("java.security.policy","client.policy"); if(System.getSecurityManager()==null) System.setSecurityManager(new RMISecurityManager()); System.setProperty("sun.net.client.defaultReadTimeout", "100000");*/ try { Properties properties = new Properties(); properties.load(new FileInputStream("jndi.properties")); Context contexto = null; contexto = new InitialContext(properties); GreeterFacade beanRemoto = (GreeterFacade) contexto.lookup(BouncerFacadeBean.RemoteJNDIName); Collection resultado = beanRemoto.listadoPedidos(); for (Iterator iterator = resultado.iterator(); iterator.hasNext();) { String object = (String) iterator.next(); System.out.println("El resultado es:" + resultado); } } catch (NamingException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } error: javax.naming.CommunicationException: Could not obtain connection to any of these urls: Remote-IP:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server Remote-IP:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server Remote-IP:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1416) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:596) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589) at javax.naming.InitialContext.lookup(Unknown Source) at demoEJB.Testing.main(Testing.java:35) Caused by: javax.naming.CommunicationException: Failed to connect to server Remote-IP:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server Remote-IP:1099 [Root exception is java.net.ConnectException: Connection refused: connect]] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1387) ... 4 more Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server Remote-IP:1099 [Root exception is java.net.ConnectException: Connection refused: connect] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243) ... 5 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.(Unknown Source) at java.net.Socket.(Unknown Source) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77) at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239) ... 5 more In my remote host: command line (cmd): netstat -an TCP 127.0.0.1:1098 0.0.0.0:0 LISTENING TCP 127.0.0.1:1099 0.0.0.0:0 LISTENING Note: Locally(server remote) works fine :) I hope we can help me!! sorry, I speak little English :) Thanks you!! View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250521#4250521 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250521 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user