嗨,我是春天和Tomcat的新手,
我尝试将我的prject(spring-java)war文件部署到Tomcat 8.0服务器,但是当我部署该战争时,即使在Web应用程序管理器上可以看到我也无法启动应用程序。它说: “失败 - 无法启动上下文路径/ HandInHand中的应用程序”
localhost_date.log的日志文件,如下所示;
07-Nov-2014 00:07:19.664 INFO [http-nio-8088-exec-135] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
07-Nov-2014 00:07:19.726 INFO [http-nio-8088-exec-135] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
07-Nov-2014 00:07:20.685 SEVERE [http-nio-8088-exec-135] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'daoAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider' defined in ServletContext resource [/WEB-INF/spring/app-context-security.xml]: Cannot resolve reference to bean 'userService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.service.UserServiceImpl] for bean with name 'userService' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/service/UserServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/service/UserServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.service.UserServiceImpl)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.controller.HomeController] for bean with name 'homeController' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/controller/HomeController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/controller/HomeController : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.controller.HomeController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.service.TagServiceImpl] for bean with name 'tagService' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/service/TagServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/service/TagServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.service.TagServiceImpl)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.service.UserServiceImpl] for bean with name 'userService' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/service/UserServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/service/UserServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.service.UserServiceImpl)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.dao.BaseDaoImpl] for bean with name 'baseDaoImpl' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/dao/BaseDaoImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/dao/BaseDaoImpl : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.dao.BaseDaoImpl)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.dao.TagOwnerDao] for bean with name 'tagOwnerDao' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/dao/TagOwnerDao.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/dao/TagOwnerDao : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.dao.TagOwnerDao)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.dao.UserDao] for bean with name 'userDao' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/dao/UserDao.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/dao/UserDao : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.dao.UserDao)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.dao.TagDao] for bean with name 'tagDao' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/dao/TagDao.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/dao/TagDao : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.dao.TagDao)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1265)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:673)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:618)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'daoAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider' defined in ServletContext resource [/WEB-INF/spring/app-context-security.xml]: Cannot resolve reference to bean 'userService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.group9.handinhand.service.UserServiceImpl] for bean with name 'userService' defined in file [/home/project9/tomcat/webapps/HandInHand/WEB-INF/classes/com/group9/handinhand/service/UserServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/group9/handinhand/service/UserServiceImpl : Unsupported major.minor version 52.0 (unable to load class com.group9.handinhand.service.UserServiceImpl)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:632)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 53 more
AND SO MUCH MORE IS GOING FROM HERE
答案 0 :(得分:2)
您已经使用Java 8(.class文件版本52.0)编译了您的Web应用程序(或其使用的库之一),并且您正在尝试在较旧的JVM上运行您的应用程序。
您有三种选择:
-target
标志,该标志与您用于运行应用程序的Java版本相匹配。