apt generator not working with java7

Bug #819861 reported by gsubes on 2011-08-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Using JDK 1.7.0 to generate the query classes throws an error:

    [javac] Compiling 58 source files to Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [javac] warning: Supported source version 'RELEASE_6' from annotation processor 'com.mysema.query.apt.QuerydslAnnotationProcessor' less than -source '1.7'
    [javac] Note: Running QuerydslAnnotationProcessor
    [javac] Note: Serializing Supertypes
    [javac] error: de.invesdwin.gemeinsam.beans/QAValueObject.java
    [javac] Note: Running QuerydslAnnotationProcessor
    [javac] 1 error
    [javac] 1 warning

This happens when using source="1.6" and target="1.6" on the javac target that invokes the apt processor:

    [javac] Compiling 58 source files to Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [javac] Note: Running QuerydslAnnotationProcessor
    [javac] Note: Serializing Supertypes
    [javac] error: de.invesdwin.gemeinsam.beans/QAValueObject.java
    [javac] Note: Running QuerydslAnnotationProcessor
    [javac] 1 error

The same problem, just without the warning...
This happens with any class file.

I remove the source version annotations from the processors. Now they should work with Java 7. Could you verify this?

Changed in querydsl:
status: New → In Progress
Changed in querydsl:
status: In Progress → Fix Committed
gsubes (gsubes) wrote :

Does not work for me, the first build I had done errored out with the same exception as before and now maven does not want to build the querydsl-apt project anymore.

See attached maven log.

gsubes (gsubes) wrote :

This sounds suspicious:
warning: No SupportedSourceVersion annotation found on com.mysema.query.apt.jpa.JPAAnnotationProcessor, returning RELEASE_6.
Note: Running JPAAnnotationProcessor

gsubes (gsubes) wrote :

Maybe if you compile the annotation processor with Java6, it won't be able to be used in Java7?

How do I change the java version to compile for in your maven configuration files?

gsubes (gsubes) wrote :

Or maybe you can attach the built jars to this ticket or add them as snapshots to the repo so i can use those to test? That would simplify testing for me. :)

gsubes (gsubes) wrote :

Here another maven log after cleaning the querydsl-apt project before building it. Now the compiler errors are also visible.

I tried now a different approach in the Annotation processors :

    @Override
    public SourceVersion getSupportedSourceVersion() {
        return SourceVersion.latest();
    }

I uploaded the latest snapshot to our Maven repository : http://source.mysema.com/maven2/snapshots/

The version is 2.2.0.BUILD-SNAPSHOT

Changed in querydsl:
status: Fix Committed → In Progress
gsubes (gsubes) wrote :

Still not working, atleast now there is no warning :)

   [delete] Deleting directory Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [mkdir] Created dir: Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [JAVAC] Compiling 58 source files to Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [JAVAC] Note: Running JPAAnnotationProcessor
    [JAVAC] Note: Running JPAAnnotationProcessor
    [JAVAC] Compiling 58 source files to Z:\Entwicklung\inv-finanzdaten\trunk\03_module\de.invesdwin.gemeinsam\gen
    [JAVAC] Note: Running QuerydslAnnotationProcessor
    [JAVAC] Note: Serializing Supertypes
    [JAVAC] error: de.invesdwin.gemeinsam.beans/QAValueObject.java
    [JAVAC] Note: Running QuerydslAnnotationProcessor
    [JAVAC] 1 error

Is there a way to enable debug statements on the apt processor to see why the error occured on the file?
Maybe you could try running this yourself with an installation of java7. I have the impression that you should get the same error with any query class as I do.

I tried now myself and fixed the issue. Some APT method semantics had changed.

Fixed in SVN trunk.

Changed in querydsl:
status: In Progress → Fix Committed
gsubes (gsubes) wrote :

Could you please update the Snapshot release in the repo so I can try again? Thanks!

Updated

gsubes (gsubes) wrote :

it is working now, thanks!

Released in 2.2.1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers