Hi
i get the follwoing error when i try connecting database from hibernate through JNDI .
Code:
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource
at com.test.hibernate.generated.InsuranceHome.getSessionFactory(InsuranceHome.java:48)
at com.tes.thibernate.generated.InsuranceHome.<init>(InsuranceHome.java:24)
at com.test.hibernate.generated.InsuranceDao.getdata(InsuranceDao.java:29)
at test.FirstBeanController.retriveData(FirstBeanController.java:16)
Can any body hepl me out in this..
My hibernate cfg file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">java:/MySqlDS</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hbm2ddl.auto">none</property>
<property name="cache.use_second_level_cache">false</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<mapping resource="com/sellermania/hibernate/generated/insurance.hbm.xml"/>
</session-factory>
</hibernate-configuration>