javax.naming.NameNotFoundException: OracleDS not bound
mukundjaiswal Sep 28, 2005 7:33 AMhi,
i would really appreciate if anyone can halp me out with this
i am encountering exceptions
javax.naming.NameNotFoundException: CMPOracleDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at SenderClass.JMSQueueMessageProducer.establishConnection(JMSQueueMessageProducer.java:77)
at SenderClass.JMSQueueMessageProducer.main(JMSQueueMessageProducer.java:147)
my oracle-ds.xml entries are :
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@3.220.220.220:1521:ora9idev</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>mukund</user-name>
mukund
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
The code through which i am excessing it is
private static InitialContext jc = null;
/**
* DOCUMENT ME!
*/
public static void establishConnection() {
try {
jc = new InitialContext();
System.out.println("not yet connected 1");
javax.sql.DataSource ds = (javax.sql.DataSource) jc.lookup("java:/CMPOracleDS");
Connection conn = ds.getConnection();
if (conn != null) {
System.out.println("connected:" + conn.getMetaData().getUserName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
the JNDI properties filein is the src folder and contians the following entries
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost
i tried searching alot but could not make it work properly with JBOSS 3.2.5.
i have tried using help available on jboss and oracle site.
can anyone guide/ help me in setting up the connection with oracle 9i db
thanks & regards,
Mukund