0

I have configured a Spring bean in my xml file but when I run my app, I get the following error. Can anyone tell me why?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ultra-config' defined in file [C:\src\test\resources\conf\ultra-root.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: NULL at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)

Configuration:

<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

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')
    }
}
M. Deinum
  • 115,695
  • 22
  • 220
  • 224
TheCoder
  • 8,413
  • 15
  • 42
  • 54

2 Answers2

1

Using different library versions could produce that error. Take a look at this:

http://www.captaindebug.com/2013/05/spring-and-javalangnosuchfielderror.html#.U1vE7B__6b4

Spring 3.1 entityManagerFactory java.lang.NoSuchFieldError: NULL Error

Community
  • 1
  • 1
Andres
  • 10,561
  • 4
  • 45
  • 63
0

I think my IDE was in an incorrect state regarding libraries. I deleted my project and re-added it and am now passed the issue.

TheCoder
  • 8,413
  • 15
  • 42
  • 54