Problem with Google App Engine 1.9.7 and IntelliJ 13.1.3 - Enhancement step fails

Hi

I'm having trouble just getting a basic PoC of Google App Engine to run on IntelliJ 13.1.3
No matter which persistance technology I choose (JDO 2, JDO 3, JPA 1, JPA 2) the enhancement step fails when running locally.

The steps to reproduce:
1) Create a new project
2) Choose Web Application and Google App Engine (nothing else is checked to minimize any confusion) - The current SDK is 1.9.7 but I had the same issue with 1.9.6.
3) Choose a Persistance technology of your choice for GAE (doesn't matter which one, they all fail with similar error messages)
4) Name the project and click finish

At this point, you can compile and run in dev mode no problem. One can even modify the JSP file and add some text to see that the server is running. Fantastic.

5) Add a file, any file. I just have a simple Pojo with 1 field in it...
6) Compilation now fails at the enhancement step.

The interesting part of build.log is:
2014-07-18 00:01:53,073 [   1402]  DEBUG - ncement.EnhancerProcessHandler - "C:/Program Files/Java/jdk1.8.0_05/bin/java" -Xmx256m -classpath "/C:/Program Files (x86)/JetBrains/IntelliJ IDEA 13.1.3/lib/idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\mno\.IntelliJIdea13\system\compile-server\_temp_\classpath8921724849732147239.tmp com.intellij.appengine.rt.EnhancerRunner C:\Users\mno\.IntelliJIdea13\system\compile-server\_temp_\appEngineEnhanceFiles6085612102246883770.txt com.google.appengine.tools.enhancer.Enhance -api JDO -enhancerVersion v2 -v
2014-07-18 00:01:53,382 [   1711]  DEBUG - ncement.EnhancerProcessHandler - Encountered a problem: Unexpected exception
2014-07-18 00:01:53,382 [   1711]  DEBUG - ncement.EnhancerProcessHandler - Please see the logs [C:\Users\mno\AppData\Local\Temp\enhance7008192238185978340.log] for further information.
20

The refenced log file: enhance7008192238185978340.log is:
java.lang.RuntimeException: Unexpected exception
 at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
 at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
 at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:483)
 at com.intellij.appengine.rt.EnhancerRunner.main(EnhancerRunner.java:51)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:483)
 at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:483)
 at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
 ... 12 more
Caused by: java.lang.NoSuchFieldError: NUCLEUS_CONTEXT_LOADER
 at org.datanucleus.NucleusContext.<clinit>(NucleusContext.java:75)
 at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:160)
 at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1133)
 ... 17 more


This is GAE 1.9.7 (set to JDO 3 in the project creation dialogue), IntelliJ 13.1.3, JDK 1.8.0_05

Perhaps I'm missing something absolutely obvious, but I've spent quite a few odd hours over the past few nights trying out different combinations just to get a simple PoC running on GAE with IntelliJ and no matter what I can't get it to work and can't find anyone else online that has a solution.

I've atteched the full build log (it's actually two builds, first one I forgot to set the loglevel to debug).

Hoping someone can come with a silver bullet. :)
/Mikael



Attachment(s):
build.log.zip
2 comments
Comment actions Permalink

Hello, Mikael,

looks like classpath for the enhancement step was changed in the latest versions of App Engine and it now clashes with jars added to classpath by IDEA. I've fixed the problem in IDEA 14 branch. To fix the problem in IDEA 13.1.3 you can replace <IDEA_HOME>/plugins/GoogleAppEngine/lib/google-app-engine-jps-plugin.jar by the attached one.



Attachment(s):
google-app-engine-jps-plugin.jar
0
Comment actions Permalink

Hi Nikolay

Thank you for responding with a fix. I'll try it over the weekend and let you know how it works.

Have a great weekend.

Best regards,
Mikael

0

Please sign in to leave a comment.