Announcement Announcement Module
Collapse
No announcement yet.
SDN 2.1.0.RC1 NullPointerException in DelegatingGraphDatabase.getIndex() Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    Attachment
    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]
    Attached Files

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

    Michael

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


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

          Comment


          • #6
            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.

            Comment


            • #7
              zgdnba what Spring version are you using?

              Michael

              Comment


              • #8
                3.0.7, actually i used the sample code of "cineasts", i want to transfer this project from manve to common Dynamic web project. same jars from that project be dependency in pom.xml

                Comment


                • #9
                  Can you upgrade it to 3.1.0 and see if the error still ocurrs?

                  Comment


                  • #10
                    i made some test by 3.1.0 also, same issue with 3.0.7, but add at least one @Service for any one class, then can resolve this exception, and i also resolved the template = null issue for now.

                    Comment


                    • #11
                      So adding an @Service tag to any class resolves the problem?

                      Sounds like a scary issue with Spring itself.

                      Comment


                      • #12
                        i just add this tag at service layer.

                        Comment


                        • #13
                          hi Michael, i think is my fault, @Service is not the root cause, for now, even if i remove the @Service, then also can working well.

                          today, i changed my project into Maven, then meet this issue again, i found if have the spring version conflict, then also can cause the same issue.

                          Comment


                          • #14
                            Hi,

                            Any news regarding this problem?
                            Today I found this thread and it looks I am having the same problem (http://forum.springsource.org/showth...856#post419856)

                            Comment

                            Working...
                            X