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

3.5.0 and new strict mode: java.lang.IllegalStateException: No entity type for ... #972

Closed
gsmet opened this issue Oct 1, 2014 · 2 comments
Closed
Labels
bug
Milestone

Comments

@gsmet
Copy link

@gsmet gsmet commented Oct 1, 2014

Hi Timo,

I just tried 3.5.0 as you fixed a couple of bugs a colleague of mine reported (#908, #909, #910).

I hit a problem with the processor phase due to the new strictMode behavior: we have a class which isn't annotated with a JPA annotation in our hierarchy and we now have:
[ERROR] error on execute: java.lang.IllegalStateException: No entity type for fr.openwide.core.jpa.business.generic.model.GenericEntity
which seems to be normal due to this commit: 3874f72#diff-04ba2bdca9a881f50dd2d88b4fa35810

2 questions:
1/ are you sure it's a good idea to trigger an error in this case? AFAICS we don't have any issue with this configuration using Hibernate in JPA2 mode and it seems to be supported: http://docs.oracle.com/javaee/6/tutorial/doc/bnbqn.html#bnbqq
2/ I don't see a way to configure the strictMode via the com.mysema.query.apt.jpa.JPAAnnotationProcessor: AFAICS, it's not designed to be configured at all. Is it your intention.

Thanks for your feedback!

@timowest
Copy link
Member

@timowest timowest commented Oct 1, 2014

The error is non-intentional in this case, it should have been just skipped. Could you provide the stacktrace?

strictMode should not be an open configuration flag, but set on the specific AnnotationProcessor. In the JPA case, properties of non-annotated superclasses are now ignored.

@gsmet
Copy link
Author

@gsmet gsmet commented Oct 1, 2014

Here it is:

Caused by: java.lang.IllegalStateException: No entity type for fr.openwide.core.jpa.business.generic.model.GenericEntity
    at com.mysema.query.codegen.EntitySerializer.initEntityFields(EntitySerializer.java:225)
    at com.mysema.query.codegen.EntitySerializer.constructors(EntitySerializer.java:144)
    at com.mysema.query.codegen.EntitySerializer.serialize(EntitySerializer.java:599)
    at com.mysema.query.apt.AbstractQuerydslProcessor.serialize(AbstractQuerydslProcessor.java:583)
    at com.mysema.query.apt.AbstractQuerydslProcessor.serializeMetaTypes(AbstractQuerydslProcessor.java:522)
    at com.mysema.query.apt.AbstractQuerydslProcessor.process(AbstractQuerydslProcessor.java:102)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
    at com.sun.tools.javac.main.Main.compile(Main.java:439)

HTH

@timowest timowest added the bug label Oct 1, 2014
@timowest timowest added this to the 3.5.1 milestone Oct 1, 2014
@timowest timowest closed this in #978 Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.