2 Replies Latest reply on Mar 5, 2013 12:57 AM by Prashant Mishra

    org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6

    Prashant Mishra Newbie

      I am using datasource in the jboss and used it in my project which have Spring,Hibernate and JSF.

      When I try to get the connection using the below code

      DataSource cpds = (DataSource)ctx.getBean("datasource")

      WrappedConnectionJDK6 conn = (WrappedConnectionJDK6)cpds.getConnection();

      I will get the exception

      org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6

      I have configure the data source in applicationContext.xml :

       

      <bean id="datasource" class="org.springframework.jndi.JndiObjectFactoryBean">

                  <property name="jndiName" value="java:jboss/Cnv92xf" />

          </bean>

       

      pls help