问题描述
严重: action: nullorg.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Bean class [org.springframework.orm.hibertnate3.LocalSessionFactoryBean] not found; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibertnate3.LocalSessionFactoryBeanjava.lang.ClassNotFoundException: org.springframework.orm.hibertnate3.LocalSessionFactoryBeanat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:242)at org.springframework.util.ClassUtils.forName(ClassUtils.java:108)at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:65)at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:426)at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:392)at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:307)at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:295)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:269)at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:353)at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:296)at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:225)at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)at javax.servlet.GenericServlet.init(GenericServlet.java:212)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)at org.apache.catalina.core.StandardService.start(StandardService.java:448)at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:552)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.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)2008-8-1 13:15:26 org.apache.catalina.core.ApplicationContext log信息: Marking servlet action as unavailable2008-8-1 13:15:26 org.apache.catalina.core.StandardContext loadOnStartup严重: Servlet /LoginTest threw load() exceptionjavax.servlet.UnavailableExceptionat org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:880)at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)at javax.servlet.GenericServlet.init(GenericServlet.java:212)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)at org.apache.catalina.core.StandardService.start(StandardService.java:448)at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:552)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.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)2008-8-1 13:15:26 org.apache.coyote.http11.Http11Protocol start信息: Starting Coyote HTTP/1.1 on http-80872008-8-1 13:15:26 org.apache.jk.common.ChannelSocket init信息: JK: ajp13 listening on /0.0.0.0:80092008-8-1 13:15:26 org.apache.jk.server.JkMain start信息: Jk running ID=0 time=0/47 config=null2008-8-1 13:15:26 org.apache.catalina.startup.Catalina start信息: Server startup in 4421 ms2008-8-1 13:15:44 org.apache.catalina.core.StandardWrapperValve invoke信息: Servlet action is currently unavailable明明导入了spring-hibernate的jar包,而且在类里面也可以点出来的,为什么在这里报找不到org.springframework.orm.hibertnate3.LocalSessionFactoryBean类
解决方案
struts交给spring管理了吗? 你的spring配置文件加载有错吧, 仔细看看你的spring启动方式还有配置文件的位置是否正确。
解决方案二:
你把Spring.jar这个包导入试一下,可能是Myeclipse没有把这个包导入工程里
解决方案三:
试试把spring-orm.jar这个包也放在项目的lib目录,应该是缺少这个包
解决方案四:
是你的 bean 没有交给 spring 管理 的原因吧!你可以看看这个!http://yangyansong2006.spaces.live.com/blog/cns!2061a82c7437a609!171.entry