• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot get Spring database connection work

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am configuring my Spring app to use Tomcat (Spring tc server), I am getting this error when tc Server 6.0.20 starts up with my app. deployed.

Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

I have used the following server.xml with datasource configured.

<GlobalNamingResources>
<Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver" maxActive="10" name="jdbc/MyDataSource" password="password" type="javax.sql.DataSource" url="....." username="yan"/>
</GlobalNamingResources>

This is my Spring config XML

<jee:jndi-lookup id="datasource" jndi-name="jdbc/MyDataSource" resource-ref="true"/>

I do not think I missed anything, but cannot seem to get database connection to work.

Thanks,
Yan
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please refer the spring 2.0 pdf. you get it more information about JNDI.
reply
    Bookmark Topic Watch Topic
  • New Topic