问题描述
以为tomcat的报错!!严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.CannotLoadBeanClassException:Cannotfindclass[com.shunshi.dao.impl.user.UserDAOImpl]forbeanwithname'userDao'definedinServletContextresource[/WEB-INF/applicationContext.xml];nestedexceptionisjava.lang.ClassNotFoundException:com.shunshi.dao.impl.user.UserDAOImplCausedby:java.lang.ClassNotFoundException:com.shunshi.dao.impl.user.UserDAOImplatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)atorg.springframework.util.ClassUtils.forName(ClassUtils.java:229)atorg.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:327)atorg.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1073)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4630)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)atorg.apache.catalina.core.StandardHost.start(StandardHost.java:785)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)atorg.apache.catalina.core.StandardService.start(StandardService.java:519)atorg.apache.catalina.core.StandardServer.start(StandardServer.java:710)atorg.apache.catalina.startup.Catalina.start(Catalina.java:581)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)2011-4-1310:21:15org.apache.catalina.core.StandardContextstart严重:ErrorlistenerStart2011-4-1310:21:15org.apache.catalina.core.StandardContextstart严重:Context[/mytest]startupfailedduetopreviouserrors以下是Spring的配置!<aop:config><aop:pointcutid="serviceOperation"expression="execution(*com.shunshi.service.impl.*.*.*(..))"/><aop:advisoradvice-ref="txAdvice"pointcut-ref="serviceOperation"/></aop:config><!--Dao层的托管--><beanid="userDao"class="com.shunshi.dao.impl.user.UserDAOImpl"><propertyname="sessionFactory"ref="sessionFactory"/></bean><!--Service层的托管--><beanid="userService"class="com.shunshi.service.impl.user.UserServiceImpl"><propertyname="userDao"ref="userDao"></property></bean><!--Action层的托管--><beanid="userAction"class="com.shunshi.web.action.user.SaveUserAction"scope="prototype"><propertyname="userService"ref="userService"/></bean>跪求高人指出错误问题!!
解决方案
解决方案二:
帮顶。startupfailedduetopreviouserrors(由于以前的错误启动失败)
解决方案三:
已经解决了~是因为UserDAOImpl的名字与DAO的class不对应!