我在我的 xml 文件中配置了一个 Spring bean,但是当我运行我的应用程序时,我收到以下错误。谁能告诉我为什么?
org.springframework.beans.factory.BeanCreationException:创建文件 [C:\src\test\resources\conf\ultra-root.xml] 中定义的名称为“ultra-config”的 bean 时出错:bean 初始化失败;嵌套异常是 java.lang.NoSuchFieldError: NULL at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
配置:
<bean id="http-8280" class="org.adroitlogic.ultraesb.transport.http.HttpNIOListener">
<constructor-arg ref="fileCache"/>
<property name="port" value="8280"/>
</bean>
<bean id="http-sender" class="org.adroitlogic.ultraesb.transport.http.HttpNIOSender">
<constructor-arg ref="fileCache"/>
</bean>
<bean id="environment" class="org.adroitlogic.ultraesb.api.Environment">
<constructor-arg value="unit_test" type="java.lang.String"/>
<property name="deploymentUnitsEnabled" value="true"/>
</bean>
<bean id="ultra-config" class="org.adroitlogic.ultraesb.core.ConfigurationImpl">
<property name="environment" ref="environment"/>
</bean>
Gradle 依赖项
dependencies {
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
testCompile group: 'org.apache.maven.plugins', name: 'maven-failsafe-plugin', version: '2.16'
testCompile group: 'junit', name: 'junit', version:'4.9'
testCompile group: 'org.adroitlogic', name: 'ultraesb-sample', version:'2.2.0-SNAPSHOT'
compile group: 'org.adroitlogic', name: 'ultraesb-api', version:'2.2.0-SNAPSHOT'
compile group: 'org.adroitlogic', name: 'logging-api', version:'1.0.0-SNAPSHOT'
compile group: 'org.adroitlogic', name: 'logging-slf4j-impl', version:'1.0.0-SNAPSHOT'
compile(group: 'org.springframework.security', name: 'spring-security-core', version:'3.1.4.RELEASE') {
exclude(module: 'spring-core')
exclude(module: 'spring-context')
exclude(module: 'spring-beans')
}
}