Trying to get Query Dsl (version 3.1.1) and Spring Data JPA (version 1.3.1.RELEASE) up and running..
My problem is with this error message ...
java.lang.NoSuchMethodError: com.mysema.query.jpa.JPQLQuery.from([Lcom/mysema/query/types/EntityPath;)Lcom/mysema/query/jpa/JPQLCommonQuery;
at org.springframework.data.jpa.repository.support.Querydsl.createQuery(Querydsl.java:88)
at org.springframework.data.jpa.repository.support.QueryDslJpaRepository.createQuery(QueryDslJ paRepository.java:131)
Seems to be like a version compatibility conflict. But what version of QueryDSL should I use for Spring Data JPA 1.3.1.RELEASE?
I was hoping to find the answer here but I couldn't see what is used.
But what version of QueryDSL should I use for Spring Data JPA 1.3.1.RELEASE?
Querydsl 2.9
Related
I am trying to setup correctly JOOQ with Spring Boot project which uses reactive stack based on r2dbc driver for Postgres DB. I came across quite few problems and at the very end "hopefully" I stucked on following error:
Caused by: java.lang.NoSuchMethodError: 'org.jooq.DSLContext org.jooq.impl.DSL.using(io.r2dbc.spi.ConnectionFactory)
here is most relevant part of my build.gradle:
compileOnly("org.jooq:jooq:3.17.5")
compileOnly("org.jooq:jooq-codegen:3.17.5")
compileOnly("org.jooq:jooq-meta-extensions:3.17.5")
implementation("org.jooq:jooq-meta:3.17.5")
implementation("org.jooq:jooq-kotlin-coroutines:3.17.5")
implementation("org.jooq:jooq-kotlin:3.17.5")
runtimeOnly("io.r2dbc:r2dbc-postgresql:0.8.13.RELEASE")
runtimeOnly("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")
runtimeOnly("io.r2dbc:r2dbc-pool:1.0.0.RELEASE")
runtimeOnly("org.postgresql:postgresql:42.5.0")
I am running Spring Boot 2.7.5
The cause of exception is from runtime and is in part of the code:
private val dsl = DSL.using(
ConnectionFactories.get(
ConnectionFactoryOptions
.parse(databaseConfig.url)
.mutate()
.option(USER, databaseConfig.username)
.option(PASSWORD, databaseConfig.password)
.build()
)
)
databaseConfig.url: r2dbc:pool:postgresql://localhost:5432/test
Mostly I have tried changing the dependencies versions as I don't have any other valid idea at the moment.
You're using:
compileOnly("org.jooq:jooq:3.17.5")
This means you're using the latest jOOQ version only at compile time (which is why your code compiles), but at runtime, you're using Spring Boot's jOOQ version, which is older. Try changing that to compile, or add it also to the implementation section
When trying to create a com.mongodb.reactivestreams.client.MongoClient using:
MongoClient mongoClient = MongoClients.create("mongodb://127.0.0.1:27017");
I get the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.mongodb.internal.connection.DefaultClusterableServerFactory.<init>
I'm using mongodb-driver-reactivestreams 4.1.0 dependency and mongo-java-driver 3.12.6
The problem is that you're mixing versions that are not compatible. If you want to use mongodb-driver-reactivestreams 4.1.0, then any other MongoDB dependencies should also be version 4.1.0. If you only want (or need) the reactive driver, then just remove the mongo-java-driver dependency.
If you also need the non-reactive driver then you need to use either mongodb-driver-sync 4.1.0 or mongodb-driver-legacy 4.1.0; the mongo-java-driver dependency was discontinued in version 4.x. See also Upgrading to the 4.0 Driver.
I want MyBatis Generator generate for me source code for working with MyBatis version 3.4.2 . How to choose suitable version of MyBatis Generator?
Just get the latest one.
According to the documentation for the current (1.3.7) version:
MyBatis Generator (MBG) is a code generator for MyBatis MyBatis and
iBATIS. It will generate code for all versions of MyBatis, and
versions of iBATIS after version 2.2.0
Could you please help me with these 2 queries/Issues :
Can anyone who has worked on Jackson 2.9.2 ,let me know what is the compatible Jersey version for Jackson 2.9.2.I am currently using Jersey 2.23.2 but it does not work with Jackson 2.9.2.I get following error :
[ERROR ] SRVE0777E: Exception thrown by application class 'org.glassfish.jersey.servlet.WebComponent.serviceImpl:489'
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.util.BeanUtil.okNameForSetter(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMethod;)Ljava/lang/String;
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290)
2) In general ,is there some way to find combination of Jars.I have faced this issue earlier also while finding right combination of Jersey and Spring jars.It will save my and other's facing same issue lot of time,if someone can guide on this.
Thanks.
As of mid November 2017, the most recent version of Jersey is 2.26.
Jersey supports Jackson via the jersey-media-json-jackson extension module, which is released under the same version number as Jersey core modules. This extension module contains the auto-discoverable JacksonFeature that registers the JacksonJsonProvider class for binding JSON to Java objects.
In the version 2.26, this extension depends on Jackson 2.8.4. While in the version 2.23.2, it depends on Jackson 2.5.4.
The BeanUtil.okNameForSetter(Annotated Method) method was deprecated in Jackson 2.5 and has been removed in Jackson 2.9.
To support the most recent version of Jackson, you could get rid of the jersey-media-json-jackson extension module.
Then add the jackson-jaxrs-json-provider module to your project and register the JacksonJsonProvider directly in your ResourceConfig or Application implementation.
I am getting the same error as below:
[ERROR ] SRVE0777E: Exception thrown by application class 'org.glassfish.jersey.servlet.WebComponent.serviceImpl:489'
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException:
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.util.BeanUtil.okNameForSetter(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMethod;)Ljava/lang/String;
I was able to resolve above issue with
Jersey2 version: 2.23.2
Jackson version: 2.7.4
I'm using scala in my app, it run without problem, but if I add neo4j in the dependencies, it throws a NoSuchMethod error. I didn't even have references to any neo4j classes in my code...
I have no problem using play framework with scala, or play framework (Java) with neo4j, just when using both together, it crash...
and I tried both neo4j 1.4.2 and 1.5.M02 to no avail.
thanks for any help~
Chris
dependencies.yml
# Application dependencies
require:
- play
- play -> scala 0.9.1
- org.neo4j -> neo4j 1.4.2
exception details:
play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:232)
at play.Invoker$Invocation.run(Invoker.java:273)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NoSuchMethodError: scala.collection.generic.GenericTraversableTemplate.flatten(Lscala/Function1;)Lscala/collection/Traversable;
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:18)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:17)
at play.scalasupport.compiler.PlayScalaCompiler$$anonfun$scanFiles$1.apply(ScalaCompiler.scala:15)
at play.scalasupport.compiler.PlayScalaCompiler$.scanFiles(ScalaCompiler.scala:15)
at play.scalasupport.ScalaPlugin$$anonfun$templates$1.apply(ScalaPlugin.scala:178)
at play.scalasupport.ScalaPlugin$$anonfun$templates$1.apply(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.templates(ScalaPlugin.scala:177)
at play.scalasupport.ScalaPlugin.update(ScalaPlugin.scala:195)
at play.scalasupport.ScalaPlugin.detectClassesChange(ScalaPlugin.scala:107)
at play.plugins.PluginCollection.detectClassesChange(PluginCollection.java:358)
at play.Play.detectChanges(Play.java:594)
at play.Invoker$Invocation.init(Invoker.java:186)
... 1 more
it turns out that scala-library-2.9.0-1.jar is included as a dependency for neo4j...
every time I run play dependencies it will be downloaded into the lib folder, after I delete it from the folder, it works without problem (so far I just have code for starting and shutting down of the DB).
The Cypher Query language depends on Scala. We will update that dependency to 2.9.1 for the 1.5 release.