-->
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.  [ 5 posts ] 
Author Message
 Post subject: Migration Hibernate 3 .......... SessionFactory don't create
PostPosted: Thu Sep 01, 2005 10:08 am 
Newbie

Joined: Wed Jul 20, 2005 6:08 am
Posts: 8
I migrate from HIbernate 2.1.6 to Hibernate 3, but when I compile and deploy my webapplication, this is the error log:

[InformaticaTorVergata] ERROR [http-8080-Processor23] ContextLoader.initWebApplicationContext(177) | Context initializationfailed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
java.lang.NoClassDefFoundError
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:777)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:703)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
at org.apache.catalina.core.StandardHostDeployer.start(StandardHostDeployer.java:830)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:991)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1322)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:530)
at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:104)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)


I check my source codes and my applicationContext-hibernate.xml twice with migration guide, but the result is same.


<b>My ApplicationContext-Hibernate.xml is this:</b>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">
<ref bean="dataSource"/>
</property>

<property name="mappingResources">
<list>
<value>org/infotv/model/bo/BoardBO.hbm.xml</value>
<value>org/infotv/model/bo/CommitmentBO.hbm.xml</value>
<value>org/infotv/model/bo/CompanyBO.hbm.xml</value>
<value>org/infotv/model/bo/DocumentBO.hbm.xml</value>
<value>org/infotv/model/bo/ExamBO.hbm.xml</value>
<value>org/infotv/model/bo/InfoServiceBO.hbm.xml</value>
<value>org/infotv/model/bo/LessonBO.hbm.xml</value>
<value>org/infotv/model/bo/LinkBO.hbm.xml</value>
<value>org/infotv/model/bo/MessageBO.hbm.xml</value>
<value>org/infotv/model/bo/StageBO.hbm.xml</value>
<value>org/infotv/model/bo/TextbookBO.hbm.xml</value>
<value>org/infotv/model/bo/UserBO.hbm.xml</value>
<value>org/infotv/model/bo/WeeklyEventBO.hbm.xml</value>
<value>org/infotv/model/bo/BookingBO.hbm.xml</value>
</list>
</property>

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.c3p0.minPoolSize">5</prop>
<prop key="hibernate.c3p0.maxPoolSize">20</prop>
<prop key="hibernate.timeout">1800</prop>
<prop key="hibernate.max_statement">50</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.connection.release_mode">on_close</prop>
<prop key="hibernate.connection.readOnly">false</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
</props>
</property>
</bean>

My DatabaseServer is MySQL 4.1
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 10:21 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
did you make sure to upgrade spring to version 1.2.4.

the package
org.springframework.orm.hibernate3.* does not exist in older versions of spring.


Top
 Profile  
 
 Post subject: I'm using just Spring 1.2.4
PostPosted: Thu Sep 01, 2005 10:24 am 
Newbie

Joined: Wed Jul 20, 2005 6:08 am
Posts: 8
I'm using Spring 1.2.4, Hibernate 3.0.5, Struts 1.2.4.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 10:40 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
your hibernate.xml file appears to be fine, I can't tell much more information from that error log.

I'd have to recommend making sure your classpath is cleaned up, and you have no duplicate jar files conflicting with the build, make sure to keep all the jar files that came with the new version of hibernate3.

I don't know anything about struts.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 11:16 am 
Newbie

Joined: Wed Jul 20, 2005 6:08 am
Posts: 8
Thanks I resolve to change in bena DataSource jdbc connector:
before I have used org.springframework.jdbc.datasource.DriverManagerDataSource,
now i'm using org.apache.commons.dbcp.BasicDataSource.

Thanks for your helps


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.