OracleXADataSource with Tomcat 8

1,810 views
Skip to first unread message

Riaz Tai

unread,
Dec 9, 2015, 5:29:59 AM12/9/15
to Hippo Community
We have been running Hippo 7.9.8 on Tomcat 7 and in preparation for upgrading to Hippo 10, we wanted to first upgrade Tomcat to the latest version and ensure the existing application using 7.9.8 works as expected.

Having installed Tomcat 8 and configured the instance (common lib, shared lib etc), during start up we are seeing the following exception while the CMS tries to connect the repository.

WARNING: Unexpected exception resolving reference
java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.xa.client.OracleXADataSource' for connect URL 'jdbc:oracle:thin:@//192.168.23.79:1521/HIPPOQ'
        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2160)
.......................
Caused by: java.lang.ClassCastException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver
        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2149)

If we change the datasource to use oracle.jdbc.OracleDriver then it works but the OracleXADataSource was working with Tomcat 7.

This is probably a Tomcat issue but was wondering if anyone else has experienced it?

Thanks in advance

Riaz Tai

unread,
Dec 9, 2015, 6:32:37 AM12/9/15
to Hippo Community
Under Tomcat 7 we had the following configuration in the context.xml file

<Resource
name="jdbc/repositoryDS" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxActive="100" maxIdle="40" minIdle="2" initialSize="2" maxWaitMillis="10000" 
                testWhileIdle="true" testOnBorrow="false" validationQuery="select 1 from dual"
                timeBetweenEvictionRunsMillis="10000" minEvictableIdleTimeMillis="60000"
username="username" password="password"
driverClassName="oracle.jdbc.xa.client.OracleXADataSource"
url="jdbc:oracle:thin:@//192.168.23.79:1521/HIPPOQ" />

Michiel Eggermont

unread,
Dec 9, 2015, 6:41:06 AM12/9/15
to hippo-c...@googlegroups.com
On Wed, Dec 9, 2015 at 12:32 PM, Riaz Tai <riaz...@gmail.com> wrote:
Under Tomcat 7 we had the following configuration in the context.xml file

<Resource
name="jdbc/repositoryDS" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxActive="100" maxIdle="40" minIdle="2" initialSize="2" maxWaitMillis="10000" 
                testWhileIdle="true" testOnBorrow="false" validationQuery="select 1 from dual"
                timeBetweenEvictionRunsMillis="10000" minEvictableIdleTimeMillis="60000"
username="username" password="password"
driverClassName="oracle.jdbc.xa.client.OracleXADataSource"
url="jdbc:oracle:thin:@//192.168.23.79:1521/HIPPOQ" />


Could  you change type="javax.sql.DataSource" to  type="javax.sql.XADataSource" and see what happens?



On Wednesday, December 9, 2015 at 10:29:59 AM UTC, Riaz Tai wrote:
We have been running Hippo 7.9.8 on Tomcat 7 and in preparation for upgrading to Hippo 10, we wanted to first upgrade Tomcat to the latest version and ensure the existing application using 7.9.8 works as expected.

Having installed Tomcat 8 and configured the instance (common lib, shared lib etc), during start up we are seeing the following exception while the CMS tries to connect the repository.

WARNING: Unexpected exception resolving reference
java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.xa.client.OracleXADataSource' for connect URL 'jdbc:oracle:thin:@//192.168.23.79:1521/HIPPOQ'
        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2160)
.......................
Caused by: java.lang.ClassCastException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver
        at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2149)

If we change the datasource to use oracle.jdbc.OracleDriver then it works but the OracleXADataSource was working with Tomcat 7.

This is probably a Tomcat issue but was wondering if anyone else has experienced it?

Thanks in advance

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Bart van der Schans

unread,
Dec 9, 2015, 6:59:18 AM12/9/15
to hippo-c...@googlegroups.com
You should indeed use the oracle.jdbc.OracleDriver. Please see also
the documented on
http://www.onehippo.org/library/deployment/configuring/configuring-hippo-for-oracle-database.html

Regards,
Bart



>
> This is probably a Tomcat issue but was wondering if anyone else has
> experienced it?
>
> Thanks in advance
>
> --
> Hippo Community Group: The place for all discussions and announcements about
> Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups
> "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hippo-communi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.



--
---
Hippo B.V. - Oosteinde 11, 1017 WT Amsterdam
Hippo USA, Inc. - 71 Summer Street, 2nd Floor, Boston, MA 02110

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Riaz Tai

unread,
Dec 9, 2015, 10:05:01 AM12/9/15
to Hippo Community
Using the type= javax.sql.XADataSource results in a different exception where it complains of not finding the JNDI resource.

Riaz Tai

unread,
Dec 9, 2015, 10:06:14 AM12/9/15
to Hippo Community
This was a change that was recommended by Hippo. We used to use the oracle.jdbc.OracleDriver initially with 7.9.8 but were advised to change it to XAOracleDriver. 
Reply all
Reply to author
Forward
0 new messages