I am trying to build my first Google App Engine WAR and am setting up my own external (outside of Eclipse) Ant build to be executed from the terminal. I'm trying to get the <enhance_war/>
Ant macro working and am running into a bizarre NoSuchMethodError
.
Here's my Ant target:
<target name="package" depends="gendocs">
<echo message="Enhancing WAR JDO classes." />
<enhance_war war="war" />
<echo message="Packaging the WAR file." />
<war destfile="gen/dist/myapp.war" webxml="war/web.xml">
<fileset dir="war">
<includes name="**/*.xml" />
</fileset>
<lib dir="war/WEB-INF/lib" />
<classes dir="war/WEB-INF/classes" />
</war>
</target>
Here's the Ant output when it attempts to execute the package
target:
package:
[echo] Enhancing WAR JDO classes.
[enhance] Encountered a problem: Unexpected exception
[enhance] Please see the logs [/tmp/enhance4426322586552955387.log] for further information.
BUILD FAILED
/home/myuser/sandbox/workbench/eclipse/workspace/myapp/build/build-local.xml:193: The following error occurred while executing this line:
/home/myuser/sandbox/workbench/google/gae-sdk/1.7.1/appengine-java-sdk-1.7.1/config/user/ant-macros.xml:95: Java returned: 1
That ant-macros.xml:95
corresponds to the following line:
<enhance failonerror="true" api="@{api}">
<!-- Rest of the enhance task def -->
</enhance>
So something is going wrong while executing this <enhance />
task, but I can't figure out what.
And finally the log file at /tmp/enhance4426322586552955387.log
:
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)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.NoSuchMethodError: org.datanucleus.plugin.PluginManager.<init>(Lorg/datanucleus/PersistenceConfiguration;Lorg/datanucleus/ClassLoaderResolver;)V
at org.datanucleus.OMFContext.<init>(OMFContext.java:159)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:172)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:150)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1157)
... 7 more
What's going on here? I don't think it's a classpath issue because the org.datanucleus.plugin.PluginManager
class is defined inside of datanucleus-core-1.1.5.jar
, which I absolutely have on the build classpath. Plus its a NoSuchMethodError
, so it makes me feel like I have a JAR hell/versioning issue going on. Any ideas?