Showing posts with label jps Java Groovy. Show all posts
Showing posts with label jps Java Groovy. Show all posts

Monday, June 22, 2009

If you can't be a good speaker, be a groovy speaker


I will be speaking on groovy and grails at the up coming 2GX conference in New Orleans in October. If you are in the groovy space or you are just looking, you don't want to miss this... all the big names will be there. Most of the leading authors and committers in the groovy, grails and griffon space will be there!

How I got to be among them is beyond me... but it sure is groovy!

My topics include security, where the focus will include defense against hacking techniques such as injection flaws and XSS, followed by a walk through of the security plugin and how to secure urls and services. The second session is on Java memory management, the memory demands of a dynamic language, along with tools on debugging Grails applications in production.

Monday, October 20, 2008

jps - The Java way when you need to kill something Groovy

As a speaker, I'm often showing "how" to do something and often requested for "When" / "Why". I just experienced a great example of this with jps. jps is of course is the Java ps tool that is included with JDK5 and 6. So it is already on a Java developer's machine. It is the platform independent way to get PIDs.

How it Started
The Yak-Shaving started when I decided to run a groovy script from TextMate. I conventiently hit +R. Everything ran the way I wanted it to. Except... There wasn't an end to the program script... idiot! So, I closed TextMate... Still Running....

Step 1
First I went to the command line and did a ps... which didn't result in much. I followed this up with a ps -ef. Way too much info... so I ended with a ps -ef | grep JavaVM. Things just got worst. That is a lot of information!

Solution
Along comes jps. A simple jps (no args) and here are the results
9382
10620 GroovyStarter
10314 JConsole
10761 Jps

There it is GroovyStarter... kill 10620.

... and what if you had multiple GroovyStarter scripts running. Well, jps -m will give you the command-line of the script, which includes the groovy script name.