tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <its_toas...@yahoo.com>
Subject Re: Running Swing app under Tomcat 6 on Linux
Date Wed, 02 May 2012 02:03:34 GMT
----- Original Message -----

> From: Christopher Schultz <chris@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, dgchristensen@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message