Ajc Compiler internal error with missing transitive dependencies.

Hi all,

I get a Compiler internal error when compiling a project just after importing it with maven. It uses aspectj, so it compiles with Ajc by default. When I build it in maven, everything works well.

I enabled debug logging for #com.intellij.lang.aspectj.compiler.ajc.AjcCompiler, so below is an excerpt of the debug log.

My project A depends on project B which has a provided dependency on javax.persistence.Entity. It seems that the transitive dependencies are not included in the classpath, which is normally OK for javac, but apparently not for ajc, since I get "can't determine annotations of missing type javax.persistence.Entity "
When we add the dependency as provided to project A as well, it works.

2011-11-30 17:55:18,793 [5432753]  DEBUG - pectj.compiler.ajc.AjcCompiler - temp: -source 1.6 -bootclasspath C:\Program Files\Java\jdk1.6.0_18\jre\lib\alt-rt.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext\sunpkcs11.jar -classpath C:\gp\tmsflux-trunk\application\tmsflux\server-api\target\classes;C:\gp\tmsflux-trunk\domain\target\classes;C:\gp\tmsflux-trunk\util\target\classes;C:\repository\maven2\com\jgoodies\forms\1.0.7\forms-1.0.7.jar;C:\repository\maven2\org\slf4j\slf4j-api\1.5.8\slf4j-api-1.5.8.jar;C:\repository\maven2\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;C:\repository\maven2\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\repository\maven2\commons-io\commons-io\1.4\commons-io-1.4.jar;C:\repository\maven2\com\google\collections\google-collections\1.0\google-collections-1.0.jar;C:\repository\maven2\org\springframework\spring-core\3.0.4.RELEASE\spring-core-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-asm\3.0.4.RELEASE\spring-asm-3.0.4.RELEASE.jar;C:\repository\maven2\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\repository\maven2\org\springframework\spring-beans\3.0.4.RELEASE\spring-beans-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-context\3.0.4.RELEASE\spring-context-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-aop\3.0.4.RELEASE\spring-aop-3.0.4.RELEASE.jar;C:\repository\maven2\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\repository\maven2\org\springframework\spring-expression\3.0.4.RELEASE\spring-expression-3.0.4.RELEASE.jar;C:\repository\maven2\com\thoughtworks\xstream\xstream\1.4.1\xstream-1.4.1.jar;C:\repository\maven2\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;C:\repository\maven2\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;C:\repository\maven2\joda-time\joda-time\2.0\joda-time-2.0.jar;C:\repository\maven2\org\hibernate\hibernate-core\3.5.6-Final\hibernate-core-3.5.6-Final.jar;C:\repository\maven2\antlr\antlr\2.7.6\antlr-2.7.6.jar;C:\repository\maven2\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\repository\maven2\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;C:\repository\maven2\javax\transaction\jta\1.1\jta-1.1.jar;C:\repository\maven2\net\jcip\jcip-annotations\1.0\jcip-annotations-1.0.jar;C:\repository\maven2\org\mortbay\jetty\jetty\6.1.19\jetty-6.1.19.jar;C:\repository\maven2\org\mortbay\jetty\jetty-util\6.1.19\jetty-util-6.1.19.jar;C:\repository\maven2\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;C:\repository\maven2\commons-codec\commons-codec\1.4\commons-codec-1.4.jar;C:\repository\maven2\org\springframework\spring-tx\3.0.4.RELEASE\spring-tx-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-orm\3.0.4.RELEASE\spring-orm-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-jdbc\3.0.4.RELEASE\spring-jdbc-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-aspects\3.0.4.RELEASE\spring-aspects-3.0.4.RELEASE.jar;C:\repository\maven2\org\springframework\spring-context-support\3.0.4.RELEASE\spring-context-support-3.0.4.RELEASE.jar;C:\repository\maven2\com\tangosol\coherence\3.5.3.patch05\coherence-3.5.3.patch05.jar;C:\repository\maven2\com\tangosol\coherence-common\1.7.1\coherence-common-1.7.1.jar;C:\repository\maven2\xmlunit\xmlunit\1.3\xmlunit-1.3.jar;C:\repository\maven2\de\odysseus\juel\juel-api\2.2.1\juel-api-2.2.1.jar;C:\repository\maven2\de\odysseus\juel\juel-impl\2.2.1\juel-impl-2.2.1.jar;C:\repository\maven2\de\odysseus\juel\juel-spi\2.2.1\juel-spi-2.2.1.jar;C:\repository\maven2\poi\poi\2.5.1-final-20040804\poi-2.5.1-final-20040804.jar;C:\repository\maven2\org\aspectj\aspectjrt\1.6.9\aspectjrt-1.6.9.jar;C:\repository\maven2\org\aspectj\aspectjweaver\1.6.9\aspectjweaver-1.6.9.jar;C:/repository/maven2/org/aspectj/aspectjrt/1.6.9/aspectjrt-1.6.9.jar -d C:\gp\tmsflux-trunk\application\tmsflux\server-api\target\classes -aspectpath C:\repository\maven2\org\springframework\spring-aspects\3.0.4.RELEASE\spring-aspects-3.0.4.RELEASE.jar C:\gp\tmsflux-trunk\application\tmsflux\server-api\src\main\java\com\acme\tmsng\server\api\service\characteristics\CharacteristicService.java

2011-11-30 17:55:19,980 [5433940]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: C:\gp\tmsflux-trunk\application\tmsflux\server-api\src\main\java\com\acme\tmsng\server\api\service\characteristics\CharacteristicService.java [error] can't determine annotations of missing type javax.persistence.Entity
2011-11-30 17:55:19,980 [5433940]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: when weaving type com.acme.tmsng.server.api.service.characteristics.CharacteristicService
2011-11-30 17:55:19,980 [5433940]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: when weaving classes  
2011-11-30 17:55:19,980 [5433940]  DEBUG - pectj.compiler.ajc.AjcCompiler - ajc: when weaving  
1 comment

Hi Geert,

It looks IDEA fails to compile 'server-api' module. Could you please check with your Maven project whether the module configured to compile by 'aspectj-maven-plugin', or by standard 'maven-compiler-plugin'?

0

Please sign in to leave a comment.