tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rémy Maucherat <r...@apache.org>
Subject Re: Strange behavior on Tomcat 9.0.5 about ResourceLink's "name" attribute in server.xml
Date Thu, 08 Mar 2018 16:52:13 GMT
On Thu, Mar 8, 2018 at 5:26 PM, Tarin Gamberini <taringamberini@gmail.com>
wrote:

> Hi everybody,
>
> I have found a strange behavior on Tomcat 9.0.5 (originally on Tomcat
> 8.5.28).
>
>
> # PROBLEM
>
> I have two datasources in the same web application:
>
>     <ResourceLink global="jdbc/abc/ABC" name="jdbc/abc"
> type="javax.sql.DataSource"/>
>     <ResourceLink global="jdbc/abc/jkl/XXX_YYY" name="jdbc/abc/jkl"
> type="javax.sql.DataSource"/>
>
> Starting the server I get an "java.lang.ClassCastException:
> org.apache.tomcat.dbcp.dbcp2.BasicDataSource cannot be cast to
> javax.naming.Context" ERROR.
>

Well, you have "abc" that s already bound and is a datasource, then you try
to create a subcontext "abc" and it doesn't work. Try using better paths
instead so that "abc" doesn't have to be both a subcontext and a datasource.

Rémy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message