History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: HJMS-178
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Colin Crist
Reporter: Mark van Holsteijn
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
HermesJMS

Moving a message results in a NullPointerException

Created: 15/Dec/11 06:05 AM   Updated: 11/Jan/12 06:48 AM
Component/s: None
Affects Version/s: 1.14
Fix Version/s: 1.15

Environment: Windows7, JDK 1.6, Oracle AQ


 Description  « Hide
Drag a message from an Oracle AQ queue, drop it on an Oracle AQ queue, Click Send -> NullPpointerException

This problem is caused by the fact that the Oracle message has properties with null values and the setProperties() routine deferences the value. Having null values for mesage properties is allowed according to the JMS specification.

java.lang.NullPointerException
at hermes.browser.dialog.message.UserHeaderPropertyPanel.setProperties(UserHeaderPropertyPanel.java:49)
at hermes.browser.dialog.message.MessageEditorDialog.onOK(MessageEditorDialog.java:195)
at hermes.browser.dialog.message.MessageEditorDialog$1.actionPerformed(MessageEditorDialog.java:119)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


 All   Comments   Change History      Sort Order:
Mark van Holsteijn [15/Dec/11 06:06 AM]
you can assign this issue to me.

Colin Crist [09/Jan/12 03:55 AM]

Mark, whats your proposed solution for this?

I can fix this particular issue easily by checking for null however look at the UserHeaderPropertyPanel ctor and in particular this:

for (Enumeration<String> e = message.getPropertyNames(); e.hasMoreElements();) {
PropertyRow row = new PropertyRow();
row.name = e.nextElement();
row.value = message.getObjectProperty(row.name);
row.type = PropertyType.fromObject(row.value);
model.addRow(row);
}

How do I avoid losing the type information when getObjectProperty returns null

Mark van Holsteijn [09/Jan/12 05:27 AM]
When the value is null, you can assign the type "String" to the value. According to the JMS Message API specification (http://docs.oracle.com/javaee/1.4/api/javax/jms/Message.html) the Message implementation must support conversions from String to the required property type.

You could also use setObjectProperty() in UserHeaderPropertyPanel.setProperties() but this is a bigger change possibly effective non-conformant JMS message implementations.


Colin Crist [09/Jan/12 07:50 AM]
Ah I see.

PropertyType.fromObject behaves this way already which is probably why the panel renders correctly - I was wondering...

Thanks.