Results 1 to 10 of 14

Thread: SDN 2.1.0.RC1 NullPointerException in DelegatingGraphDatabase.getIndex()

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    9

    Default SDN 2.1.0.RC1 NullPointerException in DelegatingGraphDatabase.getIndex()

    Hi,
    I try to upgrade SDN from 2.1.0.M1 to 2.1.0.RC1 but there is NullPointerException while loading ApplicationContext. Please, look at my simple example project in attachment. I changed only SDN version from 2.1.0.M1 to 2.1.0.RC1 and neo4j from 1.6 to 1.7 in maven pom.xml.

    test.zip
    Code:
    08:41:42.186 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@18e18a3] to prepare test instance [Neo4jTest@503429]
    java.lang.IllegalStateException: Failed to load ApplicationContext
    	at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308) ~[spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) ~[spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) ~[spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321) ~[spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit-dep-4.10.jar:na]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) [junit-dep-4.10.jar:na]
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) [junit-dep-4.10.jar:na]
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) [junit-dep-4.10.jar:na]
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) [junit-dep-4.10.jar:na]
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) [junit-dep-4.10.jar:na]
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) [junit-dep-4.10.jar:na]
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:300) [junit-dep-4.10.jar:na]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) [spring-test-3.0.7.RELEASE.jar:3.0.7.RELEASE]
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [.cp/:na]
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration#0': Unsatisfied dependency expressed through bean property 'conversionService': : Error creating bean with name 'mappingInfrastructure' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public final org.springframework.data.neo4j.support.MappingInfrastructureFactoryBean org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration$$EnhancerByCGLIB$$150ce060.mappingInfrastructure() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public final org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration$$EnhancerByCGLIB$$150ce060.typeRepresentationStrategyFactory() throws java.lang.Exception] threw exception; nested exception is java.lang.NullPointerException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingInfrastructure' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public final org.springframework.data.neo4j.support.MappingInfrastructureFactoryBean org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration$$EnhancerByCGLIB$$150ce060.mappingInfrastructure() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public final org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration$$EnhancerByCGLIB$$150ce060.typeRepresentationStrategyFactory() throws java.lang.Exception] threw exception; nested exception is java.lang.NullPointerException
    ...
    Caused by: java.lang.NullPointerException: null
    	at org.springframework.data.neo4j.support.DelegatingGraphDatabase.getIndex(DelegatingGraphDatabase.java:134) ~[spring-data-neo4j-2.1.0.RC1.jar:na]
    	at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.isAlreadyIndexed(TypeRepresentationStrategyFactory.java:61) ~[spring-data-neo4j-2.1.0.RC1.jar:na]
    	at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactory.java:54) ~[spring-data-neo4j-2.1.0.RC1.jar:na]
    	at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.<init>(TypeRepresentationStrategyFactory.java:39) ~[spring-data-neo4j-2.1.0.RC1.jar:na]
    	at org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory(Neo4jConfiguration.java:145) ~[spring-data-neo4j-2.1.0.RC1.jar:na]

  2. #2
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Thanks Vladok for sharing, I'll have a look.

    Michael

  3. #3
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    There seems to be a change how the Spring Dependency resolution is done between 3.0.7 and 3.1.0

    When I update your project to 3.1.0.RELEASE it works, just as a heads up, I'll continue to investigate.

  4. #4
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    It seems to be that the @Configuration class @Bean methods are called before any fields or setters are @Autowired leaving depdencies unmet, there have been some changes in the ordering and setup of the internal dependencies which seem to cause this behavior to surface.

    I tried a few ways of counteracting that but so far none has worked.

  5. #5
    Join Date
    Feb 2012
    Posts
    9

    Default

    Hi Michael,
    thank you for your reply. I will update Spring Framework too.

  6. #6
    Join Date
    Jun 2012
    Posts
    13

    Default

    i also meet the same issue when i want to implement the same function in no-maven project, i just touch neo4j 1 week, after i made lots of compare, i found if have one @Service class in you project, then can resolve this exception, and can start Tomcat from eclipse successful, but i cannot get the template. it is null.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •