Qxxxx cannot be resolved to a type -- randomly occurring bug

1,010 views
Skip to first unread message

Marty Pitt

unread,
Jun 3, 2013, 7:42:33 PM6/3/13
to quer...@googlegroups.com
I have this bug on my project, where QueryDSL sometimes doesn't generate the Q*** classes for a subset of the classes.

I've had this bug for months, but our project is pretty large - and, despite hours trying, I haven't been able to create a standalone project to demonstrate the issue.

Here's my setup:

 * QueryDSL 2.8.2 - (apt,apt-one-jar,codegen,collections,core,jpa)  (AFAIK I can't upgrade, as Spring Data seems incompatable with the later releases)
 * apt-maven-plugin 1.0.4

The error that's generated is normally Qxxxxx cannot be resolved to a type.

This error is repeated for 4 of my @Entity classes.  There's nothing special about them that I can see.
I have many more @Entity classes that have their classes consistently generated without issue.

This occurs always after a clean, or after updating my pom.xml (adding / removing dependencies).  In addition, it also occurs as part of a 'normal' build - though not always.  I haven't been able to work out what the triggers are, but it occurs frequently.

When the error does occur, I comment out the @Entity declarations on the classes, compile again (creates different errors), then uncomment that code, and recompile.  At this point, all the compilation errors are gone.

The issue never occurs on our build server, only within our IDE.  (STS 3.2, running on Eclipse 3.8).
The issue happens for everyone in the team.

I recognise that this on it's own is not sufficient information to file a bug report, or expect someone else to solve this problem for me.
However, I simply cannot reproduce this issue outside of the project.

I'd love some pointers on things to do to try to debug how the issue is occurring?  Is it possible to breakpoint the code generation, and step through it?  Can I turn on diagnostic logging somehow?  Are there other techniques I can use to get under the hood of the code generation to try and debug what's happening?

I apologise for such a vague report / request.  I have tried everything else I could think of before posting here, but cannot work out what to try next.  Any help would be greatly appreciated.

Regards


Marty Pitt

Timo Westkämper

unread,
Jun 8, 2013, 3:40:14 PM6/8/13
to quer...@googlegroups.com


On Tuesday, June 4, 2013 2:42:33 AM UTC+3, Marty Pitt wrote:
I have this bug on my project, where QueryDSL sometimes doesn't generate the Q*** classes for a subset of the classes.

I've had this bug for months, but our project is pretty large - and, despite hours trying, I haven't been able to create a standalone project to demonstrate the issue.

Here's my setup:

 * QueryDSL 2.8.2 - (apt,apt-one-jar,codegen,collections,core,jpa)  (AFAIK I can't upgrade, as Spring Data seems incompatable with the later releases)
 * apt-maven-plugin 1.0.4

Querydsl 2.9.0 is compiatible with Spring Data

Try apt-maven-plu
 

The error that's generated is normally Qxxxxx cannot be resolved to a type.

This error is repeated for 4 of my @Entity classes.  There's nothing special about them that I can see.
I have many more @Entity classes that have their classes consistently generated without issue.

This occurs always after a clean, or after updating my pom.xml (adding / removing dependencies).  In addition, it also occurs as part of a 'normal' build - though not always.  I haven't been able to work out what the triggers are, but it occurs frequently.

When the error does occur, I comment out the @Entity declarations on the classes, compile again (creates different errors), then uncomment that code, and recompile.  At this point, all the compilation errors are gone.

The issue never occurs on our build server, only within our IDE.  (STS 3.2, running on Eclipse 3.8).
The issue happens for everyone in the team.

I recognise that this on it's own is not sufficient information to file a bug report, or expect someone else to solve this problem for me.
However, I simply cannot reproduce this issue outside of the project.

I'd love some pointers on things to do to try to debug how the issue is occurring?  Is it possible to breakpoint the code generation, and step through it?  Can I turn on diagnostic logging somehow?  Are there other techniques I can use to get under the hood of the code generation to try and debug what's happening?

Try the upgraded versions.
 

I apologise for such a vague report / request.  I have tried everything else I could think of before posting here, but cannot work out what to try next.  Any help would be greatly appreciated.

Br,
Timo
 

Regards


Marty Pitt

Marty Pitt

unread,
Jun 12, 2013, 12:54:58 AM6/12/13
to quer...@googlegroups.com
Ok, I've updated to:
* QueryDSL 3.2.0
* apt-maven-plugin 1.1.0

Still having the same issues.

Here's my <plugin /> config, in case there's something askew there:


<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>${querydsl.apt.version}</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<classifier>apt</classifier>
<version>${querydsl.version}</version>
</dependency>
</dependencies>
</plugin>

Timo Westkämper

unread,
Jun 12, 2013, 12:41:47 PM6/12/13
to quer...@googlegroups.com
Hi.

Could you provide some logs? The configuration looks ok.

Br,
Timo

Marty Pitt

unread,
Jun 13, 2013, 10:36:03 AM6/13/13
to quer...@googlegroups.com
Is there something I can do to turn on logging?

I've looked in Error Log, and there's nothing detailed in there - just a bunch of

   Generating package.QEntity for [Entity]

logs.

Can I somehow enable more detailed logging?
Reply all
Reply to author
Forward
0 new messages