my code is
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
or
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
it's working well. everything is fine.
but if i change it to
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "jnp://192.168.1.101:1099");
an error came out
javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.1.101:1099
localhost, 127.0.0.1, 192.168.1.101 is the same server.
actually i wanna connect to a remote server 192.168.1.50. but i can't even connect to myself if i use 192.168.1.101 address
does anybody have any idea what's going on?
See this http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss42FAQ. Use the -b option. And by the way, i assume that you are using JBoss 4.2.x