Announcement Announcement Module
Collapse
No announcement yet.
spring data mongo 1.0.0.M3 and graph 1.1.0.M1 issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring data mongo 1.0.0.M3 and graph 1.1.0.M1 issue

    Hi,

    I'm trying to upgrade
    spring data mongo 1.0.0.M2 > 1.0.0.M3
    and
    spring data graph 1.0.0.RELEASE > 1.1.0.M1
    after that I'm experiencing problem with neo4j repository

    Code:
    public interface MyRepository extends GraphRepository<DRegion>, NamedIndexRepository<DRegion>{
    
    }
    during startup of my web application that repository cannot be instantiated now. Stack trace below.

    Any idea?

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: methods with same signature count() but incompatible return types: long and others
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
    	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:662)
    Caused by: java.lang.IllegalArgumentException: methods with same signature count() but incompatible return types: long and others
    	at sun.misc.ProxyGenerator.checkReturnTypes(ProxyGenerator.java:610)
    	at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:420)
    	at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:306)
    	at java.lang.reflect.Proxy.getProxyClass(Proxy.java:501)
    	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:108)
    	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:98)
    	at org.springframework.data.repository.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:147)
    	at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:107)
    	at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:36)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    Last edited by Dominik Raniszewski; Jul 22nd, 2011, 03:05 AM. Reason: put st in code tags

  • #2
    Hello

    1) Use code tags
    2) about the exception

    Code:
    org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'myRepository': 
    FactoryBean threw exception on object creation; nested exception is 
    java.lang.IllegalArgumentException: 
    methods with same signature count() but incompatible return types: long and others
    1) Post the bean myRepository definition, is based with XML or with annotation?
    2) where is defined and show the method count() declaration

    Comment


    • #3
      I'm following "Good relationship" guide released with spring-data-graph 1.0.0.REL

      Code:
      package org.foo.data.repositories.neo4j;
      import org.springframework.data.graph.neo4j.repository.GraphRepository;
      import org.springframework.data.graph.neo4j.repository.NamedIndexRepository;
      
      import org.foo.lib.model.dictionaries.geo.DRegion;
      
      public interface myRepository extends GraphRepository<DRegion>, NamedIndexRepository<DRegion>{
      
      }
      There is no implementation - it is handled automatically by spring-data-graph configuration.

      count() method comes from neo4j CRUDRepository interface and data commons CrudRepository - at least STS shows these two being in conflict so count() is ambiguous.

      org.springframework.data.graph.neo4j.repository.CR UDRepository
      org.springframework.data.repository.CrudRepository

      But in only happens while i increase versions like i said in the beginning. Without updgrade it works fine.
      Last edited by Dominik Raniszewski; Jul 22nd, 2011, 03:14 AM.

      Comment


      • #4
        Have you updated Spring Data Commons according to the pom.xml of either MongoDB or Neo4J Module? We changed the return type of count() from a Long to a primitive long as there's no reasonable scenario to return a null value. I guess this is causing the conflict.

        Comment


        • #5
          Originally posted by Oliver Gierke View Post
          Have you updated Spring Data Commons according to the pom.xml of either MongoDB or Neo4J Module? We changed the return type of count() from a Long to a primitive long as there's no reasonable scenario to return a null value. I guess this is causing the conflict.
          Currently i try to use:
          <spring.data.mongodb.version>1.0.0.M3</spring.data.mongodb.version>
          <spring.data.graph.version>1.1.0.M2</spring.data.graph.version>
          <spring.data.commons.version>1.1.0.RELEASE</spring.data.commons.version>

          And MongoTemplate looks for org/springframework/data/mapping/model/PersistentProperty which is not present in Commons 1.1.0

          Comment


          • #6
            Hi,

            I was trying to use following versions as they are the latest I've found.
            Code:
            		
            <spring.data.mongodb.version>1.0.0.M3</spring.data.mongodb.version>
            <spring.data.graph.version>1.1.0.M2</spring.data.graph.version>		
            <spring.data.commons.version>1.1.0.RELEASE</spring.data.commons.version>
            Problem is with Spring Data MongoDB. It refers to commons 1.1.0.M1 and had problem with finding PersistentEntity class which was moved from org.springframework.data.mapping.model to org.springframework.data.mapping

            I realy hope the next version of Spring Data MongoDB will use commons 1.1.0.RELEASE

            Comment


            • #7
              We did some major refactorings for SD commons 1.1.0.RC1 to remove package cycles. I guess the already released version of Mongo and Neo4J are not up with that currently. Have you tried current snapshots already?

              Comment


              • #8
                Hi Oliver,

                I've already had similar discussion here: http://stackoverflow.com/questions/6...ity-management with Michael Hunger from Neo4j. Maybe you 2 can meet and discuss your parts
                But seriously - I've got no time to play with snapshots so I've detached Mongo part from the project and postponed development in that area. Please let me know when RC1 is ready and I will run everything again and share some results with you.

                Comment

                Working...
                X