-->
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.  [ 3 posts ] 
Author Message
 Post subject: java.lang.NoClassDefFoundError: net/sf/hibernate/Session
PostPosted: Wed Nov 23, 2005 4:52 am 
Newbie

Joined: Wed Nov 23, 2005 4:42 am
Posts: 1
I have created web project in Eclipse. I am using Jboss server.After deploying my project to Jboss I get the following error when i start my server .I am using Hibernate 3 jars.

13:43:21,839 ERROR [ContextLoader] Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CustomerDAO' defined in ServletContext resource [/WEB-INF/hello.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/Session

java.lang.NoClassDefFoundError: net/sf/hibernate/Session

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)

at java.lang.Class.getDeclaredMethods(Class.java:1763)

at java.beans.Introspector$1.run(Introspector.java:1265)

at java.security.AccessController.doPrivileged(Native Method)

at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)

at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)

at java.beans.Introspector.getBeanInfo(Introspector.java:387)

at java.beans.Introspector.getBeanInfo(Introspector.java:159)

at java.beans.Introspector.getBeanInfo(Introspector.java:220)

at java.beans.Introspector.<init>(Introspector.java:368)

at java.beans.Introspector.getBeanInfo(Introspector.java:159)

at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:143)

at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:84)

at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanWrapperImpl.java:365)

at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:323)

at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:305)

at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:187)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:454)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:333)

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:275)

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:3669)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)

at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.apache.catalina.core.StandardContext.init(StandardContext.java:5005)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)

at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:274)

at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:91)

at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:357)

at org.jboss.web.WebModule.startModule(WebModule.java:68)

at org.jboss.web.WebModule.startService(WebModule.java:46)

at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)

at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)

at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)

at $Proxy0.start(Unknown Source)

at org.jboss.system.ServiceController.start(ServiceController.java:418)

at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

at $Proxy36.start(Unknown Source)

at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:394)

at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)

at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)

at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

at $Proxy8.deploy(Unknown Source)

at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)

at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)

at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)

at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)

at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)

at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)

at $Proxy0.start(Unknown Source)

at org.jboss.system.ServiceController.start(ServiceController.java:418)

at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

at $Proxy4.start(Unknown Source)

at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)

at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)

at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)

at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)

at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)

at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)

at $Proxy5.deploy(Unknown Source)

at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)

at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)

at org.jboss.Main.boot(Main.java:195)

at org.jboss.Main$1.run(Main.java:463)

at java.lang.Thread.run(Thread.java:595)



Can anyone tell me why this error is coming


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 4:55 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
If you are using Hibernate 3, you shouldnt be having class referenced as
net.sf.hibernate.*, they should be
org.hibernate.*
Please check your classes to make sure that you dont point classes that were in Hibernate 2.x


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 12:29 pm 
Beginner
Beginner

Joined: Tue Jul 05, 2005 4:44 am
Posts: 40
Location: Paris, France
Hi,

I think your problem comes from Spring Configuration.

For example, If you uses a session factory, the package is
Code:
org.springframework.orm.hibernate3.LocalSessionFactoryBean
and not
Code:
org.springframework.orm.hibernate.LocalSessionFactoryBean


More info: http://www.springframework.org/docs/api ... mmary.html

Bye !!

_________________
Fred


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