querydsl / apt-maven-plugin

Maven APT plugin
Apache License 2.0
79 stars 41 forks source link

Have this error when trying to configure the plugin #33

Closed shopizer-ecommerce closed 9 years ago

shopizer-ecommerce commented 9 years ago

javax.lang.model.type.UnknownTypeException: Unknown type: java.lang.Object&java.io.Serializable&java.lang.Comparable (com.mysema.maven:apt-maven-plugin:1.0.5:process:default:generate-sources)

        <plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.5</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>${sm-core.querydsl.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
            <classifier>apt</classifier>
            <version>${sm-core.querydsl.version}</version>
        </dependency>
    </dependencies>
</plugin>
timowest commented 9 years ago

Which Querydsl version do you use? And which JDK? Also do you have the full stacktrace?

timowest commented 9 years ago

@shopizer-ecommerce Could you provide a little bit for information on your issue?

johnktims commented 9 years ago

Closing due to lack of response. Please comment again and we can reopen the issue if you're still having trouble.

SheikhG1900 commented 9 years ago

This issue is related to kind of instrumentation in the class JPAAnnotationProcessor. It should have been fixed in mentioned but for the time being, following is the way around of this problem.

modify class definition of com.salesmanager.core.business.generic.model.SalesManagerEntity to SalesManagerEntity<K extends Comparable<K>, E extends SalesManagerEntity<K, ?>>

timowest commented 9 years ago

Could you provide the full stacktrace? On 17 Jun 2015 08:15, "SheikhG1900" notifications@github.com wrote:

This issue is related to kind of instrumentation in the class JPAAnnotationProcessor. It should have been fixed in mentioned but for the time being, following is the way around of this problem.

modify class definition of com.salesmanager.core.business.generic.model.SalesManagerEntity to SalesManagerEntity<K extends Comparable, E extends SalesManagerEntity<K, ?>>

— Reply to this email directly or view it on GitHub https://github.com/querydsl/apt-maven-plugin/issues/33#issuecomment-112653890 .

SheikhG1900 commented 9 years ago

I was having same error mentioned by @shopizer-ecommerce while executing mvn install on sm-core-model project that is

javax.lang.model.type.UnknownTypeException: Unknown type: java.lang.Object&java.io.Serializable&java.lang.Comparable (com.mysema.maven:apt-maven-plugin:1.0.5:process:default:generate-sources)

Actually problem was in JPAAnnotationProcessor it is assuming java.lang.Object&java.io.Serializable&java.lang.Comparable a single class, instead of checking them individually.

karlchan-cn commented 9 years ago

hi @SheikhG1900 i wonder how to fix these problem. i just can't import shopizer into eclipse for developing without problems.

SheikhG1900 commented 9 years ago

@karlchan-cn modify class definition of com.salesmanager.core.business.generic.model.SalesManagerEntity to SalesManagerEntity<K extends Comparable, E extends SalesManagerEntity<K, ?>> it is the workaround, not a proper resolution. Hope it will help you.

liukaitj commented 9 years ago

I changed the version of com.mysema.querydsl:querydsl-* to the newest 3.6.6 and compile works fine now. I'm using JDK8u45.

yuzhiping commented 9 years ago

i have the same problem and i solve it use @SheikhG1900 provided method,but now i meet another problem when i use Right-click shopizer > Run As > Maven install :below is my full full stacktrace:

[INFO] Reactor Summary: [INFO] [INFO] shopizer ........................................... SUCCESS [ 0.490 s] [INFO] sm-core-model ...................................... SUCCESS [ 21.172 s] [INFO] sm-core-modules .................................... SUCCESS [ 0.747 s] [INFO] sm-core ............................................ FAILURE [03:32 min] [INFO] sm-shop ............................................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:55 min [INFO] Finished at: 2015-10-05T12:51:05+08:00 [INFO] Final Memory: 36M/350M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project sm-core: Could not resolve dependencies for project com.shopizer:sm-core:jar:2.0.3-SNAPSHOT: The following artifacts could not be resolved: com.shopizer:sm-search:jar:0.0.5-SNAPSHOT, com.shopizer:shopizer-shipping-distance-processor:jar:0.0.1, javax.ws.rs:jsr311-api:jar:1.1.1, com.mysema.querydsl:querydsl-apt:jar:3.6.6: Could not find artifact com.shopizer:sm-search:jar:0.0.5-SNAPSHOT in org.springframework.maven.snapshot (http://maven.springframework.org/snapshot) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :sm-core

johnktims commented 9 years ago

@yuzhiping That doesn't look like a querydsl problem. Please ask questions like that on Stackoverflow.