qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alasdair MacLeod (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Created: (QPID-906) java.lang.NumberFormatException silently ignored in MessageListener.onMessage(Message message)
Date Sun, 06 Apr 2008 00:03:24 GMT
java.lang.NumberFormatException silently ignored in MessageListener.onMessage(Message message)
----------------------------------------------------------------------------------------------

                 Key: QPID-906
                 URL: https://issues.apache.org/jira/browse/QPID-906
             Project: Qpid
          Issue Type: Bug
          Components: Java Client
    Affects Versions: M2.1
         Environment: JDK 1.6
            Reporter: Alasdair MacLeod
            Priority: Minor


If the property is missing the following code will generate an exception:
			Message msg = consumer.receive();
			System.out.println ("Received message ["+msg.getIntProperty("sequence")+"] sent to "+msg.getJMSDestination());
//This works

Exception in thread "main" java.lang.NumberFormatException: null
	at java.lang.Integer.parseInt(Unknown Source)
	at java.lang.Byte.parseByte(Unknown Source)
	at java.lang.Byte.valueOf(Unknown Source)
	at java.lang.Byte.valueOf(Unknown Source)
	at org.apache.qpid.client.message.JMSHeaderAdapter.getByte(JMSHeaderAdapter.java:171)
	at org.apache.qpid.client.message.JMSHeaderAdapter.getShort(JMSHeaderAdapter.java:185)
	at org.apache.qpid.client.message.JMSHeaderAdapter.getInteger(JMSHeaderAdapter.java:198)
	at org.apache.qpid.client.message.AbstractJMSMessage.getIntProperty(AbstractJMSMessage.java:361)
	at VerySimpleReceive.receiveLoop(VerySimpleReceive.java:94)
	at VerySimpleReceive.main(VerySimpleReceive.java:71)

If the same getIntProperty() is called in a MessageListener's onMessage() method then the
exception is not reported and the application continues.  I would expect at the very least
that the error would be logged to standard error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message