United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6268447 PIT: TrayIcon.displayMessage() throws NPE when notification area is not available on the GNOME Panel
6268447 : PIT: TrayIcon.displayMessage() throws NPE when notification area is not available on the GNOME Panel

Details
Type:
Bug
Submit Date:
2005-05-11
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2005-05-17
Component:
client-libs
OS:
solaris_10
Sub-Component:
java.awt
CPU:
sparc
Priority:
P2
Resolution:
Duplicate
Affected Versions:
6
Fixed Versions:
6

Related Reports
Duplicate:
Relates:
Relates:

Sub Tasks

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
                                     
2005-05-11



Hardware and Software, Engineered to Work Together