views:

833

answers:

1

Environment:

  • Tomcat-6.0.18
  • Oracle-Db
  • JDK-1.6.0_1

-1- context.xml i a war file - works fine

my-application.war/META-INF/context.xml:

<Resource 
  auth="Container" 
  driverClassName="oracle.jdbc.OracleDriver" 
  maxActive="5" 
  maxIdle="1" 
  maxWait="-1" 
  name="jdbc/dataource-name" 
  password="pwd" 
  type="javax.sql.DataSource" 
  url="jdbc:oracle:thin:@host-name:1521:xe" 
  username="name"/>

Important: context.xml is placed in a War-archive in this case. After deploying the application can access the database without problems

-2- context.xml in an expanded directory structure (does not work):

my-application/META-INF/context.xml (same content)

Important: context.xml is placed in a expanded directory structure in this case. After deployment application con not access the database. Exception message is: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My question:

How do i configure tomcat (or my application) in case 2?

A: 

Please forget my posting...

Case 2 works fine too!

Daniel Murygin