Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 60686 invoked from network); 11 May 2009 12:04:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 May 2009 12:04:51 -0000 Received: (qmail 65259 invoked by uid 500); 11 May 2009 12:04:51 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 65209 invoked by uid 500); 11 May 2009 12:04:51 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 65199 invoked by uid 99); 11 May 2009 12:04:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2009 12:04:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of marcus.schroeder@gmail.com designates 209.85.218.159 as permitted sender) Received: from [209.85.218.159] (HELO mail-bw0-f159.google.com) (209.85.218.159) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2009 12:04:42 +0000 Received: by bwz3 with SMTP id 3so2884996bwz.33 for ; Mon, 11 May 2009 05:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=iYQi1ddG5Lg0MS9MZ3B7Jlc2d5gHWiVGXuPHlAWTKlM=; b=uABlUvEKGnsb1lt1+rwVXFYoO1qbpdjiTqp4W4m0A1jnB8grdtzS4otOjasWMg06zS 6bDSax6RSF2iwwOMkg/PV9ri7T+Vhg2sWcJg8XOnT7lGm4SKR93ipiaEv0+XFVjtYrlU wrD2BKyXXEt1oQRicMdAxu0KkDtr+KsvQt6LI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=vEcVb5AIc5Fbz2EXUIrieawb6yvS1S+rEBe46fv+8bT4s13/yraRsUlgbTalOhxO1w qSt8AHccvno4EhLWqHgHWeuKv2ZduY0ZCe5h6rcdkOGq4PPjGZxp02JwCCwqAWQ+SqV3 DNJaQYknP4prAcTyiX+yZmaVYu7656cEsEtL4= MIME-Version: 1.0 Received: by 10.223.113.136 with SMTP id a8mr3608745faq.101.1242043461491; Mon, 11 May 2009 05:04:21 -0700 (PDT) Date: Mon, 11 May 2009 14:04:21 +0200 Message-ID: <7a8095c70905110504i33e7d37dg45339792b0fbfe83@mail.gmail.com> Subject: Using the Java client From: =?ISO-8859-1?Q?Marcus_Schr=F6der?= To: users@qpid.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm trying to set up a QPID system here and am running the M4-C++ Broker, which I can access with the C++ and Ruby clients. The Java client, however, I cannot get working. When trying to compile the code examples, a bunch of errors occur: mss@marcus-desktop:~/Desktop/qpid-0.5/java/client/example/she/qpid/example/simple/reqresp$ javac -cp /home/mss/qpid-client-0.5/lib/qpid-all.jar Client.java ---------- 1. ERROR in Client.java (at line 24) import javax.jms.Connection; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 2. ERROR in Client.java (at line 25) import javax.jms.ConnectionFactory; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 3. ERROR in Client.java (at line 26) import javax.jms.Destination; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 4. ERROR in Client.java (at line 27) import javax.jms.JMSException; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 5. ERROR in Client.java (at line 28) import javax.jms.Message; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 6. ERROR in Client.java (at line 29) import javax.jms.MessageConsumer; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 7. ERROR in Client.java (at line 30) import javax.jms.MessageListener; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 8. ERROR in Client.java (at line 31) import javax.jms.MessageProducer; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 9. ERROR in Client.java (at line 32) import javax.jms.Queue; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 10. ERROR in Client.java (at line 33) import javax.jms.Session; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 11. ERROR in Client.java (at line 34) import javax.jms.TextMessage; ^^^^^^^^^ The import javax.jms cannot be resolved ---------- 12. ERROR in Client.java (at line 41) public class Client implements MessageListener ^^^^^^^^^^^^^^^ MessageListener cannot be resolved to a type ---------- 13. ERROR in Client.java (at line 62) Connection connection; ^^^^^^^^^^ Connection cannot be resolved to a type ---------- 14. ERROR in Client.java (at line 63) Session session; ^^^^^^^ Session cannot be resolved to a type ---------- 15. ERROR in Client.java (at line 64) Destination responseQueue; ^^^^^^^^^^^ Destination cannot be resolved to a type ---------- 16. ERROR in Client.java (at line 67) MessageProducer _producer; ^^^^^^^^^^^^^^^ MessageProducer cannot be resolved to a type ---------- 17. ERROR in Client.java (at line 70) connection = ((ConnectionFactory) lookupJNDI(CONNECTION_JNDI_NAME)).createConnection(); ^^^^^^^^^^^^^^^^^ ConnectionFactory cannot be resolved to a type ---------- 18. ERROR in Client.java (at line 72) session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ^^^^^^^ Session cannot be resolved ---------- 19. ERROR in Client.java (at line 74) Destination requestQueue = (Queue) lookupJNDI(QUEUE_JNDI_NAME); ^^^^^^^^^^^ Destination cannot be resolved to a type ---------- 20. ERROR in Client.java (at line 74) Destination requestQueue = (Queue) lookupJNDI(QUEUE_JNDI_NAME); ^^^^^ Queue cannot be resolved to a type ---------- 21. ERROR in Client.java (at line 85) MessageConsumer responseConsumer = session.createConsumer(responseQueue); ^^^^^^^^^^^^^^^ MessageConsumer cannot be resolved to a type ---------- 22. ERROR in Client.java (at line 93) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 23. ERROR in Client.java (at line 100) TextMessage txtMessage; ^^^^^^^^^^^ TextMessage cannot be resolved to a type ---------- 24. ERROR in Client.java (at line 116) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 25. ERROR in Client.java (at line 127) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 26. ERROR in Client.java (at line 136) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 27. ERROR in Client.java (at line 156) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 28. ERROR in Client.java (at line 158) System.err.println("A problem occured while shutting down the connection : " + e); ^ e cannot be resolved ---------- 29. ERROR in Client.java (at line 169) public void onMessage(Message message) ^^^^^^^ Message cannot be resolved to a type ---------- 30. ERROR in Client.java (at line 174) if (message instanceof TextMessage) ^^^^^^^^^^^ TextMessage cannot be resolved to a type ---------- 31. ERROR in Client.java (at line 176) TextMessage textMessage = (TextMessage) message; ^^^^^^^^^^^ TextMessage cannot be resolved to a type ---------- 32. ERROR in Client.java (at line 176) TextMessage textMessage = (TextMessage) message; ^^^^^^^^^^^ TextMessage cannot be resolved to a type ---------- 33. ERROR in Client.java (at line 188) catch (JMSException e) ^^^^^^^^^^^^ JMSException cannot be resolved to a type ---------- 33 problems (33 errors) ------- When I add the javaee.jar from a current GlassFish installation to the classpath, these get reduced to: )mss@marcus-desktop:~/Desktop/qpid-0.5/java/client/examplehe/qpid/example/simple/reqresp$ javac -cp /opt/SDK/lib/javaee.jar:/home/mss/qpid-client-0.5/lib/qpid-all.jar Client.java ---------- 1. WARNING in Client.java (at line 233) Context ctx = null; ^^^ The local variable ctx is never read ---------- 1 problem (1 warning) ---------- Running the result fails, however: )mss@marcus-desktop:~/Desktop/qpid-0.5/java/client/example/she/qpid/example/simple/reqresp$ java Client Exception in thread "main" java.lang.NoClassDefFoundError: Client (wrong name: org/apache/qpid/example/simple/reqresp/Client) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ------------- Any suggestions how to resolve this? My setup is running on Ubuntu 8.04 (in a VM). I use the Sun Java SDK 1.6.0_07 and tried the 0.5-RC2 Java client for this. Kind regards, Marcus --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org