1

我将 QPid 与 Eclipse 和 Tomcat 一起使用。创建了一个动态 Web 应用程序并设置了 QPID_HOME、QPID_WORK 环境变量。

试用这里提到的 Hello.java 示例:-

https://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example/

但是我在运行这个文件时遇到了这些错误:-

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/qpid/url/URLSyntaxException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at myApp.runTest(myApp.java:25)
    at myApp.main(myApp.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.qpid.url.URLSyntaxException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
 ... 9 more
4

1 回答 1

4

看起来你失踪了:

qpid-common-0.10.jar

可从http://qpid.apache.org/download.html获得

或者

<dependency>
   <groupId>org.apache.qpid</groupId>
   <artifactId>qpid-common</artifactId>
   <version>0.10</version>
</dependency>

如果您使用的是 Maven。

于 2012-07-23T17:00:33.420 回答