尝试使用源地图时出现java.lang.NoClassDefFoundError:org/json/JSONException [英] java.lang.NoClassDefFoundError: org/json/JSONException when attempting to use Source Maps
问题描述
期待已久的超级开发模式来了并且我尝试使用它.构建GWT干线后,我创建了一个测试应用程序并成功编译了它.然后,我将其添加到模块XML文件中,旨在启用Chrome的源地图:
The long awaited Super Dev Mode came and I attempted to use it. After building GWT trunk I created a test app and compiled it successfully. I then added this to the module XML file with the intent to enable Source Maps for Chrome:
<!-- Allows debugging without DevMode -->
<set-property name="compiler.useSourceMaps" value="true">
<when-property-is name="user.agent" value="safari" />
</set-property>
然后我尝试编译该应用程序.输出如下:
I then tried to compile the application. The output was the following:
Compiling module com.hsi.gwt.test.sdm.Hello_sdm
Compiling 6 permutations
Compiling permutation 0...
Compiling permutation 1...
Compiling permutation 2...
Compiling permutation 3...
Compiling permutation 4...
Compiling permutation 5...
Source Maps Enabled
Compile of permutations succeeded
Linking into /Users/bbrudnoy/Workspaces/indigo-hsi/hello-sdm/war/hello_sdm
Invoking Linker Export CompilationResult symbol maps
[ERROR] Failed to link
java.lang.NoClassDefFoundError: org/json/JSONException
at com.google.gwt.thirdparty.debugging.sourcemap.SourceMapGeneratorV3.mergeMapSection(SourceMapGeneratorV3.java:243)
at com.google.gwt.core.linker.SymbolMapsLinker.link(SymbolMapsLinker.java:299)
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.invokeLinkForOnePermutation(StandardLinkerContext.java:372)
at com.google.gwt.dev.Link.finishPermutation(Link.java:491)
at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:453)
at com.google.gwt.dev.Link.link(Link.java:200)
at com.google.gwt.dev.Compiler.run(Compiler.java:262)
at com.google.gwt.dev.Compiler.run(Compiler.java:198)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
at com.google.gwt.dev.Compiler.main(Compiler.java:177)
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 12 more
我想念什么?
推荐答案
编辑:此问题在GWT 2.5中已解决
this is fixed in GWT 2.5
这是一个已知问题: http://code.google.com/p/google-web-toolkit/issues/detail?id=7397
作为一种快速的解决方法,可以将gwt-servlet-deps.jar添加到类路径中.
As a quick workaround, you can add the gwt-servlet-deps.jar to the classpath.
顺便说一句,超级开发模式会自动生成源地图,您无需在模块中启用它们(但现在您必须启用超级开发模式并使用xsiframe链接器)
BTW, Super Dev Mode will automatically generate source maps, you don't need to enable them in your module (but for now you have to enable Super Dev Mode and use the xsiframe linker)
这篇关于尝试使用源地图时出现java.lang.NoClassDefFoundError:org/json/JSONException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!