2 a512592151 a512592151 于 2014.08.27 16:46 提问

tomcat 加载ssh,运行服务器的时候报错,请大神赐教!

主要是这个错误:java.lang.NoClassDefFoundError: Lorg/hibernate/SessionFactory;
比较全的错误如下:
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultLista
bleBeanFactory@1cad7d80: defining beans [testAction,testService,org.springframework.contex
t.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.inte
rnalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAn
notationProcessor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0
,dataSource,sessionFactory,transactionManager,org.springframework.aop.config.internalAutoP
roxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSourc
e#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframewo
rk.transaction.config.internalTransactionAdvisor,org.springframework.beans.factory.config.
PropertyPlaceholderConfigurer#1]; root of factory hierarchy
2014-8-27 11:49:01 org.springframework.web.context.ContextLoader initWebApplicationContext
严重: Context initialization failed
java.lang.NoClassDefFoundError: Lorg/hibernate/SessionFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2300)
at java.lang.Class.getDeclaredFields(Class.java:1745)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:516)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:500)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.findResourceM
etadata(CommonAnnotationBeanPostProcessor.java:319)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMe
rgedBeanDefinition(CommonAnnotationBeanPostProcessor.java:277)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMerg
edBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:745)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateB
ean(AbstractAutowireCapableBeanFactory.java:448)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(Abs
tractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBea
n(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBean
Factory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(De
faultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFa
ctory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSin
gletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitia
lization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplica
tionContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoade
r.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.
java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoader
Listener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142
)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.hibernate.SessionFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 47 more
2014-8-27 11:49:01 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springfr
amework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: Lorg/hibernate/SessionFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2300)
at java.lang.Class.getDeclaredFields(Class.java:1745)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:516)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:500)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.findResourceM
etadata(CommonAnnotationBeanPostProcessor.java:319)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMe
rgedBeanDefinition(CommonAnnotationBeanPostProcessor.java:277)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMerg
edBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:745)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateB
ean(AbstractAutowireCapableBeanFactory.java:448)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(Abs
tractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBea
n(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBean
Factory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(De
faultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFa
ctory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact
ory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSin
gletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitia
lization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplica
tionContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoade
r.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.
java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoader
Listener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142
)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.hibernate.SessionFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 47 more
2014-8-27 11:49:01 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2014-8-27 11:49:01 org.apache.catalina.core.StandardContext start

2个回答

xu222131
xu222131   2014.08.27 17:04

刚帮忙瞧了下 如果用的包没有缺少的话可能就是如下的原因咯
转:http://jarg.iteye.com/blog/1729745

xu222131
xu222131 问题的体现应该是在applicationContext.xml里面的数据源配置上面 可以贴出来分析分析
3 年多之前 回复
a512592151
a512592151 请问还有其他方法解决吗
3 年多之前 回复
a512592151
a512592151 包没用少,但是用的包是spring2.5,hibernate3的包
3 年多之前 回复
xu222131
xu222131   2014.08.27 17:25

问题的体现应该是在applicationContext.xml里面的数据源配置上面 可以贴出来分析分析

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!