GithubHelp home page GithubHelp logo

java.lang.NoClassDefFoundError: javax/inject/Inject: javax.inject.Inject when upgrading to Spring Boot 3.2.4 about spring-data-couchbase HOT 7 CLOSED

cabbonizio avatar cabbonizio commented on May 19, 2024
java.lang.NoClassDefFoundError: javax/inject/Inject: javax.inject.Inject when upgrading to Spring Boot 3.2.4

from spring-data-couchbase.

Comments (7)

mikereiche avatar mikereiche commented on May 19, 2024 1

This is now fixed. It will be available in the May release.

from spring-data-couchbase.

mikereiche avatar mikereiche commented on May 19, 2024

Make sure you have the latest version of spring-data-couchbase which is 5.2.4.

You shouldn't need to have a dependency for com.querydls:querydsl-apt as the dependency is already in spring-data-couchbase (which you would get through spring-boot-starter-data-couchbase)

If your code references java.inject.Inject directly (and apparently it does, otherwise it wouldn't get a compilation error) - I think that should be coming from spring-boot-starter-data-couchbase (something in it other than spring-data-couchbase).

mvn dependency:tree can be used to see where the dependencies come from.

from spring-data-couchbase.

mikereiche avatar mikereiche commented on May 19, 2024

Closing this issue - I haven't heard back. Please reopen if there is more information.

from spring-data-couchbase.

hantsy avatar hantsy commented on May 19, 2024

I encountered the same issue when updating to Spring Boot 3.2.4,

The sample project is here.

https://github.com/hantsy/spring6-sandbox/blob/master/boot-data-couchbase

The dependency tree is here.

--- dependency:3.6.1:tree (default-cli) @ demo ---
[INFO] com.example:demo:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-data-couchbase:jar:3.2.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:3.2.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:3.2.4:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:3.2.4:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.4.14:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.4.14:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.21.1:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.21.1:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:2.0.12:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:2.2:compile
[INFO] |  \- org.springframework.data:spring-data-couchbase:jar:5.2.4:compile
[INFO] |     +- com.querydsl:querydsl-apt:jar:5.0.0:compile
[INFO] |     |  \- com.querydsl:querydsl-codegen:jar:5.0.0:compile
[INFO] |     |     +- com.querydsl:querydsl-core:jar:5.0.0:compile
[INFO] |     |     |  \- com.mysema.commons:mysema-commons-lang:jar:0.2.4:compile
[INFO] |     |     +- com.querydsl:codegen-utils:jar:5.0.0:compile
[INFO] |     |     |  \- org.eclipse.jdt:ecj:jar:3.26.0:compile
[INFO] |     |     \- io.github.classgraph:classgraph:jar:4.8.108:compile
[INFO] |     +- org.springframework:spring-context-support:jar:6.1.5:compile
[INFO] |     +- org.springframework:spring-tx:jar:6.1.5:compile
[INFO] |     +- org.springframework.data:spring-data-commons:jar:3.2.4:compile
[INFO] |     +- com.couchbase.client:java-client:jar:3.4.11:compile
[INFO] |     |  \- com.couchbase.client:core-io:jar:2.4.11:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-databind:jar:2.15.4:compile
[INFO] |     |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.15.4:compile
[INFO] |     |  \- com.fasterxml.jackson.core:jackson-core:jar:2.15.4:compile
[INFO] |     \- org.slf4j:slf4j-api:jar:2.0.12:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:3.2.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:3.2.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.15.4:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.15.4:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.15.4:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:3.2.4:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:10.1.19:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:10.1.19:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:10.1.19:compile
[INFO] |  +- org.springframework:spring-web:jar:6.1.5:compile
[INFO] |  |  +- org.springframework:spring-beans:jar:6.1.5:compile
[INFO] |  |  \- io.micrometer:micrometer-observation:jar:1.12.4:compile
[INFO] |  |     \- io.micrometer:micrometer-commons:jar:1.12.4:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:6.1.5:compile
[INFO] |     +- org.springframework:spring-aop:jar:6.1.5:compile
[INFO] |     +- org.springframework:spring-context:jar:6.1.5:compile
[INFO] |     \- org.springframework:spring-expression:jar:6.1.5:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.32:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.2.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:3.2.4:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.2.4:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.9.0:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.2:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:2.1.3:test
[INFO] |  +- net.minidev:json-smart:jar:2.5.0:test
[INFO] |  |  \- net.minidev:accessors-smart:jar:2.5.0:test
[INFO] |  |     \- org.ow2.asm:asm:jar:9.3:test
[INFO] |  +- org.assertj:assertj-core:jar:3.24.2:test
[INFO] |  |  \- net.bytebuddy:byte-buddy:jar:1.14.12:test
[INFO] |  +- org.awaitility:awaitility:jar:4.2.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.10.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.3.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] |  +- org.mockito:mockito-core:jar:5.7.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.14.12:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.3:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:5.7.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:6.1.5:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:6.1.5:compile
[INFO] |  +- org.springframework:spring-test:jar:6.1.5:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-testcontainers:jar:3.2.4:test
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:3.2.4:compile
[INFO] |  \- org.testcontainers:testcontainers:jar:1.19.7:test
[INFO] |     +- junit:junit:jar:4.13.2:test
[INFO] |     |  \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] |     +- org.apache.commons:commons-compress:jar:1.24.0:test
[INFO] |     +- org.rnorth.duct-tape:duct-tape:jar:1.0.8:test
[INFO] |     |  \- org.jetbrains:annotations:jar:17.0.0:test
[INFO] |     +- com.github.docker-java:docker-java-api:jar:3.3.6:test
[INFO] |     \- com.github.docker-java:docker-java-transport-zerodep:jar:3.3.6:test
[INFO] |        +- com.github.docker-java:docker-java-transport:jar:3.3.6:test
[INFO] |        \- net.java.dev.jna:jna:jar:5.13.0:test
[INFO] +- io.projectreactor:reactor-test:jar:3.6.4:test
[INFO] |  \- io.projectreactor:reactor-core:jar:3.6.4:compile
[INFO] |     \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] +- org.testcontainers:junit-jupiter:jar:1.19.7:test
[INFO] \- org.testcontainers:couchbase:jar:1.19.7:test
[INFO] ------------------------------------------------------------------------

The problem is caused the querydsl that is a dependency of the latest spring data couchbase.

from spring-data-couchbase.

hantsy avatar hantsy commented on May 19, 2024

Excluding com.querydsl:querydsl-apt from spring data couchbase starter can not resolve the issue.

New exception like this when exclude com.querydsl:querydsl-apt at compile time.

 Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  Bad service configuration file, or exception thrown while constructing Processor object: com/querydsl/apt/AbstractQuerydslProcessor

It seems spring data couchbase depends on the QueryDSL APT.

from spring-data-couchbase.

hantsy avatar hantsy commented on May 19, 2024

@mikereiche Please reopen this issue, it cause the spring data couchbase not work at all.

from spring-data-couchbase.

mikereiche avatar mikereiche commented on May 19, 2024

@hantsy - this is being addressed in #1929 .

btw - don't exclude querydsl.

from spring-data-couchbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.