----- Original Message ----- > From: "Christopher Schultz" <ch...@christopherschultz.net> > To: "Tomcat Users List" <users@tomcat.apache.org> > Sent: Monday, April 30, 2012 10:40:17 AM > Subject: Re: Running Swing app under Tomcat 6 on Linux > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > DG, > > On 4/28/12 4:11 PM, dgchristen...@comcast.net wrote: > > I have a small debugging/monitoring app written in Java/Swing that > > I'd like to run inside Tomcat to help with debugging. > > You are asking for all kinds of pain, here. > > > The app is started by dynamically loading the monitoring class from > > a webservice running under Tomcat. > > So, the GUI monitoring app loads classes from a webservice hosted by > the webapp? Elsewhere in this thread, you said it had to run in the > same JVM because it directly-accesses some of the objects. Those two > statements seem to contradict one another. Thanks for the input. I guess I should give more rationale on why I want to do this. My webservice(s) use an open source project that acts as a DB engine for retrieving data from the DB (google 'zeidonjoe' if any of you are interested). The data engine has a browser that lets a developer view all the retrieved data in a structured GUI. In a way it would be like viewing all your active Hibernate objects, showing data and relationships. It can be a very powerful tool while debugging. The browser is dynamically loaded+started by the data engine and it (the browser) has access to the engine's internal objects so that the DB data can be displayed.
The browser is written using Swing, originally on Windows, and the users (who are engineers) like it. Now I'm trying to get it working on Linux. A better long-term solution would perhaps be to create a JMX API but that's a lot of changes for something that already works on Windows. As always, engineering time is short and I'm looking for the quickest solution that doesn't confine me in the future. I'm open to any alternative ideas if they are relatively quick to implement. DG > > The works in Windows (multiple flavors) but I'm having problems > > getting this running on Ubuntu. > > The presence of the always-running GUI environment in Microsoft > Windows is the reason stuff like this works there. > > > What I've tried so far: > > > > 1) First error I got was an Headless exception. Since the app is a > > GUI app I can't run in headless mode. After searching around I > > changed Tomcat's library path (via -Djava.library.path in > > catalina.sh) to point to the client lib (ie. > > .../java-6-sun-1.6.0.26/jre/lib/i386/client)> instead of the > > server lib. > > You should be able to do this with the "-client" command-line > parameter. I'm not sure why you would need this at all, except maybe > - -server in your environment also implies "headless", which can also > be > changed using a command-line parameter. You shouldn't have to mess > with the java.library.path. > > > 2) After changing the libs the next error was that DISPLAY wasn't > > set. After setting DISPLAY=0.0 in catalina.sh I get "Can't connect > > to X11 with DISPLAY=0.0" error. I've tried different values for > > DISPLAY (e.g. localhost:0.0) and nothing makes a difference. I've > > also tried fiddling around with the policies in case there's a > > permissions error. See below for the call stack. > > As Mark says, you'll need to set this to your actual DISPLAY. When > you're logged-in to your laptop, open an xterm and type "echo > $DISPLAY". Use whatever value that is to attach to your X display. > > If Tomcat is running as a user other than you, then you might also > have to do an "xhost +" as yourself to allow any client to connect to > your X server. > > > The webservice app is a simple RESTEasy implementation. Since this > > works in Windows I'm assuming (perhaps erroneously) that this can > > work in Linux. Any help would be appreciated. > > I'm sure it *can* work in Linux, but the whole thing sounds insane to > me. > > - -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+epFEACgkQ9CaO5/Lv0PD5TQCfaHXWYeFPrDR2H5OMjOyFMHsI > fjQAniXwykkxw5sMfWlCvI9n0zHYNRT8 > =LHQA > -----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