You installed:
Tomcat 5.5 (with extra admin utility)
Oracle XE
JDeveloper 10.1.2
Let me first suggest backing up the server.xml configuration file of Tomcat 5.5 because that got corrupted several times during restarting Tomcat 5.5. Or just the entire Tomcat 5.5 directory with exception of the temp directory.
You've created a ADF application in JDeveloper. It runs normally in your internal OC4J server. But you now want to deploy it to Tomcat 5.5 and use JNDI.
Place this context.xml file in a META-INF directory in your webroot and deploy it together with your application (war file). This will be used by Tomcat to configure the deployed application and create a JNDI database connection for that application.
<?xml version="1.0" encoding="UTF-8"?>
<Context
antiJARLocking="true"
antiResourceLocking="true"
reloadable="true">
<Resource
auth="Container"
name="jdbc/OracleDS"
type="oracle.jdbc.pool.OracleConnectionPoolDataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
validationQuery="select sysdate from dual"
url="jdbc:oracle:thin:scott/tiger@localhost:1521:XE"
maxActive="10"/>
<Manager
className="org.apache.catalina.session.PersistentManager"
saveOnRestart="false"/>
</Context>
Mind you that this will create a <webroot>.xml file in .\conf\Catalina\localhost directory.
For more details see Tomcat 5.5 documentation on how to fine-tune your context.xml file. In this case I added some extras to enable redeployments without locking of files and having to restart Tomcat.
You can create a server wide JNDI entry if you want to avoid username/password being distributed in your war file. Mind you with the current admin configuration (which is seperate from Tomcat installation nowadays) you cannot see or edit the JNDI entry with the admin web tool.So editting has to be done manually.
Two main entries are 'type' and 'factory' which were tricky because lack of documentation. In this case they have to be Oracle specific because the internal Tomcat JDBC delegator cannot handle JDBC calls to Oracle the oracle JDBC driver resulting in JBO error types.
I was fortunate enough to find Steve Muench article who wrote about configuring Tomcat 4.x (
http://radio.weblogs.com/0118231/stories/2003/08/08/installingTheBc4jToyStoreOnApacheTomcat4124.html) with an explanation about types and factories.
Because of changes in Tomcat 5.x they redefined configuration for JNDI entries so basicly what I did was to remap Steve's suggestions to the new 5.5 structure and using some workarounds. Like using username and password parameters doesn't work so using them in the JDBC url was for me the working solution.
Your project has to be adapted to use JNDI.
Configure your (main) application module by copying the <name>Local configuration into a eg. <name>Tomcat55.
Change connection type in JDBC Datasource and use eg. java:comp/env/jdbc/OracleDS as JNDI name. JNDI naming can get tricky so specifying the full pathname is probably the best way to go. You might use the name parameter of the context.xml file instead.
I didn't test this but it might work.
Configure your databindings file to use this new configuration. (<name>AppModuleDataControl)
Create a deployment profile for the application for Tomcat 5.x where you have to specify the location of your Tomcat webapps directory.
You know should be able to deploy your application to Tomcat 5.5 and test it out.
Good luck!