JDK-6268447 : PIT: TrayIcon.displayMessage() throws NPE when notification area is not available on the GNOME Panel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2005-05-11
  • Updated: 2011-01-19
  • Resolved: 2005-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
I am running a java app which adds a tray icon to the notification area and displays a message. When I run this on SolarisSparc10-JDS machine where notification area is not added to the panel, TrayIcon.displayMessage() throws a NullPointerException. This is incorrect. When notification area is not available on the panel, all subsequent tray icon calls must be ignored. 

Here is the exception:
Exception in thread "main" java.lang.NullPointerException
at sun.awt.X11.XTrayIconPeer.displayMessage(XTrayIconPeer.java:221)
at java.awt.TrayIcon.displayMessage(TrayIcon.java:536)
at SystemTrayTest.<init>(SystemTrayTest.java:91)
at SystemTrayTest.main(SystemTrayTest.java:225)

This is reproduced on SolarisSparc10-JDS with the following PIT build:

java version "1.6.0-awt.pit-int-awt-blade"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-awt.pit-int-awt-blade-df153228_06_May_2005_08_56-b00)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b35, mixed mode)

Run the attached test on a system which does not have notification area added to the panel. You will get the above exception.
###@###.### 2005-05-11 07:26:10 GMT

Comments
EVALUATION Should detect somehow System Notification Area availability. ###@###.### 2005-05-11 08:43:22 GMT
11-05-2005