Forum Stats

  • 3,875,076 Users
  • 2,266,801 Discussions
  • 7,912,074 Comments

Discussions

【HeadlessException】Start a GUI AP when Solaris restart

Hi all:

i have a GUI AP, i want it to launch when i login Java Desktop of Solaris. I use YAJSW to wrap my GUI AP as a Daemon. However, after restart and login Java Desktop, my standalone GUI AP doesn't startup. I check the wrapper's log file and find an exception:

NFO|wrapper|10-10-28 11:24:08|set state IDLE->STARTING
INFO|wrapper|10-10-28 11:24:08|starting Process
INFO|wrapper|10-10-28 11:24:08|Controller State: UNKNOWN -> WAITING
INFO|wrapper|10-10-28 11:24:09|working dir /Desktop/Wrapper/yajsw-beta-10.4/Test
INFO|wrapper|10-10-28 11:24:15|found script scripts/trayMessage.gv
INFO|wrapper|10-10-28 11:24:15|exec:/usr/java/jdk1.6.0_21/bin/java -classpath /Desktop/Wrapper/yajsw-beta-10.4/./wrapperApp.jar:/Desktop/Wrapper/yajsw-beta-10.4/Test/HelloWorld.jar -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper.visible=false -Dwrapper.pidfile=/var/run/wrapper.HelloWorld.pid -Dwrapper.config=/Desktop/Wrapper/yajsw-beta-10.4/conf/wrapper.conf -Dwrapper.port=15003 -Dwrapper.key=-6028769435685280879 -Dwrapper.teeName=-6028769435685280879$1288236249051 -Dwrapper.tmpPath=/var/tmp org.rzo.yajsw.app.WrapperJVMMain
INFO|wrapper|10-10-28 11:24:16|started process 627
INFO|wrapper|10-10-28 11:24:16|started process with pid 627
INFO|wrapper|10-10-28 11:24:16|set state STARTING->RUNNING
INFO|627/0|10-10-28 11:24:26|Oct 28, 2010 11:24:26 AM org.apache.commons.vfs.VfsLog info
INFO|627/0|10-10-28 11:24:26|INFO: Using "/var/tmp/vfs_cache" as temporary files store.
INFO|627/0|10-10-28 11:24:30|external stop false
INFO|627/0|10-10-28 11:24:31|Controller State: WAITING -> ESTABLISHED
INFO|627/0|10-10-28 11:24:32|Controller State: ESTABLISHED -> LOGGED_ON
INFO|627/0|10-10-28 11:24:32|Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException:
INFO|wrapper|10-10-28 11:24:32|Trigger found: Exception
INFO|wrapper|10-10-28 11:24:32|start script scripts/trayMessage.gv
INFO|627/0|10-10-28 11:24:32| No X11 DISPLAY variable was set, but this program performed an operation which requires it .
INFO|627/0|10-10-28 11:24:32| at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
INFO|627/0|10-10-28 11:24:32| at java.awt.Window.<init>(Window.java:432)
INFO|627/0|10-10-28 11:24:32| at java.awt.Frame.<init>(Frame.java:403)
INFO|627/0|10-10-28 11:24:32| at java.awt.Frame.<init>(Frame.java:368)
INFO|627/0|10-10-28 11:24:32| at javax.swing.JFrame.<init>(JFrame.java:158)
INFO|627/0|10-10-28 11:24:32| at test.HelloWorldFrame.<init>(HelloWorldFrame.java:11)
INFO|627/0|10-10-28 11:24:32| at test.TrayIconDemo$1.run(TrayIconDemo.java:38)
INFO|627/0|10-10-28 11:24:32| at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
INFO|627/0|10-10-28 11:24:32| at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
INFO|wrapper|10-10-28 11:24:33|end script scripts/trayMessage.gv
INFO|wrapper|10-10-28 11:24:34|exit code linux process 0
INFO|627/0|10-10-28 11:24:34|Controller State: LOGGED_ON -> WAITING_CLOSED
INFO|627/0|10-10-28 11:24:34|Controller State: WAITING_CLOSED -> PROCESS_KILLED
INFO|wrapper|10-10-28 11:24:34|restart process due to default exit code rule
INFO|wrapper|10-10-28 11:24:34|shutdown process due to exit code rule
INFO|wrapper|10-10-28 11:24:34|set state RUNNING->STATE_ABORT
INFO|wrapper|10-10-28 11:24:34|set state STATE_ABORT->IDLE


I search about this exception and seem like to set "-Djava.awt.headless=true" but it doesn't work because my GUI AP really needs AWT Library.
So how to fix this problem?

Edited by: 806434 on 2010/10/29 下午 8:48
This discussion has been closed.