I have apache tomcat 5.5.28 on my windows box and I am trying to deploy a web application (WAR) which works fine on other servers.
However I am having trouble creating a datasource. I am not sure of the format. The db is oracle.
Here is what I have in server.xml.
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
name="tomdb11"
type="oracle.jdbc.pool.OracleDataSource"
maxActive="4"
maxIdle="2"
username="tomdb11"
maxWait="5000"
driverClassName="oracle.jdbc.driver.OracleDriver"
validationQuery="select * from dual"
password="remotedb11"
url="jdbc:oracle:thin:@dbserver:1521:orcl"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
</GlobalNamingResources>
How do I access this in the web.xml where usually what I have which works in other servers is
<context-param>
<param-name>databaseUser</param-name>
<param-value>tomdb11</param-value>
</context-param>
<context-param>
<param-name>databasePassword</param-name>
<param-value>tomdb11</param-value>
</context-param>
<context-param>
<param-name>databaseSchema</param-name>
<param-value>TOMDBADMINN11</param-value>
</context-param>
Also am I missing something?
Edit: I get the following exception:
javax.naming.NameNotFoundException: Name tomdb11 is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.taw.database.DatabaseService.<init>(DatabaseService.java:19)
at com.taw.database.DatabaseServices.init(DatabaseServices.java:40)