I’m trying to overcome some dependency disparity through one of plugins, by removing dependency on jackson2-api plugin, and using direct jackson maven dependency instead.
Is it even possible to do something like that? because it seems not to work well.
https://github.com/cvakiitho/build-failure-analyzer-plugin/commit/c51ed3fbed62f7bb30a854ba8fcea5831649f1d2
BFA plugin still seems to use jackson classes from jackson2-api plugin, not direct maven dependency.
resulting in https://issues.jenkins-ci.org/browse/JENKINS-62214
where wrong jackson version is used in import inside MongoJack, resulting in missing method:
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.Annotated.getGenericType()Ljava/lang/reflect/Type;
at org.mongojack.internal.MongoAnnotationIntrospector.getTypeForAnnotated(MongoAnnotationIntrospector.java:81)
at org.mongojack.internal.MongoAnnotationIntrospector.findDeserializer(MongoAnnotationIntrospector.java:97)
Is dependency from the Jackson2-api plugin somehow higher in classpath in jenkins?
Can't answer you directly, but running mvn dependency:analyze and mvn dependency:tree should guide you.
analyze reports:
[INFO] --- maven-dependency-plugin:3.1.1:analyze (default-cli) # build-failure-analyzer ---
[WARNING] Used undeclared dependencies found:
[WARNING] com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile
[WARNING] com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.jenkins-ci.plugins:jackson2-api:jar:2.10.2:compile
And dependency:tree reports (selective list):
[WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution
[INFO] com.sonyericsson.jenkins.plugins.bfa:build-failure-analyzer:hpi:1.27.2-SNAPSHOT
[INFO] +- com.sonyericsson.hudson.plugins.gerrit:gerrit-trigger:jar:2.27.5:compile
...
[INFO] +- org.jenkins-ci.plugins:slack:jar:2.30:compile
[INFO] | +- (org.jenkins-ci.plugins:jackson2-api:jar:2.9.9.1:compile - omitted for conflict with 2.10.2)
...
[INFO] +- org.mongodb:mongo-java-driver:jar:3.8.2:compile
[INFO] +- org.mongojack:mongojack:jar:2.9.4:compile
[INFO] | +- org.mongodb:mongodb-driver:jar:3.8.0:compile
[INFO] | | +- org.mongodb:bson:jar:3.8.0:compile
[INFO] | | \- org.mongodb:mongodb-driver-core:jar:3.8.0:compile
[INFO] | | \- (org.mongodb:bson:jar:3.8.0:compile - omitted for duplicate)
[INFO] | +- de.undercouch:bson4jackson:jar:2.9.2:compile
[INFO] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.9.3:compile - omitted for conflict with 2.9.9)
[INFO] | +- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] | \- commons-io:commons-io:jar:2.6:compile
[INFO] +- org.jenkins-ci.plugins:jackson2-api:jar:2.10.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile
[INFO] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.2:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile - omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.2:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.2:compile
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile - omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile
[INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.10.2:compile
[INFO] | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile - omitted for duplicate)
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] | | \- (jakarta.activation:jakarta.activation-api:jar:1.2.1:compile - omitted for duplicate)
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
So, the dependency resolution takes the direct / declared dependency will override the undeclared / transitive dependency (and the higher over the lower #.#.#).
I cannot build a simple metric from a java application using the Stackdriver Monitoring client when I have a dependency to the Google Dataflow client.
I get the exception:
Exception in thread "main" java.lang.NoSuchMethodError: io.grpc.okhttp.OkHttpChannelProvider.isAndroid()Z
at io.grpc.okhttp.OkHttpChannelProvider.priority(OkHttpChannelProvider.java:51)
at io.grpc.ManagedChannelProvider$1.getPriority(ManagedChannelProvider.java:49)
at io.grpc.ManagedChannelProvider$1.getPriority(ManagedChannelProvider.java:41)
at io.grpc.ServiceProviders$1.compare(ServiceProviders.java:78)
at java.util.Collections$ReverseComparator2.compare(Collections.java:5178)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
at java.util.TimSort.sort(TimSort.java:220)
at java.util.Arrays.sort(Arrays.java:1512)
at java.util.ArrayList.sort(ArrayList.java:1462)
at java.util.Collections.sort(Collections.java:175)
at io.grpc.ServiceProviders.loadAll(ServiceProviders.java:75)
at io.grpc.ServiceProviders.load(ServiceProviders.java:42)
at io.grpc.ManagedChannelProvider.<clinit>(ManagedChannelProvider.java:37)
at io.grpc.ManagedChannelBuilder.forAddress(ManagedChannelBuilder.java:36)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:185)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:157)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:149)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:151)
at com.google.cloud.monitoring.v3.stub.GrpcMetricServiceStub.create(GrpcMetricServiceStub.java:173)
at com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings.createStub(MetricServiceStubSettings.java:184)
at com.google.cloud.monitoring.v3.MetricServiceClient.<init>(MetricServiceClient.java:158)
at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:139)
at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:130)
at SimpleMetric.main(SimpleMetric.java:7)
on the create method:
import com.google.cloud.monitoring.v3.MetricServiceClient;
import java.io.IOException;
public class SimpleMetric {
public static void main(String... args) throws IOException {
MetricServiceClient metricServiceClient = MetricServiceClient.create();
}
}
only when I add:
compile 'com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:2.5.0'
as in my gradle file as a dependency.
plugins {
id 'java'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.cloud:google-cloud-monitoring:1.48.0'
// exception with the dependency below
compile 'com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:2.5.0'
}
I reported the issue to Google. In the meantime, is there a workaround?
isAndroid was defined in io.grpc.ManagedChannelProvider taken out of grpc-core in version 1.11. The error means somehow you are using grpc-okhttp from before 1.11 and grpc-core from 1.11 or later.
google-cloud-monitoring 1.48.0 depends indirectly on grpc-core 1.13:
com.google.cloud:google-cloud-monitoring:jar:1.48.0:compile
+- com.google.cloud:google-cloud-core:jar:1.48.0:compile
+- com.google.cloud:google-cloud-core-grpc:jar:1.48.0:compile
| +- io.grpc:grpc-protobuf:jar:1.13.1:compile
| | \- io.grpc:grpc-protobuf-lite:jar:1.13.1:compile
| +- io.grpc:grpc-context:jar:1.13.1:compile
+- com.google.api.grpc:proto-google-cloud-monitoring-v3:jar:1.30.0:compile
+- io.grpc:grpc-netty-shaded:jar:1.13.1:compile
| \- io.grpc:grpc-core:jar:1.13.1:compile (version selected from constraint [1.13.1,1.13.1])
| +- com.google.errorprone:error_prone_annotations:jar:2.1.2:compile
| +- io.opencensus:opencensus-api:jar:0.12.3:compile
| \- io.opencensus:opencensus-contrib-grpc-metrics:jar:0.12.3:compile
+- io.grpc:grpc-stub:jar:1.13.1:compile
\- io.grpc:grpc-auth:jar:1.13.1:compile
google-cloud-dataflow-java-sdk-all 2.5.0 depends indirectly on grpc-core 1.2 and grpc-okhttp 1.2:
com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:jar:2.5.0:compile
+- org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.5.0:compile
| +- io.grpc:grpc-core:jar:1.2.0:compile
| | +- com.google.errorprone:error_prone_annotations:jar:2.0.11:compile
| | +- io.grpc:grpc-context:jar:1.2.0:compile
| | \- com.google.instrumentation:instrumentation-api:jar:0.3.0:compile
| +- com.google.api:gax-grpc:jar:0.20.0:compile
| | +- io.grpc:grpc-protobuf:jar:1.2.0:compile
| | +- com.google.api:api-common:jar:1.1.0:compile
| | +- com.google.auto.value:auto-value:jar:1.2:compile
| | +- com.google.api:gax:jar:1.3.1:compile
| | \- org.threeten:threetenbp:jar:1.3.3:compile
| +- io.grpc:grpc-auth:jar:1.2.0:compile
| +- io.grpc:grpc-netty:jar:1.2.0:compile
| +- io.grpc:grpc-stub:jar:1.2.0:compile
| +- io.grpc:grpc-all:jar:1.2.0:compile
| | +- io.grpc:grpc-okhttp:jar:1.2.0:compile
| | | +- com.squareup.okhttp:okhttp:jar:2.5.0:compile
| | | \- com.squareup.okio:okio:jar:1.6.0:compile
So basically dataflow is out of date and causing a conflict. The dataflow SDK isn't supported anymore, as it is now Apache Beam. Consider migrating to solve the issue.
Tests used to pass until last week and now it started failing. The error is displayed below.
rest-assured=2.9.0
httpclient-4.5.1.jar
httpcore-4.4.3.jar
I excluded the other httpclient and core jars from ivy these two above versions come from rest assured. Please I really need help with this.
import static com.jayway.restassured.RestAssured.given
#Test
public void getSummary(){
given().
contentType("application/json").
when().
get("http://example.org/ab/resources/client/case/123455").
then().
statusCode(200).
extract().path("id");
;
//statusCode(200);
}
java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
at com.jayway.restassured.config.EncoderConfig.(EncoderConfig.java:61)
at com.jayway.restassured.config.RestAssuredConfig.(RestAssuredConfig.java:41)
at com.jayway.restassured.RestAssured.(RestAssured.java:423)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:68)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:65)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:198)
at com.thomson.tssq.jwb.restapitests.RestAPITest.getSummary(RestAPITest.groovy:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
See if you have below listed jars in classpath or in maven pom.xml
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # rest-assured ---
[INFO] io.rest-assured:rest-assured:jar:3.0.2-SNAPSHOT
[INFO] +- org.codehaus.groovy:groovy:jar:2.4.6:compile
[INFO] +- org.codehaus.groovy:groovy-xml:jar:2.4.6:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | \- commons-codec:commons-codec:jar:1.9:compile
[INFO] +- org.apache.httpcomponents:httpmime:jar:4.5.1:compile
[INFO] +- com.github.scribejava:scribejava-apis:jar:2.5.3:compile
[INFO] | \- com.github.scribejava:scribejava-core:jar:2.5.3:compile
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:compile
[INFO] +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile
[INFO] +- io.rest-assured:json-path:jar:3.0.2-SNAPSHOT:compile
[INFO] | +- org.codehaus.groovy:groovy-json:jar:2.4.6:compile
[INFO] | \- io.rest-assured:rest-assured-common:jar:3.0.2-SNAPSHOT:compile
[INFO] +- io.rest-assured:xml-path:jar:3.0.2-SNAPSHOT:compile
[INFO] | \- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.7.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.7.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.7.3:compile
[INFO] +- org.codehaus.jackson:jackson-core-asl:jar:1.9.11:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.11:compile
[INFO] +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] \- org.assertj:assertj-core:jar:1.7.0:test
When I uncomment this line in this interface I get error while Spring run.
#Repository
public interface PersonRepository extends GraphRepository<Person>
{
//Person findByName(String name);
}
Output from run:
2016-06-08 23:27:58.580 INFO 6723 --- [ main] o.s.d.neo4j.mapping.Neo4jMappingContext : Neo4jMappingContext initialisation completed
2016-06-08 23:27:58.665 WARN 6723 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: hello.PersonRepository hello.HomeController.personRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.springframework.data.neo4j.repository.query.GraphQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
2016-06-08 23:27:58.671 INFO 6723 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2016-06-08 23:27:58.695 ERROR 6723 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: hello.PersonRepository hello.HomeController.personRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.springframework.data.neo4j.repository.query.GraphQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at hello.Application.main(Application.java:26) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: hello.PersonRepository hello.HomeController.personRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.springframework.data.neo4j.repository.query.GraphQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 17 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.springframework.data.neo4j.repository.query.GraphQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 19 common frames omitted
Caused by: java.lang.AbstractMethodError: org.springframework.data.neo4j.repository.query.GraphQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery;
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:416) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.data.neo4j.repository.support.GraphRepositoryFactoryBean.afterPropertiesSet(GraphRepositoryFactoryBean.java:43) ~[spring-data-neo4j-4.1.1.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 29 common frames omitted
2016-06-08 23:27:58.707 INFO 6723 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/home/marcin/Praca%20magisterska/spring_data_neo4j/neo4j_connection/target/classes/, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.5.RELEASE/spring-boot-starter-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot/1.3.5.RELEASE/spring-boot-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.5.RELEASE/spring-boot-autoconfigure-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.5.RELEASE/spring-boot-starter-logging-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar, file:/home/marcin/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar, file:/home/marcin/.m2/repository/org/slf4j/jul-to-slf4j/1.7.21/jul-to-slf4j-1.7.21.jar, file:/home/marcin/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.21/log4j-over-slf4j-1.7.21.jar, file:/home/marcin/.m2/repository/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/home/marcin/.m2/repository/org/springframework/data/spring-data-neo4j/4.1.1.RELEASE/spring-data-neo4j-4.1.1.RELEASE.jar, file:/home/marcin/.m2/repository/org/neo4j/neo4j-ogm-core/2.0.1/neo4j-ogm-core-2.0.1.jar, file:/home/marcin/.m2/repository/org/neo4j/neo4j-ogm-api/2.0.1/neo4j-ogm-api-2.0.1.jar, file:/home/marcin/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar, file:/home/marcin/.m2/repository/org/neo4j/neo4j-ogm-compiler/2.0.1/neo4j-ogm-compiler-2.0.1.jar, file:/home/marcin/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar, file:/home/marcin/.m2/repository/org/neo4j/neo4j-ogm-http-driver/2.0.1/neo4j-ogm-http-driver-2.0.1.jar, file:/home/marcin/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar, file:/home/marcin/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar, file:/home/marcin/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar, file:/home/marcin/.m2/repository/org/springframework/data/spring-data-commons/1.11.4.RELEASE/spring-data-commons-1.11.4.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/spring-beans/4.2.6.RELEASE/spring-beans-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/spring-context/4.2.6.RELEASE/spring-context-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/spring-aop/4.2.6.RELEASE/spring-aop-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/home/marcin/.m2/repository/org/springframework/spring-expression/4.2.6.RELEASE/spring-expression-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/spring-tx/4.2.6.RELEASE/spring-tx-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar, file:/home/marcin/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.5.RELEASE/spring-boot-starter-web-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.5.RELEASE/spring-boot-starter-tomcat-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.33/tomcat-embed-core-8.0.33.jar, file:/home/marcin/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.33/tomcat-embed-el-8.0.33.jar, file:/home/marcin/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.33/tomcat-embed-logging-juli-8.0.33.jar, file:/home/marcin/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.33/tomcat-embed-websocket-8.0.33.jar, file:/home/marcin/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.5.RELEASE/spring-boot-starter-validation-1.3.5.RELEASE.jar, file:/home/marcin/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar, file:/home/marcin/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/home/marcin/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/home/marcin/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/home/marcin/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.6/jackson-databind-2.6.6.jar, file:/home/marcin/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.6/jackson-annotations-2.6.6.jar, file:/home/marcin/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.6/jackson-core-2.6.6.jar, file:/home/marcin/.m2/repository/org/springframework/spring-web/4.2.6.RELEASE/spring-web-4.2.6.RELEASE.jar, file:/home/marcin/.m2/repository/org/springframework/spring-webmvc/4.2.6.RELEASE/spring-webmvc-4.2.6.RELEASE.jar]
Implementation of class Person:
#NodeEntity
public class Person
{
#GraphId
private Long id;
private String name;
private Person() {}
public Person(String name) { this.name = name; }
(...)
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
I have expected that Spring generate code for findByName(String). I don't understand why it don't do that and I don't understand error returned by Java. Can anyone explain this problem?
--
Tree dependency from Maven:
$ mvn dependency:tree -Dverbose
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Neo4j-CMS 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # Neo4j-CMS ---
[WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution
[INFO] org.marcin:Neo4j-CMS:jar:0.0.1
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.3.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:1.3.5.RELEASE:compile
[INFO] | | +- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.5.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.5.RELEASE:compile
[INFO] | | \- (org.springframework.boot:spring-boot:jar:1.3.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.5.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | +- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.13; omitted for duplicate)
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | +- org.springframework:spring-core:jar:4.2.6.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.16:runtime
[INFO] +- org.springframework.data:spring-data-neo4j:jar:4.1.1.RELEASE:compile
[INFO] | +- org.neo4j:neo4j-ogm-core:jar:2.0.1:compile
[INFO] | | +- org.neo4j:neo4j-ogm-api:jar:2.0.1:compile
[INFO] | | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.6.6:compile - version managed from 2.7.1; omitted for duplicate)
[INFO] | | | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.14; omitted for duplicate)
[INFO] | | | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | +- org.neo4j:neo4j-ogm-compiler:jar:2.0.1:compile
[INFO] | | | \- (org.neo4j:neo4j-ogm-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | | \- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] | +- org.neo4j:neo4j-ogm-http-driver:jar:2.0.1:compile
[INFO] | | +- (org.neo4j:neo4j-ogm-api:jar:2.0.1:compile - omitted for duplicate)
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile (version managed from 4.3.6)
[INFO] | | | +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] | | | \- (commons-codec:commons-codec:jar:1.9:compile - omitted for conflict with 1.10)
[INFO] | | \- commons-io:commons-io:jar:2.4:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.11.4.RELEASE:compile (version managed from 1.12.1.RELEASE)
[INFO] | | +- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.19; omitted for duplicate)
[INFO] | | \- (org.slf4j:jcl-over-slf4j:jar:1.7.21:runtime - version managed from 1.7.13; omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.2.6.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | \- org.springframework:spring-expression:jar:4.2.6.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-tx:jar:4.2.6.RELEASE:compile (version managed from 4.2.5.RELEASE)
[INFO] | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | \- (org.slf4j:jcl-over-slf4j:jar:1.7.21:compile - version managed from 1.7.19; scope updated from runtime; omitted for duplicate)
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:1.3.5.RELEASE:compile
[INFO] +- (org.springframework.boot:spring-boot-starter:jar:1.3.5.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.33:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.33:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.33:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.33:compile
[INFO] | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.33:compile - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:1.3.5.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.3.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.33:compile - omitted for duplicate)
[INFO] | \- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile (version managed from 3.2.1.Final)
[INFO] | \- com.fasterxml:classmate:jar:1.1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.6:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.6:compile (version managed from 2.6.0)
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.6.6:compile
[INFO] +- org.springframework:spring-web:jar:4.2.6.RELEASE:compile
[INFO] | +- (org.springframework:spring-aop:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.5.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] \- org.springframework:spring-webmvc:jar:4.2.6.RELEASE:compile
[INFO] +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.5.RELEASE; omitted for duplicate)
[INFO] +- (org.springframework:spring-core:jar:4.2.6.RELEASE:compile - version managed from 4.1.9.RELEASE; omitted for duplicate)
[INFO] +- (org.springframework:spring-expression:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] \- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.367 s
[INFO] Finished at: 2016-06-09T22:07:03+02:00
[INFO] Final Memory: 21M/339M
[INFO] ------------------------------------------------------------------------
The version of Spring Data Commons is the problem. If you stick with the release train that SDN 4.1.1 belongs to (Hopper SR1), then you should be fine.
This shows you how to do it:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Hopper-SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I have recently upgraded to Spring-Data-Neo4j 4.1.0-BUILD-SNAPSHOT (using neo4j-ogm 2.0.0-M01) and noticed that queries retrieving a #QueryResult are not working any more. I get the following error:
java.lang.NoSuchMethodError: org.neo4j.ogm.response.model.DefaultRestModel.<init>(Ljava/util/Map;)V
at org.neo4j.ogm.drivers.http.response.RestModelResponse.next(RestModelResponse.java:39)
at org.neo4j.ogm.drivers.http.response.RestModelResponse.next(RestModelResponse.java:28)
at org.neo4j.ogm.context.RestModelMapper.map(RestModelMapper.java:53)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:97)
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:76)
at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:313)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery$1.apply(QueryResultGraphRepositoryQuery.java:69)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery$1.apply(QueryResultGraphRepositoryQuery.java:64)
at org.neo4j.ogm.session.delegates.TransactionsDelegate.doInTransaction(TransactionsDelegate.java:46)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:386)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery.mapToConcreteType(QueryResultGraphRepositoryQuery.java:64)
at org.springframework.data.neo4j.repository.query.QueryResultGraphRepositoryQuery.execute(QueryResultGraphRepositoryQuery.java:52)
at org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:52)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy49.getParticipatingMolecules2(Unknown Source)
at uk.ac.ebi.reactome.service.DatabaseObjectServiceImpl.getParticipatingMolecules2(DatabaseObjectServiceImpl.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at uk.ac.ebi.reactome.aop.LoggingAspect.monitorExecutionTimes(LoggingAspect.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy51.getParticipatingMolecules2(Unknown Source)
at uk.ac.ebi.reactome.service.DatabaseObjectServiceTest.testGetParticipatingMolecules2(DatabaseObjectServiceTest.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
The #QueryResult Object:
#QueryResult
public class Participant {
private Long ewasDbId;
private String ewasName;
private Collection<Long> refEntityDbIds;
private Collection<String> refEntityNames;
}
The Query:
#Query("MATCH (n:Pathway{dbId:{0}})-[:hasEvent|input|output*]->(m)-[:hasMember|hasComponent|hasCandidate|repeatedUnit|referenceEntity*]->(x:ReferenceEntity) RETURN m.dbId AS ewasDbId, m.displayName AS ewasName, COLLECT(DISTINCT x.dbId) AS refEntityDbIds, COLLECT(DISTINCT x.displayName) AS refEntityNames")
Collection<Participant> getParticipatingMolecules2(Long dbId);
The Dependencies:
<!--Spring data neo4j-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.1.0.BUILD-SNAPSHOT</version>
</dependency>
<!--Neo4j object graph mapping -->
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-api</artifactId>
<version>2.0.0-M01</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-core</artifactId>
<version>2.0.0-M01</version>
</dependency>
...
Dependency tree
[INFO] +- org.reactome.base:reactome-base:jar:1.2.1:compile
[INFO] | \- mysql:mysql-connector-java:jar:5.1.28:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:4.1.0.BUILD-SNAPSHOT:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.12.0.BUILD-SNAPSHOT:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.1.9.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.1.9.RELEASE:compile
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:4.1.9.RELEASE:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.13:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.13:runtime
[INFO] +- org.springframework:spring-test:jar:4.2.4.RELEASE:test
[INFO] | \- org.springframework:spring-core:jar:4.2.4.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.neo4j:neo4j-ogm-api:jar:2.0.0-M01:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.1:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.5.1:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- org.neo4j:neo4j-ogm-core:jar:2.0.0-M01:compile
[INFO] | +- org.neo4j:neo4j-ogm-compiler:jar:2.0.0-SNAPSHOT:compile
[INFO] | +- org.neo4j:neo4j-ogm-drivers:jar:2.0.0-SNAPSHOT:compile
[INFO] | | +- org.neo4j:neo4j:jar:2.3.2:compile
[INFO] | | | +- org.neo4j:neo4j-kernel:jar:2.3.2:compile
[INFO] | | | | +- org.neo4j:neo4j-primitive-collections:jar:2.3.2:compile
[INFO] | | | | | +- org.neo4j:neo4j-unsafe:jar:2.3.2:compile
[INFO] | | | | | \- org.neo4j:neo4j-function:jar:2.3.2:compile
[INFO] | | | | +- org.neo4j:neo4j-io:jar:2.3.2:compile
[INFO] | | | | | \- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] | | | | +- org.neo4j:neo4j-csv:jar:2.3.2:compile
[INFO] | | | | \- org.neo4j:neo4j-logging:jar:2.3.2:compile
[INFO] | | | +- org.neo4j:neo4j-lucene-index:jar:2.3.2:compile
[INFO] | | | | \- org.apache.lucene:lucene-core:jar:3.6.2:compile
[INFO] | | | +- org.neo4j:neo4j-graph-algo:jar:2.3.2:compile
[INFO] | | | +- org.neo4j:neo4j-udc:jar:2.3.2:compile
[INFO] | | | +- org.neo4j:neo4j-graph-matching:jar:2.3.2:compile
[INFO] | | | +- org.neo4j:neo4j-cypher:jar:2.3.2:compile
[INFO] | | | | +- org.scala-lang:scala-library:jar:2.11.7:compile
[INFO] | | | | +- org.scala-lang:scala-reflect:jar:2.11.7:compile
[INFO] | | | | +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | | | | +- org.neo4j:neo4j-codegen:jar:2.3.2:compile
[INFO] | | | | | \- org.ow2.asm:asm:jar:5.0.2:compile
[INFO] | | | | +- org.neo4j:neo4j-cypher-compiler-1.9_2.11:jar:2.0.5:compile
[INFO] | | | | +- org.neo4j:neo4j-cypher-compiler-2.2_2.11:jar:2.2.6:compile
[INFO] | | | | +- org.neo4j:neo4j-cypher-compiler-2.3:jar:2.3.2:compile
[INFO] | | | | | \- org.neo4j:neo4j-cypher-frontend-2.3:jar:2.3.2:compile
[INFO] | | | | +- org.parboiled:parboiled-scala_2.11:jar:1.1.7:compile
[INFO] | | | | | \- org.parboiled:parboiled-core:jar:1.1.7:compile
[INFO] | | | | +- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] | | | | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4.2:compile
[INFO] | | | +- org.neo4j:neo4j-jmx:jar:2.3.2:compile
[INFO] | | | \- org.neo4j:neo4j-consistency-check:jar:2.3.2:compile
[INFO] | | | \- org.neo4j:neo4j-consistency-check-legacy:jar:2.3.2:compile
[INFO] | | +- org.neo4j.driver:neo4j-java-driver:jar:1.0.0-M01:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.3.3:compile
[INFO] | | \- commons-io:commons-io:jar:2.4:compile
[INFO] | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.8:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] \- com.martiansoftware:jsap:jar:2.1:compile
Am I doing something wrong or is this an issue that will be fixed in the future?
Thanks for your help
Not sure how this happened, but it looks like it wants the neo4j-ogm 2.0.0-SNAPSHOT
Could you either do a mvn clean -U ... and see if it fixes the problem, or use the neo4j-ogm snapshot? You'll need to include
<repository>
<id>neo4j-snapshots</id>
<url>http://m2.neo4j.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Update
Your dependency tree includes mixed versions
+- org.neo4j:neo4j-ogm-core:jar:2.0.0-M01:compile
[INFO] | +- org.neo4j:neo4j-ogm-compiler:jar:2.0.0-SNAPSHOT:compile
[INFO] | +- org.neo4j:neo4j-ogm-drivers:jar:2.0.0-SNAPSHOT:compile
It should either have 2.0.0-M01 or 2.0.0-SNAPSHOT but not both, because they are incompatible when it comes to the QueryResult.
Perhaps delete 2.0.0-M01 and 2.0.0-SNAPSHOT from your local maven repository (org/neo4j/neo4j-ogm) and force an update with mvn -U ?