how to make swing program on client machine to connect to ej
cl666cl666 Aug 6, 2004 10:17 AMWe are ready to go to production and having several issues :
1. We have a swing application accessing the EJB's. In order to make an external deployment of the swing client I have copied the following jar files to the client side: jboss_all, jboss_client, j2eeserver, jbos_common_client, jboss_j2ee, jnet, jnp_client, jsse, log4j, AbsoluteLayout. Nevertheless, I still get a client timeout error as below.
2. We have coded jndi properties as follows:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://179.1.71.2:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
//Initial Context
private InitialContext getInitialContext() throws NamingException {
if (initialContext == null) {
Hashtable environment = new Hashtable();
environment.put
(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
environment.put
(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
environment.put(Context.PROVIDER_URL,"jnp://129.1.71.2:1099");
initialContext = new InitialContext(environment);
}
return initialContext;
}
//ERROR
javax.naming.CommunicationException: Receive timed out [Root exception is
java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer
(NamingContext.java:1058)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1127)
at org.jnp.interfaces.NamingContext.list(NamingContext.java:676)
at org.jnp.interfaces.NamingContext.list(NamingContext.java:669)
at javax.naming.InitialContext.list(InitialContext.java:387)
at Prueba1.main(Prueba1.java:78) Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:711)
at org.jnp.interfaces.NamingContext.discoverServer
(NamingContext.java:1038)
... 5 more
the same code, running in the same machine as the application server, that is, in development phase, works fine. We double check the host ip address and port and it’s working. The problem, we think, has to do with the deployment of the swing client independently from the app server. Everything is proper and running until we try to go to production mode and then the jndi lookups doesn’t work anymore.
Any ideas????