${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:
The jndiName value may be different.
<bean id="mitsisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/MitsisDS" /> </bean>
Change the jndiName value as shown below:prefixing the existing value with java:comp/end/.<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.
applicationContext-config.xml - id="mitsisDataSource" - web.xml - add
<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>
- pom.xml - replace
with
<dependency> <groupId>oracle</groupId> <artifactId>ojdbc</artifactId> <version>1.4</version> <scope>test</scope> </dependency>
<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
- CATALINA_HOME - Add resource definition
<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"/>