最近事情较少然后自己看看一直听闻但没接触过的springmvc,却发现启动总是报bean未找到,具体信息:
1 INFO: Pre-instantiating singletons in org.s[email protected]1cba98ca: defining beans [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,start,org.springframework.web.servlet.view.UrlBasedViewResolver#0]; root of factory hierarchy 2 十一月 05, 2014 5:14:48 下午 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons 3 INFO: Destroying singletons in org.s[email protected]1cba98ca: defining beans [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,start,org.springframework.web.servlet.view.UrlBasedViewResolver#0]; root of factory hierarchy 4 十一月 05, 2014 5:14:48 下午 org.springframework.web.servlet.FrameworkServlet initServletBean 5 SEVERE: Context initialization failed 6 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 7 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 8 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) 9 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 10 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 11 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 12 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 13 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 14 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 15 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 16 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 17 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) 18 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) 19 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) 20 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 21 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) 22 at javax.servlet.GenericServlet.init(GenericServlet.java:212) 23 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) 24 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) 25 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) 26 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) 27 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 28 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) 29 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 30 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) 31 at org.apache.catalina.core.StandardService.start(StandardService.java:525) 32 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) 33 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 34 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 35 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 36 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 37 at java.lang.reflect.Method.invoke(Method.java:601) 38 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 39 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 40 Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 41 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250) 42 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576) 43 at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319) 44 at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392) 45 at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095) 46 at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:382) 47 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129) 48 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104) 49 at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) 50 at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) 51 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 52 at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) 53 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) 54 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) 55 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) 56 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 57 ... 31 more 58 Caused by: java.lang.ClassNotFoundException: java.action.StartController 59 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) 60 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 61 at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) 62 at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 63 at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271) 64 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242) 65 ... 46 more 66 Related cause: 67 org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 68 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250) 69 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576) 70 at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319) 71 at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:315) 72 at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:394) 73 at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1146) 74 at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275) 75 at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.initInterceptors(AbstractUrlHandlerMapping.java:168) 76 at org.springframework.web.servlet.handler.AbstractHandlerMapping.initApplicationContext(AbstractHandlerMapping.java:110) 77 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103) 78 at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) 79 at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) 80 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 81 at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) 82 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) 83 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) 84 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) 85 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 86 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 87 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 88 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 89 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 90 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 91 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 92 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 93 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 94 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) 95 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) 96 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) 97 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 98 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) 99 at javax.servlet.GenericServlet.init(GenericServlet.java:212) 100 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) 101 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) 102 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) 103 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) 104 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 105 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) 106 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 107 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) 108 at org.apache.catalina.core.StandardService.start(StandardService.java:525) 109 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) 110 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 111 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 112 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 113 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 114 at java.lang.reflect.Method.invoke(Method.java:601) 115 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 116 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 117 Caused by: java.lang.ClassNotFoundException: java.action.StartController 118 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) 119 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 120 at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) 121 at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 122 at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271) 123 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242) 124 ... 48 more 125 126 十一月 05, 2014 5:14:48 下午 org.apache.catalina.core.ApplicationContext log 127 SEVERE: StandardWrapper.Throwable 128 org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 129 Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 130 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) 131 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 132 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 133 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 134 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 135 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 136 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 137 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 138 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 139 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) 140 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) 141 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) 142 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 143 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) 144 at javax.servlet.GenericServlet.init(GenericServlet.java:212) 145 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) 146 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) 147 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) 148 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) 149 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 150 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) 151 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 152 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) 153 at org.apache.catalina.core.StandardService.start(StandardService.java:525) 154 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) 155 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 156 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 157 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 158 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 159 at java.lang.reflect.Method.invoke(Method.java:601) 160 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 161 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 162 Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 163 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250) 164 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576) 165 at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319) 166 at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392) 167 at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095) 168 at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:382) 169 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129) 170 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104) 171 at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) 172 at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) 173 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 174 at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) 175 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) 176 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) 177 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) 178 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 179 ... 31 more 180 Caused by: java.lang.ClassNotFoundException: java.action.StartController 181 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) 182 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 183 at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) 184 at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 185 at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271) 186 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242) 187 ... 46 more 188 Related cause: 189 org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [java.action.StartController] for bean with name ‘start‘ defined in ServletContext resource [/WEB-INF/mvc-servlet.xml]; nested exception is java.lang.ClassNotFoundException: java.action.StartController 190 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1250) 191 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576) 192 at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319) 193 at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:315) 194 at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:394) 195 at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1146) 196 at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275) 197 at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.initInterceptors(AbstractUrlHandlerMapping.java:168) 198 at org.springframework.web.servlet.handler.AbstractHandlerMapping.initApplicationContext(AbstractHandlerMapping.java:110) 199 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103) 200 at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) 201 at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) 202 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 203 at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) 204 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) 205 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) 206 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) 207 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 208 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 209 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 210 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 211 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 212 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 213 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 214 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 215 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 216 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) 217 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) 218 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) 219 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 220 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) 221 at javax.servlet.GenericServlet.init(GenericServlet.java:212) 222 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) 223 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) 224 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) 225 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) 226 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 227 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) 228 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 229 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) 230 at org.apache.catalina.core.StandardService.start(StandardService.java:525) 231 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) 232 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 233 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 234 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 235 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 236 at java.lang.reflect.Method.invoke(Method.java:601) 237 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 238 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 239 Caused by: java.lang.ClassNotFoundException: java.action.StartController 240 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) 241 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 242 at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) 243 at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 244 at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271) 245 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242) 246 ... 48 more 247 248 十一月 05, 2014 5:14:48 下午 org.apache.catalina.core.StandardContext loadOnStartup 249 SEVERE: Servlet /SLearn1 threw load() exception 250 java.lang.ClassNotFoundException: java.action.StartController 251 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) 252 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) 253 at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) 254 at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 255 at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271) 256 at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242) 257 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576) 258 at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1319) 259 at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392) 260 at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095) 261 at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:382) 262 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129) 263 at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104) 264 at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119) 265 at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72) 266 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 267 at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106) 268 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) 269 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394) 270 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413) 271 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 272 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 273 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 274 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 275 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 276 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 277 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 278 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 279 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 280 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) 281 at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) 282 at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) 283 at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) 284 at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) 285 at javax.servlet.GenericServlet.init(GenericServlet.java:212) 286 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1213) 287 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026) 288 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421) 289 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734) 290 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 291 at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) 292 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) 293 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) 294 at org.apache.catalina.core.StandardService.start(StandardService.java:525) 295 at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) 296 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 297 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 298 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 299 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 300 at java.lang.reflect.Method.invoke(Method.java:601) 301 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 302 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
检查xml配置代码拼写全无问题,在调试到ClassLoader.loadclass(name) 时想起了,路径和包名的问题
原包名是java.action改成main.java.action就没问题了
总结:引发这个问题的本质我不清楚,对于ClassLoader.loadclass(name)的原理不清楚,这里也不乱说了。不过这个问题的原因可能是报名取成java.*,最终导致springmvc加载bean类的时候name=java.*直接去jdk中的jar包中去加载对应的类了,最后始终找不到。
时间: 2024-10-11 09:56:20