无法调试java.lang.NoClassDefFoundError:com / google / inject / internal / util / $ Preconditions [英] Can not debug java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions
问题描述
我正在尝试使用jclouds将一个applet上传到OpenStack。
我面对的是NoClassDefFoundError,下面是堆栈跟踪:
线程mainjava.lang中的异常。 NoClassDefFoundError:com / google / inject / internal / util / $在org.nnsoft.guice.rocoto.configuration.ConfigurationModule.configure(ConfigurationModule.java:64)
pre>
前提条件
。com.google.inject。 AbstractModule.configure(AbstractModule.java:59)
,位于com.google.inject.spi.Elements $ RecordingBinder.install(Elements.java:223)
,位于com.google.inject.spi.Elements。 getElements(Elements.java:101)
在com.google.inject.spi.Elements.getElements(Elements.java:92)
在org.nnsoft.guice.rocoto.Rocoto.expandVariables(Rocoto。 java:52)
at org.nnsoft.guice.rocoto.Rocoto.expandVariables(Rocoto.java:47)
at org.jclouds.config.BindPropertiesToExpandedValues.configure(BindPropertiesToExpandedValues.java:47)$ b $ com com.google.inject.AbstractModule.configure(AbstractModule.java:59)$ b $ com com.google.inject .spi.Elements $ RecordingBinder.install(Elements.java:223)
,位于com.google.inject.spi.Elements.getElements(Elements.java:101)
位于com.google.inject.internal .InjectorShell $ Builder.build(InjectorShell.java:133)
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
com.google.inject.Guice.createInjector (Guice.java:95)
在com.google.inject.Guice.createInjector(Guice.java:72)
在com.google.inject.Guice.createInjector(Guice.java:62)
at org.jclouds.ContextBuilder.expandProperties(ContextBuilder.java:385)
at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:320)
at org.jclouds.ContextBuilder.buildView(
at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:600)
at com.cdac.appletclass.Test.main(Test.java:56)
由于:java.lang.ClassNotFoundException:com.google.inject.internal.util。$前提条件
在java .net.URLClassLoader $ 1.run(URLClassLoader.java:366)在java.net.URLClassLoader
$ 1.run(URLClassLoader.java:355)
在java.security.AccessController.doPrivileged(Native方法)在java.net.URLClassLoader.findClass中
(URLClassLoader.java:354)$ java.util.ClassLoader.loadClass中的b $ b(ClassLoader.java:423)$ sun.misc.Launcher
$ AppClassLoader .ClassLoader.loadClass(ClassLoader.java:356)
... 21 more
我搜索了
com / google / inject / internal / util / $ Preconditions
,并且知道它是guice-3.0.jar的一部分。
但是guice-3.0.jar已经在我的项目中了。
如何调试呢?任何帮助.. ???
解决方案我建议从你的应用程序中打印出你的类路径中的内容(参见这个答案)。这样你就可以知道你的应用程序正在使用什么类路径,如果有什么遗漏或碰撞。
I am trying to make an applet for uploading files to openstack swift using jclouds. And I am facing the NoClassDefFoundError, following is the stacktrace:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions at org.nnsoft.guice.rocoto.configuration.ConfigurationModule.configure(ConfigurationModule.java:64) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.spi.Elements.getElements(Elements.java:101) at com.google.inject.spi.Elements.getElements(Elements.java:92) at org.nnsoft.guice.rocoto.Rocoto.expandVariables(Rocoto.java:52) at org.nnsoft.guice.rocoto.Rocoto.expandVariables(Rocoto.java:47) at org.jclouds.config.BindPropertiesToExpandedValues.configure(BindPropertiesToExpandedValues.java:47) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.spi.Elements.getElements(Elements.java:101) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) at com.google.inject.Guice.createInjector(Guice.java:95) at com.google.inject.Guice.createInjector(Guice.java:72) at com.google.inject.Guice.createInjector(Guice.java:62) at org.jclouds.ContextBuilder.expandProperties(ContextBuilder.java:385) at org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:320) at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:620) at org.jclouds.ContextBuilder.buildView(ContextBuilder.java:600) at com.cdac.appletclass.Test.main(Test.java:56) Caused by: java.lang.ClassNotFoundException: com.google.inject.internal.util.$Preconditions at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 21 more
I googled for
com/google/inject/internal/util/$Preconditions
, and came to know that it is part of guice-3.0.jar. But guice-3.0.jar is already there in my project. How to debug then? any help..???解决方案I suggest printing out what's on your classpath from within your app (see this answer). That way you'll know exactly what classpath your app is using, if there's anything missing or any collisions.
这篇关于无法调试java.lang.NoClassDefFoundError:com / google / inject / internal / util / $ Preconditions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!