Hi all,
I am getting this exception after I try to load my app. I have the necessary hibernate jars in my classpath namely hibernate3.jar, hibernate-annotations.jar, hibernate-entitymanager.jar and hibernate-commons-annotations.jar. I have configured hibernate through spring. Here is my spring config:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/db"></property>
<property name="username" value="abc"></property>
<property name="password" value="abc123"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>com.gex.domain.NewAccount</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQ LDialect</prop>
</props>
</property>
</bean>
I also tried using a hibernate.properties file with the database settings but that did not help either.
The exception trace is:
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/gex-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.Anno tationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Configuration
Any help with this issue will be greatly appreciated. Thanks in advance.
I am getting this exception after I try to load my app. I have the necessary hibernate jars in my classpath namely hibernate3.jar, hibernate-annotations.jar, hibernate-entitymanager.jar and hibernate-commons-annotations.jar. I have configured hibernate through spring. Here is my spring config:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/db"></property>
<property name="username" value="abc"></property>
<property name="password" value="abc123"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>com.gex.domain.NewAccount</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQ LDialect</prop>
</props>
</property>
</bean>
I also tried using a hibernate.properties file with the database settings but that did not help either.
The exception trace is:
Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/gex-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.Anno tationSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.Configuration
Any help with this issue will be greatly appreciated. Thanks in advance.
Comment