Announcement Announcement Module
Collapse
No announcement yet.
JNDI/JDBC access issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JNDI/JDBC access issue

    i am getting "javax.naming.NamingException: Cannot create resource instance" when i try to access the lookup. i am using oracle.


    Context envCtx = (Context) new InitialContext().lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/TestDB"); // <---- ERROR thrown here..


    my web.xml contains...

    <resource-ref>
    <description>DB Connection Pooling</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>oracle.jdbc.OracleDriver</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>


    i have ojdbc14.jar in the lib folder.

    my server.xml contains..

    <Context path="/dbcp" docBase="dbcp" debug="5"
    reloadable="true" crossContext="true">

    <Resource name="jdbc/TestDB" auth="Container"
    type="javax.sql.DataSource" removeAbandoned="true"
    removeAbandonedTimeout="30" maxActive="10"
    maxIdle="30" maxWait="10000" username="xxxxxxxx"
    password="xxxxxxx"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@xxxxxxxxxxxxxx"/>
    </Context>


    <Connector port="80" maxHttpHeaderSize="8192" maxProcessors="150"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="150"
    connectionTimeout="20000" disableUploadTimeout="true" />


    Am i missing something?

    Thanks

  • #2
    JNDI/JDBC access issue

    Figured it out....there was an issue with server.xml

    Comment

    Working...
    X