Wednesday, June 13, 2012

Random Stuff With Tomcat and Applets

Lately I've just been blogging about random things that I learned or use that I think others would find helpful. I'll try and have more insightful things up later, but for today, here's more random crap I used today!

Tomcat Server

Use more debuggery.  Should be easy with Tomcat7 right?  Shocker, it is.
1.  cd $CATALINA_HOME #that's the tomcat home
2.  vi bin/
On the first line (after their comments) just drop in

export JPDA_ADDRESS=8787
export JPDA_TRANSPORT=dt_socket

Now at the bottom, comment out

#exec "$PRGDIR"/"$EXECUTABLE" start "$@"
and add in 
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

Terrific, are we done?  Yes.

Linux Distro

I was also using a random linux server today and couldn't figure out what distro it was.  A quick:
cat /etc/issue 
solved that one real quick for me.
Red Hat Enterprise Linux Server

Applet JVM Args

Gah, applets.  Can't believe I'm working with them.  How the hell do you pass jvm args into these damn things??  Turns out you have to set a system env variable

_JPI_VM_OPTIONS='-Xdebug -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'

You gotta restart your browser though.  But now, when my applet runs, it'll sit and wait for me to connect my debugger to it (b/c of the suspend=y).

*I hope you never ever have to do applet development and never have to use this

No comments: