[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - PB with wrapping my oracledatasource

clodeindustrie do-not-reply at jboss.com
Wed Jul 12 05:51:18 EDT 2006


hi,
I'm trying to use an Oracledatasource to acces my db from a servlet but I' have an error:
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource

here is my code:
Context ctx;

try {
ctx = new InitialContext();
OracleDataSource ds;
ds = (OracleDataSource) ctx.lookup("java:OracleDS");

OracleConnection connection;
try {
connection = (OracleConnection) ds.getConnection();
PrintWriter out = reponse.getWriter();
....
.....
The line that bug is underlined, it seems that I Can't cast anything with an oraclesomething whatever it's an oracleconnection, oracledatasource etc..
I think my datasource is well configured (see below)


<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@localhost:1521:ORCL</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>jeremy</user-name>
taeslin <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

<type-mapping>Oracle9i</type-mapping>

</local-tx-datasource>


So if anybody could help me, i would be very pleased :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957286#3957286

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957286



More information about the jboss-user mailing list