${renderedContent}
Quick Links to:
Converting an OC4J appilication to a Tomcat 7 application
- decorators.xml
- Open your project's applicationContext xml that contains the mitsisDataSource bean. The mitsisDataSource bean should look similar to:
Remember the value of the name property. In this example the value is jdbc/MitsisDS. This value will be the Resource Definition name used in the following steps.
<bean id="mitsisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/MitsisDS" /> </bean>
Change the jndiName value as shown below:by prefixing the existing jndiName value with java:comp/env/. Don't forget to use your Resource Definition name in place of jdbc/MitsisDS.<bean id="mitsisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/env/jdbc/MitsisDS" /> </bean>
When you are satisfied that everything is correct, save the changes. - Open your project's web.xml for editing and add the following after the <servlet-mapping> tags and before the <welcome-file-list> tag.
Don't forget to use your Resource Definition name in place of jdbc/MitsisDS.
<resource-ref> <description>Oracle Datasource</description> <res-ref-name>jdbc/MitsisDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
When you are satisfied that everything is correct, save the changes. - Open your Tomcat 7 server's context.xml, located at ${CATALINA_HOME}/conf/context.xml, and verify that a Resource Definition for your application exists.
If the Resource Definition does not exits, add the following anywhere between the <context> and </context> tags:Don't forget to use your Resource Definition name in place of jdbc/MitsisDS.<Resource name="jdbc/MitsisDs" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev2" username="XXXXXXXX" password="YYYYYYYY" maxActive="20" maxIdle="10" maxWait="-1" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="true" /> <ResourceLink global="jdbc/MitsisDS" name="jdbc/MitsisDS" type="javax.sql.DataSource"/>
When you are satisfied that everything is correct, save the changes. - Open the project's pom.xml and delete the following dependency:
and add the following dependency:
<dependency> <groupId>oracle</groupId> <artifactId>ojdbc</artifactId> <version>1.4</version> <scope>test</scope> </dependency>
When you are satisfied that everything is correct, save the changes.<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.3</version> <scope>test</scope> </dependency>
- search both Project Jar Dependencies and Project Test Jar Dependencies for any ojdbc-1.4.jar dependency and exclude the dependency