Bug 731641 - NPE thrown in PetStoreExample
Summary: NPE thrown in PetStoreExample
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: Examples
Version: BRMS 5.2.0-ER1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Geoffrey De Smet
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-18 07:53 UTC by Lukáš Petrovický
Modified: 2011-10-06 08:06 UTC (History)
4 users (show)

Doc Type: Bug Fix
Doc Text:
A NullPointerException is thrown and prevents the PetStorExample from running when the openJDK runtime environment is being used.
Clone Of:
Environment:
java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.3) (fedora-59.1.10.3.fc15-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
Last Closed: 2011-10-06 08:06:33 UTC
Type: ---


Attachments (Terms of Use)

Description Lukáš Petrovický 2011-08-18 07:53:19 UTC
Run examples bundled with ER2, click PetStoreExample, add anything you wish to "the cart". Click "checkout". Click yes on the subsequent dialog. Notice the NPE in the console.

java.lang.NullPointerException
	at sun.awt.X11.XWindowPeer.restoreTransientFor(XWindowPeer.java:1681)
	at sun.awt.X11.XWindowPeer.removeFromTransientFors(XWindowPeer.java:1747)
	at sun.awt.X11.XWindowPeer.setModalBlocked(XWindowPeer.java:1469)
	at sun.awt.X11.XWindowPeer.setModalBlocked(XWindowPeer.java:1440)
	at java.awt.Window.setModalBlocked(Window.java:1359)
	at java.awt.Dialog.unblockWindow(Dialog.java:1597)
	at java.awt.Dialog.modalHide(Dialog.java:1483)
	at java.awt.Dialog.hideAndDisposePreHandler(Dialog.java:1215)
	at java.awt.Dialog.hide(Dialog.java:1255)
	at java.awt.Component.show(Component.java:1553)
	at java.awt.Component.setVisible(Component.java:1503)
	at java.awt.Window.setVisible(Window.java:881)
	at java.awt.Dialog.setVisible(Dialog.java:1011)
	at javax.swing.JOptionPane$3.propertyChange(JOptionPane.java:1021)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:298)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:291)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:229)
	at java.awt.Component.firePropertyChange(Component.java:8148)
	at javax.swing.JOptionPane.setValue(JOptionPane.java:1964)
	at javax.swing.plaf.basic.BasicOptionPaneUI$ButtonActionListener.actionPerformed(BasicOptionPaneUI.java:1204)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:253)
	at java.awt.Component.processMouseEvent(Component.java:6268)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6033)
	at java.awt.Container.processEvent(Container.java:2045)
	at java.awt.Component.dispatchEventImpl(Component.java:4629)
	at java.awt.Container.dispatchEventImpl(Container.java:2103)
	at java.awt.Component.dispatchEvent(Component.java:4455)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
	at java.awt.Container.dispatchEventImpl(Container.java:2089)
	at java.awt.Window.dispatchEventImpl(Window.java:2517)
	at java.awt.Component.dispatchEvent(Component.java:4455)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
	at java.awt.EventQueue.access$000(EventQueue.java:96)
	at java.awt.EventQueue$1.run(EventQueue.java:608)
	at java.awt.EventQueue$1.run(EventQueue.java:606)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
	at java.awt.EventQueue$2.run(EventQueue.java:622)
	at java.awt.EventQueue$2.run(EventQueue.java:620)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:194)
	at java.awt.Dialog$1.run(Dialog.java:1072)
	at java.awt.Dialog$3.run(Dialog.java:1126)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Dialog.show(Dialog.java:1124)
	at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:871)
	at org.drools.examples.petstore.DoCheckout.doCheckout(DoCheckout.java:32)
	at org.drools.examples.petstore.Rule_do_checkout_0.defaultConsequence(Rule_do_checkout_0.java:7)
	at org.drools.examples.petstore.Rule_do_checkout_0DefaultConsequenceInvoker.evaluate(Rule_do_checkout_0DefaultConsequenceInvoker.java:24)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)
	at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
	at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
	at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
	at org.drools.examples.petstore.PetStoreExample$CheckoutCallback.checkout(PetStoreExample.java:433)
	at org.drools.examples.petstore.PetStoreExample$PetStoreUI$CheckoutButtonHandler.mouseReleased(PetStoreExample.java:262)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.Component.processMouseEvent(Component.java:6268)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6033)
	at java.awt.Container.processEvent(Container.java:2045)
	at java.awt.Component.dispatchEventImpl(Component.java:4629)
	at java.awt.Container.dispatchEventImpl(Container.java:2103)
	at java.awt.Component.dispatchEvent(Component.java:4455)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
	at java.awt.Container.dispatchEventImpl(Container.java:2089)
	at java.awt.Window.dispatchEventImpl(Window.java:2517)
	at java.awt.Component.dispatchEvent(Component.java:4455)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
	at java.awt.EventQueue.access$000(EventQueue.java:96)
	at java.awt.EventQueue$1.run(EventQueue.java:608)
	at java.awt.EventQueue$1.run(EventQueue.java:606)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
	at java.awt.EventQueue$2.run(EventQueue.java:622)
	at java.awt.EventQueue$2.run(EventQueue.java:620)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)


Because of the NPE the example does not work.
OpenJDK 6 was used.

Comment 1 Geoffrey De Smet 2011-09-08 12:36:26 UTC
I run this example on sun's JDK 1.6 during every release. I fear it's an openjdk specific problem.

Comment 2 lcarlon 2011-09-19 03:23:22 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A NullPointerException is thrown and prevents the PetStorExample from running when the openJDK runtime environment is being used.

Comment 3 Geoffrey De Smet 2011-09-19 07:52:58 UTC
Cannot reproduce with
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.10.2)
OpenJDK Server VM (build 19.0-b09, mixed mode)

Trying the exact same openjdk version.

Comment 4 Geoffrey De Smet 2011-09-19 08:16:37 UTC
It looks like it's caused by this issue in IcedTea (used by OpenJDK):
  https://bugzilla.redhat.com/show_bug.cgi?id=730015
That NPE is an regression from java-1.6.0-openjdk-1.6.0.0-57 (which might or might not be what I am using locally).
and fixed on 2011-08-30 for the next IcedTea build.
There is no talk of an easy workaround.

Please update to the next OpenJDK version as soon as it's released and verify if it still occurs there.

Comment 5 Lukáš Petrovický 2011-10-06 08:06:33 UTC
This is not a bug in our code, but a OpenJDK regression. NOTABUG


Note You need to log in before you can comment on or make changes to this bug.