Hi!
I'm running into a ClassCastException loading jndi DataSources. I configured the
resource in tomcats server.xml using the following entry (i do not mention web.xml
because its working with oracle application server):
<Resource name="jdbc/OracleDS" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/OracleDS">
<parameter><name>username</name><value>scott</value></parameter>
<parameter><name>password</name><value>tiger</value></parameter>
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
<parameter><name>url</name><value>jdbc:oracle:thin:@dbdemo:1521:ORA</value></parameter>
</ResourceParams>
The Source for DataSource lookup is here:
initCtx = new InitialContext();
envCtx = (Context) initCtx.lookup("java:comp/env");
dataSource = (DataSource) envCtx.lookup("jdbc/OracleDS");
con = dataSource.getConnection();
During runtime i get a ClassCastException when looking up the DataSource from the jndi
context:
java.lang.ClassCastException: tyrex.jdbc.xa.EnabledDataSource
Do i have to specify the parameter factory in ResourceParams? If yes, which factory?
Or is there something else wrong?
Thanks in advance!
Thomas Achleitner
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>