Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE98CDC1E for ; Fri, 24 May 2013 09:36:21 +0000 (UTC) Received: (qmail 57409 invoked by uid 500); 24 May 2013 09:36:21 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 57364 invoked by uid 500); 24 May 2013 09:36:21 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 57177 invoked by uid 99); 24 May 2013 09:36:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 09:36:20 +0000 Date: Fri, 24 May 2013 09:36:20 +0000 (UTC) From: "Nico Brys (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-1831) Message.getStringProperty("JMSXProducerTXID") throws java.lang.NumberFormatException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-1831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666157#comment-13666157 ] Nico Brys commented on AMQ-1831: -------------------------------- This issue should be reopened! We just the method message.getStringProperty("JMSXProducerTXID") and we also get a NumberFormatException. We don't set this property manually on the message! It's activeMQ who does this. > Message.getStringProperty("JMSXProducerTXID") throws java.lang.NumberFormatException > ------------------------------------------------------------------------------------ > > Key: AMQ-1831 > URL: https://issues.apache.org/jira/browse/AMQ-1831 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 5.1.0 > Environment: Windows XP SP2 > Reporter: Joel Turkel > Fix For: 5.3.0 > > > A java.lang.NumberFormatException is thrown when attempting to retrieve the JMSXProducerTXID from a message. The stack trace is: > Exception in thread "main" java.lang.NumberFormatException: For input string: "TX:ID:JTURKEL-690-4629-1214839585805-0:0:1" > at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Integer.parseInt(Integer.java:447) > at java.lang.Integer.(Integer.java:620) > at org.apache.activemq.filter.PropertyExpression$14.evaluate(PropertyExpression.java:147) > at org.apache.activemq.filter.PropertyExpression.evaluate(PropertyExpression.java:194) > at org.apache.activemq.command.ActiveMQMessage.getObjectProperty(ActiveMQMessage.java:447) > at org.apache.activemq.command.ActiveMQMessage.getStringProperty(ActiveMQMessage.java:535) > at com.queue.test.MQTest.testBug(MQTest.java:41) > at com.queue.test.ActiveMQTest.main(ActiveMQTest.java:21) > Here is some simple test code to reproduce the problem: > ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_USER, > ActiveMQConnection.DEFAULT_PASSWORD, ActiveMQConnection.DEFAULT_BROKER_URL) > Connection connection = connectionFactory.createConnection(); > connection.start(); > Session producerSession = connection.createSession(true, Session.SESSION_TRANSACTED); > MessageProducer producer = producerSession.createProducer(producerSession.createQueue("myQueue")); > TextMessage producerMessage = producerSession.createTextMessage("Test Message"); > producer.send(producerMessage); > producer.close(); > producerSession.commit(); > producerSession.close(); > > Session consumerSession = connection.createSession(true, Session.SESSION_TRANSACTED); > MessageConsumer consumer = consumerSession.createConsumer(consumerSession.createQueue("myQueue")); > Message consumerMessage = consumer.receive(1000); > System.out.println(consumerMessage.getStringProperty("JMSXProducerTXID")); > consumer.close(); > consumerSession.commit(); > consumerSession.close(); > connection.close(); > This problem is quite severe for us since we need the transaction id property and would like to certify against ActiveMQ. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira