Tomcat datasource was expected to return an instance of [org.apache.tomcat.jdbc.pool.DataSource] but returned an instance of [org.apache.tomcat.jdbc.pool.DataSource]

Solution Unverified - Updated -

Issue

  • We see an error like the following at start up with a datasource configured in tomcat:
java.lang.IllegalArgumentException: The local resource link [myDS] that refers to global resource [jdbc/myDS] was expected to return an instance of [org.apache.tomcat.jdbc.pool.DataSource] but returned an instance of [org.apache.tomcat.jdbc.pool.DataSource]
    at org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:163)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:857)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:174)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:163)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)

Environment

  • JBoss Web Server (JWS) 5.x
    • Tomcat 9.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In