I want to use JNDI to retrive a Connection object from an Oracle 9i DBMS and get the following error:
javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1118)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1197)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:515)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at masteringEJB.ch4.CountClient.main(CountClient.java:44)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
at java.net.DatagramSocket.receive(DatagramSocket.java:712)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1088)
... 5 more
That exception is thrown when i do:
Properties props=System.getProperties();
Context ctx=new InitialContext(props);
DataSource ds=(DataSource)ctx.lookup("java://OracleDS"); // Exception thrown
Connection conn= ds.getConnection();
I pass the JVM the following props:
-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-Djava.naming.provider.url=jnp://ahernandez:1099
-Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
I use this code to test Bean-Managed Entity Beans
Any hints?
Thanks in advance
oh, i forgot, i'm usin JBoss 4.0.0