我理解之前已经问过类似的问题,但是我已经尝试了所有这些解决方案,但没有任何对我有用。 我收到以下错误。我已经添加了弹簧,并将其排除在平针织弹簧之外 所有代码都在GITHUB上: https://github.com/yogi-oc/OC-Latest-Spring
使用Java 8和Tomcat 8 任何帮助是极大的赞赏。 感谢
Jun 23, 2016 10:24:55 AM org.apache.catalina.core.ApplicationContext log
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 [5]; 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 'ldapAuthenticationProvider' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapAuthenticationProvider' defined in class path resource [org/akaza/openclinica/applicationContext-core-security.xml]: Cannot create inner bean 'org.springframework.security.ldap.authentication.BindAuthenticator#2f6a096c' of type [org.springframework.security.ldap.authentication.BindAuthenticator] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.ldap.authentication.BindAuthenticator#2f6a096c' defined in class path resource [org/akaza/openclinica/applicationContext-core-security.xml]: Cannot resolve reference to bean 'openClinicaLdapUserSearch' while setting bean property 'userSearch'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openClinicaLdapUserSearch': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.akaza.openclinica.service.user.LdapUserService org.akaza.openclinica.service.user.OpenClinicaLdapUserSearch.ldapUserService; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor] for bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcessor' defined in null: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor
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:1471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1216)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:706)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
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.akaza.openclinica.dao.core.OCContextLoaderListener.contextInitialized(OCContextLoaderListener.java:38)
答案 0 :(得分:0)
使用此代码
<security:http auto-config="true" use-expressions="true">
另一件事
"org.springframework.security.filterChains"
的Bean创建错误出现在使用高于3.1的spring版本并且没有为spring-aop, spring-jdbc, spring-tx and spring-expressions
中的POM.xml
手动添加依赖项时。
原因:如果不这样做,maven会自动为这些工件下载旧版本的jar(3.0.x),这些工件与较新版本的spring安全罐相冲突。
信用转到@aayushdriger
答案 1 :(得分:0)
当我查看网络/目标文件夹时,在爆炸的战争中没有罐子。我删除了整个文件夹并在IntelliJ中重新设置了Tomcat,这次它确实爆炸了所有jar的战争。应用程序正在成功运行。