1
我試圖設置一個使用appengine
插件的項目。我有多個錯誤,可能是因爲我不知道如何將它們結合在一起。gradle with appengine插件
例如,當執行gradle appengineRun
時,一切正常,直到我在瀏覽器中打開網站的那一刻。然後我收到:
org.datanucleus.exceptions.NucleusUserException:
Found Meta-Data for class com.sample.Message but this class is not enhanced!!
Please enhance the class before running DataNucleus.
快看看任務列表表明,有適當的任務:appengineEnhance
。不幸的是,當任務運行時,它會失敗並帶有神祕的異常J ava returned: 1
。但在日誌中我發現更多的描述性消息:
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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
據我瞭解,罐之間存在一些不兼容性。任何想法如何解決這個問題?
我build.gradle
文件如下:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.8.7'
}
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
providedCompile 'com.google.code.gson:gson:2.2.2'
providedCompile 'com.google.guava:guava:14.0.1'
providedCompile 'org.apache.commons:commons-lang3:3.1'
providedCompile 'commons-io:commons-io:2.4'
def jacksonVer = '2.2.0'
providedCompile "com.fasterxml.jackson.core:jackson-core:$jacksonVer"
providedCompile "com.fasterxml.jackson.core:jackson-databind:$jacksonVer"
providedCompile 'javax:javaee-api:6.0'
providedCompile 'com.google.appengine:appengine-api-1.0-sdk:1.8.7'
providedCompile 'org.reflections:reflections:0.9.9-RC1'
providedCompile 'org.datanucleus:datanucleus-core:3.1.3'
}
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}
appengine {
httpPort = 6380
}
對我來說,就好像您使用的Datanucleus庫與AppEngine SDK版本不兼容。我試圖在AppEngine郵件列表上詢問這個問題。 –