----- Original Message ----- > From: Christopher Schultz <ch...@christopherschultz.net> > To: Tomcat Users List <users@tomcat.apache.org> > Cc: > Sent: Tuesday, May 1, 2012 2:00 PM > Subject: Re: Running Swing app under Tomcat 6 on Linux > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > DG, > > On 5/1/12 1:39 PM, dgchristen...@comcast.net wrote: >> Mark, you are a genius. I followed the above and the Swing app >> starts without a problem. If anybody's willing to explain it, I'd >> like to understand what the difference is between starting Tomcat >> via startup.sh and starting it as a service. > > If you run Tomcat as a "service" (whatever that means under Linux), > then it probably runs as some user other than "you" (the one who owns > the X environment). When you run it as "you", then you get access to > X. > > It would work as a service if: > > 1. X starts before Tomcat
+1 At least on CentOS Tomcat starts at run level 3, so you won't have an X server available. You could try the following, but again I don't know if you can enforce the order. As root, do the following: chkconfig --levels 34 tomcat6 off chkconfig --list tomcat6 You should only see tomcat6 start up on run level 5, which is multi-user plus X. Now, add the display variable (DISPLAY=localhost:0.0 or maybe DISPLAY=localhost.localdomain:0.0) to setenv.sh. This is provided that the Ubuntu scripts do the right thing and execute setenv.sh . . . I of course have no idea what happens when a person runs your web application remotely. I'm not sure that this will help, but at least it's a shot. /mde/ > 2. X is configured with "xhost +" for whatever user it is > 3. Tomcat's startup can have the proper DISPLAY variable set > (localhost:0?) > > - -chris > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk+gTuoACgkQ9CaO5/Lv0PBh6QCbBMXdRUUp6ZQyd+X4YzIahs8O > GB0An35Yf17m5FdrQXrW6OlRaUFvFput > =w5WE > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org