[oXygen-user] Non-checked exception in a plugin: silently ignored

Radu Coravu
Tue Jan 25 01:04:18 CST 2011


Hi Florent,

You probably had the code throwing the NullPointerException executed 
when a button was pressed.
In this case the AWT Event Queue Thread complains directly in the 
"System.err" so if you run Oxygen using the startup scripts you should 
get in the console something like:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     at 
ro.sync.sample.plugin.workspace.CustomWorkspaceAccessPluginExtension$2.actionPerformed(CustomWorkspaceAccessPluginExtension.java:154)
     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown 
Source)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at javax.swing.JComponent.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Container.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
     at java.awt.Container.dispatchEventImpl(Unknown Source)
     at java.awt.Window.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)

It's more flexible for the API to allow you to add your own Swing 
buttons, actions and components to toolbars and views than to offer a 
lot of wrapper objects over the Swing *objects*.
This allows someone knowing Java Swing to develop plugins more quickly.

Regards,
Radu

Radu Coravu
<oXygen/>   XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


On 1/24/2011 8:46 PM, Florent Georges wrote:
>    Hi,
>
>    I just got a hard time with a problem with a plugin.  This is a
> workspace plugin which installs a button in its own toolbar.
> After some changes, it started behaving like it was not properly
> fired when clicking on it.  It turned out, after some debugging,
> it was because a null pointer exception was thrown, but silently
> ignored, regardless the level of logging.
>
>    Maybe it would be nice to log such errors, or to provide an
> option to increase such checks if they have some cost, or to
> provide an oXygen-specific Swing action which does such checks and
> reporting.
>
>    Regards,
>





More information about the oXygen-user mailing list