From users-return-30444-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Tue Mar 20 07:28:19 2012 Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21B0B9C6C for ; Tue, 20 Mar 2012 07:28:19 +0000 (UTC) Received: (qmail 92363 invoked by uid 500); 20 Mar 2012 07:28:18 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 91908 invoked by uid 500); 20 Mar 2012 07:28:13 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 91877 invoked by uid 99); 20 Mar 2012 07:28:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 07:28:12 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.208.139.99] (HELO mail.besharp.at) (213.208.139.99) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 20 Mar 2012 07:28:05 +0000 Received: by mail.besharp.at (Postfix, from userid 503) id 112FFFE0001; Tue, 20 Mar 2012 08:27:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.besharp.at X-Spam-Level: Received: from exchange.besharp.at (unknown [192.168.20.13]) by mail.besharp.at (Postfix) with ESMTP id B454CF28034 for ; Tue, 20 Mar 2012 08:27:43 +0100 (CET) Received: from EXCHANGE.besharp.at ([fe80::ed71:ef3a:695a:3035]) by exchange.besharp.at ([fe80::ed71:ef3a:695a:3035%10]) with mapi; Tue, 20 Mar 2012 08:27:43 +0100 From: Gerald Weber To: "users@activemq.apache.org" Subject: Embedded Broker / AJAXServlet / Jetty Thread-Topic: Embedded Broker / AJAXServlet / Jetty Thread-Index: Ac0GastFLjXatkF+QICig6a9VATW6g== Date: Tue, 20 Mar 2012 07:27:40 +0000 Message-ID: Accept-Language: de-AT, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: multipart/alternative; boundary="_000_D1925DECD316894DAADB84076C1B7D82367004E7exchangebesharp_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,HTML_MESSAGE, NORMAL_HTTP_TO_IP,RDNS_NONE autolearn=no version=3.3.1 --_000_D1925DECD316894DAADB84076C1B7D82367004E7exchangebesharp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, i'm using activemq 5.4.3 together with Jetty 8.1.2. I built a java program using an embedded broker in a thread. The thread cre= ates a topic, reads messages from ZeroMQ and sends them to the topic. In the program, i enabled a jetty embedded server using the AJAXServlet in = a ServletContextHandler (addServlet). After that, a HTML/JS page using amq.js is connecting to the jetty with the= uri in the amq.init call. My problem: "Error occurred in poll. HTTP result: 0, status: parsererror". in the Firef= ox console. Facts: - I wrote a java test program subscribing to the topic and printing the mes= sages to the console. The topic exists and the messages are displayed corre= ctly. - The messages are text containing JSON format. - If i connect with the browser to the jetty url / port (http://127.0.0.1:8= 080/amq), nothing happens. After a timeout (25s), "" is displayed although messages were avail= able during that time. So i guess my Jetty setup is wrong, ..somewhere. The code initializing Jetty is here: QueuedThreadPool threadPool =3D new QueuedThreadPoo= l(); threadPool.setMaxThreads(30); Server server =3D new Server(8080); server.setSendDateHeader(true); server.setThreadPool(threadPool); server.setSendServerVersion(true); ServletContextHandler context =3D new ServletContextHandler= (ServletContextHandler.SESSIONS); context.setContextPath("/"); context.setInitParameter("org.apache.activemq.brokerURL", b= rokerURL); context.setInitParameter("org.apache.activemq.embeddedBroke= r", "true"); server.setHandler(context); context.addServlet(new ServletHolder(new AjaxServlet()),"/= amq/*"); context.addServlet(new ServletHolder(new HelloServlet()),"= /hello"); server.start(); server.join(); Jetty basically works, a GET http://127.0.0.1:8080/hello works. Can anyone give me a hint or tell me what i did wrong ? regards, gw --_000_D1925DECD316894DAADB84076C1B7D82367004E7exchangebesharp_--