FAQ

[Tomcat-users] javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

Hamacher, Eric
Jan 28, 2009 at 2:19 pm
Hello:

This has been a truly frustrating problem. Here is what I did:

Tomcat 6.0.18
JDK 1.5 u 16
Eclipse w/ WTP 3.4.1
Ojdbc14dms.jar
Dms.jar

I placed my drivers in lib.

In web.xml, I put

<resource-ref>
<res-ref-name>jdbc/GFDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

<Resource name="jdbc/GFDataSource" auth="Container"
type="javax.sql.DataSource"
maxActive="30"
maxIdle="2"
maxWait="1000"
username="username"
password="password"
driverClassName="oracle.jdbc.OracleDriver"
uri="jdbc:oracle:thin:@aserver:2224:DB"/>

For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

This application works on other servers.

Please help!

J. ERIC HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI 53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative
reply

Search Discussions

7 responses

  • Michael Ludwig at Jan 29, 2009 at 12:17 am

    Hamacher, Eric schrieb am 28.01.2009 um 08:18:21 (-0600):

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>
    Try changing the attribute "uri" to "url". Even though the connect URL
    doesn't look like your typical web URL, it is actually used to locate
    the service, not only to identify it.

    Michael Ludwig

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Hamacher, Eric at Jan 29, 2009 at 1:52 pm
    Thanks Michael for the reply.

    No dice. Same error message with "url".

    I forgot to mention that this is a fresh installation of Tomcat 6 so I haven't changed anything except for trying to insert this element.

    Eric

    -----Original Message-----
    From: Michael Ludwig
    Sent: Wednesday, January 28, 2009 6:17 PM
    To: Tomcat Users List
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Hamacher, Eric schrieb am 28.01.2009 um 08:18:21 (-0600):
    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>
    Try changing the attribute "uri" to "url". Even though the connect URL
    doesn't look like your typical web URL, it is actually used to locate
    the service, not only to identify it.

    Michael Ludwig

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Stephen Souness at Jan 29, 2009 at 3:03 pm
    Which lib did you put your jars in?

    The web app's or Tomcat's?


    --
    Stephen Souness

    Hamacher, Eric wrote:
    Hello:

    This has been a truly frustrating problem. Here is what I did:

    Tomcat 6.0.18
    JDK 1.5 u 16
    Eclipse w/ WTP 3.4.1
    Ojdbc14dms.jar
    Dms.jar

    I placed my drivers in lib.

    In web.xml, I put

    <resource-ref>
    <res-ref-name>jdbc/GFDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>

    For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

    This application works on other servers.

    Please help!

    J. ERIC HAMACHER
    Software Application Developer
    608.664.3859
    8476 Greenway Boulevard
    Suite 100
    Middleton, WI 53562
    USA
    GALLUP Technology

    Achiever | Learner | Restorative | Intellection | Deliberative

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Hamacher, Eric at Jan 29, 2009 at 3:04 pm
    Tomcat's

    -----Original Message-----
    From: news On Behalf Of Stephen Souness
    Sent: Thursday, January 29, 2009 9:02 AM
    To: users@tomcat.apache.org
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Which lib did you put your jars in?

    The web app's or Tomcat's?


    --
    Stephen Souness

    Hamacher, Eric wrote:
    Hello:

    This has been a truly frustrating problem. Here is what I did:

    Tomcat 6.0.18
    JDK 1.5 u 16
    Eclipse w/ WTP 3.4.1
    Ojdbc14dms.jar
    Dms.jar

    I placed my drivers in lib.

    In web.xml, I put

    <resource-ref>
    <res-ref-name>jdbc/GFDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>

    For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

    This application works on other servers.

    Please help!

    J. ERIC HAMACHER
    Software Application Developer
    608.664.3859
    8476 Greenway Boulevard
    Suite 100
    Middleton, WI 53562
    USA
    GALLUP Technology

    Achiever | Learner | Restorative | Intellection | Deliberative

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Hamacher, Eric at Jan 29, 2009 at 4:13 pm
    I solved the problem by putting java:/comp/env in the JNDI lookup in the code.

    That led me to an exception when I tried to use an ArrayDescriptor.

    So I tried to change my pooling form dbcp to oracle with:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    connectionCachingEnabled="true"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="GLP_S"
    password="gideupstg"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@uxsvr3.enetrix.msn:2224:STG9"/>

    And now I'm back to "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"!

    -----Original Message-----
    From: Hamacher, Eric
    Sent: Thursday, January 29, 2009 9:04 AM
    To: Tomcat Users List
    Subject: RE: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Tomcat's

    -----Original Message-----
    From: news On Behalf Of Stephen Souness
    Sent: Thursday, January 29, 2009 9:02 AM
    To: users@tomcat.apache.org
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Which lib did you put your jars in?

    The web app's or Tomcat's?


    --
    Stephen Souness

    Hamacher, Eric wrote:
    Hello:

    This has been a truly frustrating problem. Here is what I did:

    Tomcat 6.0.18
    JDK 1.5 u 16
    Eclipse w/ WTP 3.4.1
    Ojdbc14dms.jar
    Dms.jar

    I placed my drivers in lib.

    In web.xml, I put

    <resource-ref>
    <res-ref-name>jdbc/GFDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>

    For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

    This application works on other servers.

    Please help!

    J. ERIC HAMACHER
    Software Application Developer
    608.664.3859
    8476 Greenway Boulevard
    Suite 100
    Middleton, WI 53562
    USA
    GALLUP Technology

    Achiever | Learner | Restorative | Intellection | Deliberative

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Pid at Jan 29, 2009 at 8:43 pm

    Hamacher, Eric wrote:
    I solved the problem by putting java:/comp/env in the JNDI lookup in the code.
    So you're not putting: java:/comp/jdbc/GFDataSource?

    p



    That led me to an exception when I tried to use an ArrayDescriptor.

    So I tried to change my pooling form dbcp to oracle with:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    connectionCachingEnabled="true"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="GLP_S"
    password="gideupstg"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@uxsvr3.enetrix.msn:2224:STG9"/>

    And now I'm back to "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"!

    -----Original Message-----
    From: Hamacher, Eric
    Sent: Thursday, January 29, 2009 9:04 AM
    To: Tomcat Users List
    Subject: RE: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Tomcat's

    -----Original Message-----
    From: news On Behalf Of Stephen Souness
    Sent: Thursday, January 29, 2009 9:02 AM
    To: users@tomcat.apache.org
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Which lib did you put your jars in?

    The web app's or Tomcat's?


    --
    Stephen Souness

    Hamacher, Eric wrote:
    Hello:

    This has been a truly frustrating problem. Here is what I did:

    Tomcat 6.0.18
    JDK 1.5 u 16
    Eclipse w/ WTP 3.4.1
    Ojdbc14dms.jar
    Dms.jar

    I placed my drivers in lib.

    In web.xml, I put

    <resource-ref>
    <res-ref-name>jdbc/GFDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>

    For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

    This application works on other servers.

    Please help!

    J. ERIC HAMACHER
    Software Application Developer
    608.664.3859
    8476 Greenway Boulevard
    Suite 100
    Middleton, WI 53562
    USA
    GALLUP Technology

    Achiever | Learner | Restorative | Intellection | Deliberative

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org
  • Hamacher, Eric at Jan 30, 2009 at 8:16 pm
    DataSource pds = null;
    pds = (DataSource)context.lookup(name);


    "name" had to be "java:/comp/jdbc/GFDataSource" and then I moved on to my next problem.

    -----Original Message-----
    From: Pid
    Sent: Thursday, January 29, 2009 2:43 PM
    To: Tomcat Users List
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Hamacher, Eric wrote:
    I solved the problem by putting java:/comp/env in the JNDI lookup in the code.
    So you're not putting: java:/comp/jdbc/GFDataSource?

    p



    That led me to an exception when I tried to use an ArrayDescriptor.

    So I tried to change my pooling form dbcp to oracle with:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    connectionCachingEnabled="true"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="GLP_S"
    password="gideupstg"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    url="jdbc:oracle:thin:@uxsvr3.enetrix.msn:2224:STG9"/>

    And now I'm back to "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"!

    -----Original Message-----
    From: Hamacher, Eric
    Sent: Thursday, January 29, 2009 9:04 AM
    To: Tomcat Users List
    Subject: RE: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Tomcat's

    -----Original Message-----
    From: news On Behalf Of Stephen Souness
    Sent: Thursday, January 29, 2009 9:02 AM
    To: users@tomcat.apache.org
    Subject: Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

    Which lib did you put your jars in?

    The web app's or Tomcat's?


    --
    Stephen Souness

    Hamacher, Eric wrote:
    Hello:

    This has been a truly frustrating problem. Here is what I did:

    Tomcat 6.0.18
    JDK 1.5 u 16
    Eclipse w/ WTP 3.4.1
    Ojdbc14dms.jar
    Dms.jar

    I placed my drivers in lib.

    In web.xml, I put

    <resource-ref>
    <res-ref-name>jdbc/GFDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    I placed the following in three different places, conf/server.xml, conf/context.xml, and in a context file in my app's META-INF directory:

    <Resource name="jdbc/GFDataSource" auth="Container"
    type="javax.sql.DataSource"
    maxActive="30"
    maxIdle="2"
    maxWait="1000"
    username="username"
    password="password"
    driverClassName="oracle.jdbc.OracleDriver"
    uri="jdbc:oracle:thin:@aserver:2224:DB"/>

    For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

    This application works on other servers.

    Please help!

    J. ERIC HAMACHER
    Software Application Developer
    608.664.3859
    8476 Greenway Boulevard
    Suite 100
    Middleton, WI 53562
    USA
    GALLUP Technology

    Achiever | Learner | Restorative | Intellection | Deliberative

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
    For additional commands, e-mail: users-help@tomcat.apache.org

Related Discussions

Discussion Navigation
viewthread | post