This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167144

Summary: AssertionError and IllegalStateException exception occurs while deleting functoid
Product: soa Reporter: Vitaly Bychkov <lativ>
Component: BPEL MapperAssignee: Sergey Lunegov <slunegov>
Status: REOPENED ---    
Severity: blocker CC: lativ, raghuvirkamath, rajvenka
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: The Exception StackTrace

Description Vitaly Bychkov 2009-06-16 08:27:05 UTC
AssertionError and IllegalStateException exception occurs while deleting functoid.
Steps to reproduce:

1. Create Synhronous Sample
2. Open Synchronous.bpel 
3. Select Assign1 and switch to the Mapper
4. Add String->Concat fucntion to the outputVar/resultType/paramA band
5. press Delete - AssertionError occurs:
java.lang.AssertionError: Action org.netbeans.modules.bpel.mapper.tree.actions.BpelDeleteGraphSelectionAction may not be
invo
ked from the thread Module-Actions, only the event queue:
http://www.netbeans.org/download/4_1/javadoc/OpenAPIs/apichanges.ht
ml#actions-event-thread
        at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:65)
        at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
        at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:277)
        at org.openide.util.actions.CallbackSystemAction$DelegateAction$1.run(CallbackSystemAction.java:593)
        at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:111)
        at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:104)
        at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:52)
        at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:102)
        at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:71)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

6. Add String->Concat function to the inputVar/resultType/paramA band
7. press Delete - IllegalStateException occurs:
java.lang.IllegalStateException: This must happen in the event thread!
        at org.openide.awt.Actions$Bridge.propertyChange(Actions.java:638)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
        at org.openide.util.SharedClassObject.firePropertyChange(SharedClassObject.java:454)
        at org.openide.util.SharedClassObject.putProperty(SharedClassObject.java:329)
        at org.openide.util.actions.SystemAction.setEnabled(SystemAction.java:147)
        at org.openide.util.actions.CallbackSystemAction.updateEnabled(CallbackSystemAction.java:157)
        at org.openide.util.actions.CallbackSystemAction.access$300(CallbackSystemAction.java:76)
        at
org.openide.util.actions.CallbackSystemAction$ActionDelegateListener.propertyChange(CallbackSystemAction.java:540)

        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
        at org.openide.util.SharedClassObject.firePropertyChange(SharedClassObject.java:454)
        at org.openide.util.SharedClassObject.putProperty(SharedClassObject.java:329)
        at org.openide.util.actions.SystemAction.setEnabled(SystemAction.java:147)
        at org.openide.util.actions.NodeAction.setEnabled(NodeAction.java:230)
        at org.netbeans.modules.bpel.mapper.tree.actions.BpelCutAction.mapperSelectionChanged(BpelCutAction.java:113)
        at org.netbeans.modules.soa.mappercore.SelectionModel.fireSelectionChanged(SelectionModel.java:95)
        at org.netbeans.modules.soa.mappercore.SelectionModel.updateSelectedItems(SelectionModel.java:380)
        at org.netbeans.modules.soa.mappercore.SelectionModel.access$100(SelectionModel.java:50)
        at org.netbeans.modules.soa.mappercore.SelectionModel$ListenersImpl.graphBoundsChanged(SelectionModel.java:389)
        at org.netbeans.modules.soa.mappercore.model.Graph.fireGraphBoundsChanged(Graph.java:166)
        at org.netbeans.modules.soa.mappercore.model.Graph.invalidateBounds(Graph.java:514)
        at org.netbeans.modules.soa.mappercore.model.Graph.removeVertex(Graph.java:356)
        at org.netbeans.modules.bpel.mapper.model.BpelMapperModel.delete(BpelMapperModel.java:651)
        at org.netbeans.modules.soa.mappercore.DeleteMapperAction.actionPerformed(DeleteMapperAction.java:81)
        at
org.netbeans.modules.bpel.mapper.tree.actions.BpelDeleteGraphSelectionAction.performAction(BpelDeleteGraphSelectio
nAction.java:79)
        at org.openide.util.actions.NodeAction.performAction(NodeAction.java:289)
        at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118)
        at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:111)
        at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:104)
        at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:52)
        at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:102)
        at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:71)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 1 Nikita Krjukov 2009-11-10 13:11:25 UTC
I can't reproduce the bug. 

Actually some lines of description looks like broken. And also it's better to save stack traces as separate attachments. It's difficult to read them such way.
Comment 2 Vitaly Bychkov 2009-11-11 09:04:59 UTC
Still reproducable.

But now it isn't reproducable every time.
First of all be sure that assertion is enabled, 
e.g. add to the :
<netbeans inst dir>/etc/netbeans.conf 
to the string started with "netbeans_default_options" additional option: "-J-ea"

1. create Synchronous sample
2. open Synchronous.bpel
3. double click on Assign1
4. in bpel mapper add Concat functoid to the outputVar/resultType/paramA band
5. switch to the diagramm
6. double click on Assign1
7. press del on selected Concat functoid 
An assertion error appears(see attachment)

If there is no exception try different combinations or repeat several times, it looks like an exception always appears if one switches to the mapper by using double click and press del just after it i.e. the functoid to be deleted should be selected in mapper at previous step.
Comment 3 Vitaly Bychkov 2009-11-11 09:10:10 UTC
Created attachment 90821 [details]
The Exception StackTrace
Comment 4 Nikita Krjukov 2009-11-12 12:01:08 UTC
Fixed in gfesbv22. 

I'm not absolutely sure that it is fixed because "it isn't reproducible every time". But I didn't manage to reproduce it again. 

The exception happens because the action is processed by Request Processor instead of being processed in event dispatch thread. 

I added method    

   protected boolean asynchronous() {
        return false;
   }

to all mapper's system actions: Copy, Cat, Delete, Find. It had already been implemented for Past. 

You can find some details here http://bits.nbextras.org/dev/javadoc/org-openide-util/org/openide/util/actions/CallableSystemAction.html#asynchronous%28%29
Comment 5 Alexander Permyakov 2009-12-04 09:24:10 UTC
I could reproduce on the build gfesbv22_613_20091204_1344.
Comment 6 Nikita Krjukov 2009-12-08 12:00:31 UTC
I didn't manage to reproduce the issue. It looks like it's not stable. 
A new stack trace is required because it has to be changed after my latest fix. 
The old one should be obsolete. 

Please attach a stack trace once you catch the exception again.
Comment 7 Alexander Permyakov 2009-12-09 04:36:36 UTC
I reproduced this on gfesbv22_629_20091208_2300,
don't forget enabled assertion (-J-ea)  


java.lang.AssertionError: Action org.netbeans.modules.soa.xpath.mapper.actions.MapperDeleteGraphSelectionAction may not be invoked from the thread Module-Actions, only the event queue: http://www.netbeans.org/download/4_1/javadoc/OpenAPIs/apichanges.html#actions-event-thread
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:64)
	at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
	at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:284)
	at org.openide.util.actions.CallbackSystemAction$DelegateAction$1.run(CallbackSystemAction.java:593)
	at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:111)
	at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:106)
	at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:53)
	at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:102)
	at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:71)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
Caused: org.openide.util.RequestProcessor$Item: task failed due to
	at org.openide.util.RequestProcessor.post(RequestProcessor.java:267)
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:75)
	at org.openide.util.actions.CallbackSystemAction$DelegateAction.actionPerformed(CallbackSystemAction.java:597)
	at org.openide.windows.TopComponent.processKeyBinding(TopComponent.java:1052)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2895)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2812)
	at java.awt.Component.processEvent(Component.java:5911)
	at java.awt.Container.processEvent(Container.java:2023)
	at java.awt.Component.dispatchEventImpl(Component.java:4501)
	at java.awt.Container.dispatchEventImpl(Container.java:2081)
	at java.awt.Component.dispatchEvent(Component.java:4331)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
	at java.awt.Component.dispatchEventImpl(Component.java:4373)
	at java.awt.Container.dispatchEventImpl(Container.java:2081)
	at java.awt.Window.dispatchEventImpl(Window.java:2458)
	at java.awt.Component.dispatchEvent(Component.java:4331)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	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)
Comment 8 Nikita Krjukov 2009-12-10 09:12:42 UTC
The more specific steps are required to reproduce the issue in the repayable way:
- Open a BPEL file
- Select an Assign and switch to the Mapper
- Put selection to a function on the canvas. Add a function if there isn't any. 
- Be aware the function is selected! It has to have a green border. 
- Switch to Design view
- Double click on the same Assign, the mapper will appear again
- Now the function is selected but the canvas isn't focused. The horizontal line with the function is gray. It is light blue when it is focused. 
- Press Delete button and the exception appears.
Comment 9 Nikita Krjukov 2009-12-10 11:09:44 UTC
It looks like a similar problem has been fixed in trunk with the issue #168547

But it's impossible to check by migrating to 6.7 branch because there are too many changes had been maid before that. It's not enough to migrate only the changes maid in the fix of the issue #168547.
Comment 10 Nikita Krjukov 2009-12-10 11:39:31 UTC
I'm going to reduce priority to P3

The problem happens only if the asserts are switched on (-J-ea). If they are switched off, everything works pretty well. The only risk is processing UI in a thread other then Event Queue. 

Moreover, even if the asserts are switch on, the exception doesn't totally prevent ability to delete a function. It can be done after changing focus to mapper or even without changing by calling Delete action from Main menu --> Edit --> Delete
Comment 11 Nikita Krjukov 2009-12-10 12:04:59 UTC
A workaround fix was added to GF ESB v22 & v23

It's NECESSARY TO REMOVE the workaround after migration to NetBeans 6.8 platform.
Comment 12 Nikita Krjukov 2009-12-11 05:23:55 UTC
The workaround fix is rolled back because it is considered as harmful.