Hello!
I have a strange problem.
This code:
Properties prop = new Properties();
prop.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
prop.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
prop.setProperty(Context.PROVIDER_URL,"www.mydomain.com:1099"); // this is
// a substitution, as you understand
InitialContext initial = new InitialContext(prop);
Object homeObject = initial.lookup("MyObject");
fails to execute (I mean the last line):
javax.naming.CommunicationException. Root exception is java.rmi.ConnectException:
Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.<init>(Socket.java:273)
at java.net.Socket.<init>(Socket.java:100)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:298)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:282)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.alphafx.edu.BeanConnectTest.main(BeanConnectTest.java:27)
But why localhost? I set Context.PROVIDER_URL explicitly, what else shall I do
to make it connect to the actual PROVIDER_URL?
--
Sincerely yours, Max Jury Krainov
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user