We are trying to use environment-specific configuration settings from our war files, so we can deploy the same war file on dev / test / prod tomcat servers and not change the contents of the war configuration file.
When I move META-INF / context.xml to connect the database to conf / server.xml, the connection to the database no longer works, with the following error, does anyone know why this would be?
server.xml
<GlobalNamingResources>
....
<Resource
url="jdbc:oracle:thin:@hostname:1521/something"
username="username"
name="jdbc/mydb"
password="password"
auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="5" maxIdle="2" maxWait="10000"
removeAbandoned="true"
type="javax.sql.DataSource"
/>
</GlobalNamingResources>
The error is as follows:
INFO: Deploying web application directory ROOT
Problem reading system configuration. Cannot create JDBC driver of class '' for connect URL 'null' (java.io.IOException: Cannot create JDBC driver of class '' for connect URL 'null')
java.io.IOException: Cannot create JDBC driver of class '' for connect URL 'null'
at au.edu.unimelb.helper.SettingManager.loadSettings(SettingManager.java:212)
at au.edu.unimelb.helper.SettingManager.<init>(SettingManager.java:53)
(And yes, the odjbc6.jar file is in $ TOMCAT_HOME / lib /)
Jacob source
share