-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Could not instantiate bean class [org.hibernate.cfg.Annotati
PostPosted: Fri Jan 19, 2007 8:52 am 
Newbie

Joined: Fri Dec 22, 2006 2:32 pm
Posts: 16
Hello,

I am trying to set up a project with an annotated Hibernate object with Spring. I have tried a number of different settings. Currently I have the following in spring-web.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>   
   <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="configLocation">
         <value>classpath:/hibernate.cfg.xml</value>
      </property>
   </bean>
   
     <bean id="svinnDao" class="no.norgesgruppen.bm.data.svinn.SvinnDao">
      <property name="sessionFactory"><ref local="mySessionFactory"/></property>
   </bean>

</beans>


With the following in hibernate.cfg.xml:

Code:
<!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.dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="connection.datasource">java:/MyDS</property>

      <mapping class="no.norgesgruppen.bm.data.svinn.SvinnData" />
     
   </session-factory>
</hibernate-configuration>


However, when I deploy to JBoss 4.0.5 I get the following:

Code:
13:46:18,005 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/spring-web.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by:
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Caused by:
java.lang.NoClassDefFoundError
        at org.hibernate.cfg.AnnotationConfiguration.reset(AnnotationConfiguration.java:230)
        at org.hibernate.cfg.Configuration.<init>(Configuration.java:187)
        at org.hibernate.cfg.Configuration.<init>(Configuration.java:191)
        at org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:87)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
.....


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 28, 2008 8:18 am 
Newbie

Joined: Sun Dec 28, 2008 7:59 am
Posts: 1
Did you ever find a solution to this? Im experiencing the same thing right now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.