4

Spring 3.2.1.RELEASE和 spring secuirity 3.1.3.RELEASE出现如下错误

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'yyyyProperties' defined in URL [jar:file:/D:/yyyy/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/usermanagement-webservice/WEB-INF/lib/core-config.jar!/config/applicationContext-core-config.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: NULL
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:532)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:657)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchFieldError: NULL
    at org.springframework.expression.TypedValue.<clinit>(TypedValue.java:32)
    at org.springframework.expression.spel.support.StandardEvaluationContext.setRootObject(StandardEvaluationContext.java:88)
    at org.springframework.expression.spel.support.StandardEvaluationContext.<init>(StandardEvaluationContext.java:74)
    at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:124)
    at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1303)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:211)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:183)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
    ... 20 more

我的 mvn 依赖 :list 看起来

- antlr:antlr:jar:2.7.7:compile
- aopalliance:aopalliance:jar:1.0:compile
- asm:asm:jar:3.3.1:runtime
- c3p0:c3p0:jar:0.9.1:compile
- com.liferay.portal:portal-service:jar:6.1.1:compile
- com.xxxxx.yyyy.common:common-exception:jar:0.0.1:runtime
- com.xxxxx.yyyy.common:common-util:jar:0.0.1:runtime
- com.xxxxx.yyyy.core:core-business:jar:0.0.1:compile
- com.xxxxx.yyyy.core:core-config:jar:0.0.1:runtime
- com.xxxxx.yyyy.core:core-dao:jar:0.0.1:compile
- com.xxxxx.yyyy.core:core-service:jar:0.0.1:compile
- com.xxxxx.yyyy.core:core-util:jar:0.0.1:runtime
- com.xxxxx.yyyy.usermanagement:usermanagement-auth:jar:0.0.1:runtime
- com.xxxxx.yyyy.usermanagement:usermanagement-bo:jar:0.0.1:runtime
- com.xxxxx.yyyy.usermanagement:usermanagement-business:jar:0.0.1:runtime
- com.xxxxx.yyyy.usermanagement:usermanagement-business-impl:jar:0.0.1:runtime
- com.xxxxx.yyyy.usermanagement:usermanagement-service:jar:0.0.1:compile
- com.xxxxx.yyyy.usermanagement:usermanagement-service-impl:jar:0.0.1:runtime
- com.sun.xml.bind:jaxb-impl:jar:2.1.13:runtime
- commons-beanutils:commons-beanutils:jar:1.8.3:compile
- commons-codec:commons-codec:jar:1.5:compile
- commons-lang:commons-lang:jar:2.5:compile
- commons-logging:commons-logging:jar:1.1.1:compile
- dom4j:dom4j:jar:1.6.1:compile
- javax.ws.rs:javax.ws.rs-api:jar:2.0-m10:runtime
- junit:junit:jar:4.11:test
- log4j:log4j:jar:1.2.16:compile
- mysql:mysql-connector-java:jar:5.1.23:runtime
- net.sf.dozer:dozer:jar:5.3.2:compile
- org.apache.commons:commons-lang3:jar:3.1:compile
- org.apache.cxf:cxf-api:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-bindings-soap:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-bindings-xml:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-core:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-frontend-simple:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-transports-http:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-ws-addr:jar:2.7.3:runtime
- org.apache.cxf:cxf-rt-ws-policy:jar:2.7.3:runtime
- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:runtime
- org.apache.ibatis:ibatis-sqlmap:jar:2.3.4.726:compile
- org.apache.neethi:neethi:jar:3.0.2:runtime
- org.apache.poi:poi:jar:3.8:compile
- org.apache.poi:poi-ooxml:jar:3.8-beta5:compile
- org.apache.poi:poi-ooxml-schemas:jar:3.8-beta5:compile
- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.3:runtime
- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
- org.codehaus.jackson:jackson-core-asl:jar:1.9.12:compile
- org.codehaus.jackson:jackson-jaxrs:jar:1.9.12:compile
- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12:compile
- org.codehaus.woodstox:stax2-api:jar:3.1.1:runtime
- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.4:runtime
- org.hamcrest:hamcrest-core:jar:1.3:test
- org.hibernate:hibernate-c3p0:jar:4.1.9.Final:compile
- org.hibernate:hibernate-core:jar:4.1.9.Final:compile
- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
- org.igniterealtime.smack:smack:jar:3.2.1:runtime
- org.igniterealtime.smack:smackx:jar:3.2.1:runtime
- org.javassist:javassist:jar:3.17.1-GA:compile
- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
- org.mockito:mockito-all:jar:1.9.5:test
- org.mockito:mockito-core:jar:1.9.5:test
- org.objenesis:objenesis:jar:1.0:test
- org.powermock:powermock-api-mockito:jar:1.5:test
- org.powermock:powermock-api-support:jar:1.5:test
- org.powermock:powermock-core:jar:1.5:test
- org.powermock:powermock-module-junit4:jar:1.5:test
- org.powermock:powermock-module-junit4-common:jar:1.5:test
- org.powermock:powermock-reflect:jar:1.5:test
- org.slf4j:slf4j-api:jar:1.5.10:compile
- org.slf4j:slf4j-log4j12:jar:1.7.2:compile
- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile
- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile
- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
- org.springframework:spring-context-support:jar:3.2.1.RELEASE:runtime
- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile
- org.springframework:spring-jdbc:jar:3.2.1.RELEASE:compile
- org.springframework:spring-orm:jar:3.2.1.RELEASE:runtime
- org.springframework:spring-oxm:jar:3.2.1.RELEASE:compile
- org.springframework:spring-test:jar:3.2.1.RELEASE:test
- org.springframework:spring-tx:jar:3.2.1.RELEASE:runtime
- org.springframework:spring-web:jar:3.2.1.RELEASE:runtime
- org.springframework:spring-webmvc:jar:3.2.1.RELEASE:compile
- org.springframework.integration:spring-integration-core:jar:2.2.1.RELEASE:runtime
- org.springframework.integration:spring-integration-xmpp:jar:2.2.1.RELEASE:runtime
- org.springframework.retry:spring-retry:jar:1.0.2.RELEASE:runtime
- org.springframework.security:spring-security-acl:jar:3.1.3.RELEASE:compile
- org.springframework.security:spring-security-config:jar:3.1.3.RELEASE:compile
- org.springframework.security:spring-security-core:jar:3.1.3.RELEASE:compile
- org.springframework.security:spring-security-web:jar:3.1.3.RELEASE:compile
- stax:stax-api:jar:1.0.1:compile
- wsdl4j:wsdl4j:jar:1.6.2:runtime
- xml-apis:xml-apis:jar:1.0.b2:compile
- xml-resolver:xml-resolver:jar:1.2:runtime
4

1 回答 1

6

从您可以看出您的spring-expression依赖项dependency:list版本不正确:

  • org.springframework:spring-expression:jar:3.0.7.RELEASE:compile

只需将以下内容添加到您的 POM 中:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>3.2.1.RELEASE</version>
        </dependency>
    </depdendencies>
</dependencyManagement>

dependencyManagement您可以通过这样的方式更改传递依赖项的定义。

于 2013-06-13T19:37:23.570 回答