From users-return-16743-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Mon Nov 03 16:18:20 2008 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 81053 invoked from network); 3 Nov 2008 16:18:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2008 16:18:20 -0000 Received: (qmail 89865 invoked by uid 500); 3 Nov 2008 16:18:25 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 89849 invoked by uid 500); 3 Nov 2008 16:18:24 -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 89838 invoked by uid 99); 3 Nov 2008 16:18:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 08:18:24 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 74.125.92.145 as permitted sender) Received: from [74.125.92.145] (HELO qw-out-1920.google.com) (74.125.92.145) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 16:17:08 +0000 Received: by qw-out-1920.google.com with SMTP id 9so1010985qwj.26 for ; Mon, 03 Nov 2008 08:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=zavERDmVV6QN2d7tqcBYnkcq5HqyP4Kdnza5OQpqpIM=; b=x7YnBPkILLehMT8iuPxveQfgxVqC1UzoxHTCmrcxJd77IylrmlIsgwlNcjL4jUEQ0D TITnOzlQFW7Dt+p2rDnHTS6WVRcSbhXiAgUb8sCgLeaqK5OK/RqYfY2d+FpIrbJ/C8n/ cj8tTk7RnBXAidgVSPpp16+ziQxbVHJuAiv94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=Je4PgORBpdhto0IrrqKViNEsGZSHphOztt+j46orSBeQ7vR2EE9rZa83Htj2GqLrLv TXpJVNXoCtADiM/D3sXk8xb8K4lLTZqOq136ut/gE4sO6mP1k41uB2LScfqy2Dh8dysV zfzfM+6WbkjvDMNPncgd692VSSDdRb7P3Lgsk= Received: by 10.214.182.19 with SMTP id e19mr348566qaf.240.1225729058966; Mon, 03 Nov 2008 08:17:38 -0800 (PST) Received: from ?192.168.2.150? ([68.49.143.174]) by mx.google.com with ESMTPS id 9sm6418619ywf.2.2008.11.03.08.17.36 (version=SSLv3 cipher=RC4-MD5); Mon, 03 Nov 2008 08:17:36 -0800 (PST) Subject: Re: problem in sending messages from CMS to a JMS client. From: Timothy Bish To: users@activemq.apache.org In-Reply-To: <20288565.post@talk.nabble.com> References: <20288565.post@talk.nabble.com> Content-Type: text/plain Date: Mon, 03 Nov 2008 11:17:41 -0500 Message-Id: <1225729061.3413.14.camel@office> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org What does the CPP code look like? You may want to try using ActiveMQ-CPP 2.2.1, there were some fixes in the marshaling code that might resolve this. Regards Tim. On Sun, 2008-11-02 at 02:31 -0800, Brian Woolf wrote: > > my pc: > > activeMQ5.0 > cms:activemq-cpp-2.1.3 > java SE 5 > windows xp sp2 > > > this is my code: > > public void onMessage(Message message) { > > System.out.println("Received message: " + message); > try { > > if (message instanceof TextMessage) { > TextMessage txtMsg = (TextMessage)message; > > if (verbose) { > > String msg = txtMsg.getText(); > if (msg.length() > 50) { > msg = msg.substring(0, 50) + "..."; > } > > System.out.println("Received text: " + msg); > } > } else if (message instanceof BytesMessage){ > BytesMessage bytesMessage=(BytesMessage)message; > > if (verbose) { > System.out.println("Received byte: " + message); > } > } > > if (message.getJMSReplyTo() != null) { > replyProducer.send(message.getJMSReplyTo(), > session.createTextMessage("Reply: " + message.getJMSMessageID())); > } > > if (transacted) { > session.commit(); > } else if ( clientAck ) { > message.acknowledge(); > } > > } catch (JMSException e) { > System.out.println("Caught: " + e); > e.printStackTrace(); > } finally { > if (sleepTime > 0) { > try { > Thread.sleep(sleepTime); > } catch (InterruptedException e) { > } > } > } > } > > Received message: ActiveMQTextMessage {commandId = 5, responseRequired = > true, messageId = b0b4a930-7e02-4d72-a319-95990ecf4c54:0:0:0, > originalDestination = null, originalTransactionId = null, producerId = > b0b4a930-7e02-4d72-a319-95990ecf4c54:0:0, destination = queue://TEST.FOO, > transactionId = null, expiration = 0, timestamp = 1225619843203, arrival = > 0, brokerInTime = 1225619843203, brokerOutTime = 1225619843203, > correlationId = null, replyTo = null, persistent = false, type = null, > priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, > compressed = false, userID = null, content = > org.apache.activemq.util.ByteSequence@1430b5c, marshalledProperties = null, > dataStructure = null, redeliveryCounter = 0, size = 0, properties = null, > readOnlyProperties = true, readOnlyBody = true, droppable = false, text = > null} > > the error happen: > > javax.jms.JMSException: java.io.UTFDataFormatException > at > org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) > at > org.apache.activemq.command.ActiveMQTextMessage.getText(ActiveMQTextMessage.java:90) > at MQServer.onMessage(Unknown Source) > at > org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:946) > at > org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122) > at > org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192) > at > org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:118) > at > org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:42) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.io.UTFDataFormatException > at > org.apache.activemq.util.MarshallingSupport.readUTF8(MarshallingSupport.java:372) > at > org.apache.activemq.command.ActiveMQTextMessage.getText(ActiveMQTextMessage.java:85) >