Results 1 to 8 of 8

Thread: spring data mongo 1.0.0.M3 and graph 1.1.0.M1 issue

  1. #1
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    21

    Default 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 at 02:05 AM. Reason: put st in code tags

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    21

    Default

    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 at 02:14 AM.

  4. #4
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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.

  5. #5
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    21

    Default

    Quote 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

  6. #6
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    21

    Default

    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

  7. #7
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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?

  8. #8
    Join Date
    Aug 2010
    Location
    Singapore
    Posts
    21

    Default

    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.

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
  •