Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error due to QueryDSL annotation processor in Spring Data Couchbase 5.2.4 #1929

Closed
ajschutte opened this issue Apr 3, 2024 · 4 comments · Fixed by #1930, #1934 or #1935
Closed
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@ajschutte
Copy link

We just upgraded to Spring Boot 3.2.4 and Spring Data Couchbase 5.2.4. We are getting the compilation error below. Adding that javax dependency is not an option since we migrated to jakarta. There also does not seem to be an obvious way to disable QueryDSL annotation processing, at least not with Maven. We are really not interested in using QueryDSL with Couchbase.

I temporarily got around the issue by doing this:

        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <version>${querydsl.version}</version>
            <classifier>jakarta</classifier>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-couchbase</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.querydsl</groupId>
                    <artifactId>querydsl-apt</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Our previous version was 5.2.2, so something changed from 5.2.2 -> 5.2.4 that causes this.

The error is pretty easy to replicate with a minimal project (that does not include the legacy javax library).

Caused by: java.lang.NoClassDefFoundError: javax/inject/Inject
    at com.querydsl.codegen.AbstractModule.createInstance (AbstractModule.java:125)
    at com.querydsl.codegen.AbstractModule.get (AbstractModule.java:95)
    at com.querydsl.apt.DefaultConfiguration.getTypeMappings (DefaultConfiguration.java:480)
    at com.querydsl.apt.AbstractQuerydslProcessor.process (AbstractQuerydslProcessor.java:85)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:1023)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 3, 2024
@mikereiche
Copy link
Collaborator

mikereiche commented Apr 3, 2024

The error is pretty easy to replicate with a minimal project

Can you provide that please.

The dependency was removed because of #1917

@mikereiche
Copy link
Collaborator

Is the solution to add <classifier>jakarta</classifier> in the dependency for querydsl in spring-data-couchbase?

@ajschutte
Copy link
Author

ajschutte commented Apr 4, 2024 via email

@mikereiche mikereiche added this to the 5.2.5 (2023.1.5) milestone Apr 5, 2024
mikereiche added a commit that referenced this issue Apr 5, 2024
mikereiche added a commit that referenced this issue Apr 6, 2024
mikereiche added a commit that referenced this issue Apr 8, 2024
mikereiche added a commit that referenced this issue Apr 8, 2024
@mikereiche mikereiche reopened this Apr 10, 2024
mikereiche added a commit that referenced this issue Apr 11, 2024
mikereiche added a commit that referenced this issue Apr 11, 2024
mikereiche added a commit that referenced this issue Apr 11, 2024
mikereiche added a commit that referenced this issue Apr 11, 2024
@mikereiche
Copy link
Collaborator

This is the fix to exclude javax.inject, but not have CouchbaseAnnotationProcessor fail when it is missing - instead just output a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment