Reputation: 713
I have upgraded Tomcat from 7 to 9. I am getting exception while start up. It is throwing below exception:
oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver
context.xml has following :
<Resource auth="Container" driverClassName="oracle.jdbc.xa.client.OracleXADataSource"
logAbandoned="true" initialSize="1" maxActive="2" maxIdle="2"
minIdle="2" timeBetweenEvictionRunsMillis="34000"
inEvictableIdleTimeMillis="55000" validationQuery="SELECT 1 FROM DUAL"
validationInterval="34" testOnBorrow="true" removeAbandoned="true"
removeAbandonedTimeout="600" name="jdbc/regionalDS" password="XXX"
type="javax.sql.DataSource" url="jdbc:oracle:thin:@HOSTURL"
username="XXX" />
Please let me know, what changes I need to do.
Upvotes: 4
Views: 279
Reputation: 6120
Two things you can try :
1. Change the type
to type="javax.sql.XADataSource"
2. Check that the url is in the form of url="jdbc:oracle:thin:@your_host_name:port_say_1521:service_or_sid"
Upvotes: 2