Java 无法管理运行已完成的春季美味面条吧教程
我正在尝试在本地运行完整版本的美味面条吧教程REST+WebApp,这样我就可以在周末乘坐2*6小时的公交车时稍微挖掘一下代码 根据这两个指南,完成的代码可用:Java 无法管理运行已完成的春季美味面条吧教程,java,spring,rest,spring-mvc,Java,Spring,Rest,Spring Mvc,我正在尝试在本地运行完整版本的美味面条吧教程REST+WebApp,这样我就可以在周末乘坐2*6小时的公交车时稍微挖掘一下代码 根据这两个指南,完成的代码可用: $ cd ../6/complete $ ./gradlew tomcatRunWar 但是,这两个版本都不为我运行,并给出生成错误 其他人能管理这些吗?我的Java版本或路径有什么问题吗 2014-09-19 09:36:10 ERROR ContextLoader:319 - Context initialization fai
$ cd ../6/complete
$ ./gradlew tomcatRunWar
但是,这两个版本都不为我运行,并给出生成错误
其他人能管理这些吗?我的Java版本或路径有什么问题吗
2014-09-19 09:36:10 ERROR ContextLoader:319 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectPostProcessor' defined in class org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [com/yummynoodlebar/config/SecurityConfig.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
看一下堆栈跟踪,如果我没有弄错的话,您正在使用一个较新的java版本java 8,它可能在使用过的spring版本3.2上不受支持。在教程中降级java或升级spring。谢谢。这解决了将Spring内核和Spring mvc更新为4.1.0的错误。但现在我得到一个不同的错误:SLF4J:类路径包含多个SLF4J绑定。-我以前已经找到了解决方案,但它基本上删除了所有依赖项,这意味着一些类在引用这些路径中的对象时不会编译。这是一个错误或警告,通常只是选择了一个。升级到slf4j 1.7.7还应确保将所有spring JAR升级到该版本,不要混用等待出现问题的框架版本。