Not Having a Groovy Day


I got my copy of Groovy in Action a couple of days ago and ever since I’ve been reading and trying to apply everything I’ve learned. While the book is great and Groovy still remains one of my favorite languages to date I’ve been having trouble getting anything to work quite right. It started with an experiment to split up this big ol’ fat XSL-FO document I have sitting on my hard drive. It’s a pretty hefty XSL doc sized at over 20MB. I read over the Groovy XML chapter and got really excited. I was like, “Wow! I bet I could write a five or ten liner groovy script to split up this big ol’ XSL doc!” Big ol’ fat chance! The more I hacked into it the more complicated things got. For starters the whole point of my Groovy toying was to come up with a low memory footprint way of transforming the document so that I could feed it through the piggy FOP engine and see if I could convert it to PDF without needing to page out memory. It turns out my Groovy solution needs a good chunk of memory too even as I’m using the XmlSlurper object. I posted some pleas on the Groovy user list via Nabble. (If you use mailing lists frequently it behooves you to check out Nabble.) After a couple of iterations with Tug Wilson I figured it wasn’t worth my time to continue. But I didn’t want to give up entirely. I switched to a SAX based implementation which initially wanted to count the nested elements that cause the FOP renderer to cough up a hair ball. That started throwing Verify errors for which I posted on Nabble. They (the errors) were explained as compiler bugs. So now I go through GinA some more and see some references on XQuery (a language I’ve not yet touched but wanted to learn). I get side tracked and spend some time playing with Saxon for the first time. Between the examples from Dr. Kay’s 10 XQuery tutorial and the examples in GinA (which have nothingto do with each other, just my trying to doand learn everything at once) I get the big idea that life would be so much easier if I could talk to the internet without our in office authenticating HTTP “ROBO-Bouncer” proxy blocking the door to the club. I fought the proxy many times in the past. Sometimes I win. Well today I didn’t win.

In short, I scoured the web, read misc. articles and came up short. I’m now wondering why doing something as simple as fetching the msn homepage from behind a proxy has to become a college thesis. Why doesn’t Sun bundle a dependable Base64 algorithm in the JDK? Why aren’t the VM HTTP proxy settings better documented? I remember digging up some docs a while ago that explain how to set the HTTP proxy for the VM using a static properties file strategically located in one of the $JAVA_HOME sub folders but I couldn’t find it today. I just want to be able to try examples that reach out to RSS channels or validate XMLs with remote XSDs without needing to lookup the “-D” key names and figure out how to hack them into my particular environment. Do you have a clue? Have I missed any recent innovations that make web-talking as simple as dialing Grandma over the holidays? Holla at’cha boy…

6 thoughts on “Not Having a Groovy Day

  1. In the past I had to deal with a microsoft based proxy to access the internet, and I had some issues with it. As far as I can remember, there were a few environmental properties that you can set (e.g. http.proxyPort, http.proxy, http.proxyUsername, etc or something like that) that take care of the proxy issues. I also remember having to install a custom JAAS based authenticator that would supply username and password to the proxy. Unfortunately, I don’t clearly recall which one approach solved my problem, but hopefully, these recollections might be helpful to you…

  2. Thanx Alex,

    For now I have a programmatic solution that involves setting the credentials on the URLConnection programmatically. The system properties for http.proxyUserName and http.proxyPassword don’t seem to work. I’d still like to find that documentation on setting the parameters for the VM externally in a properties file.

  3. Hi,

    Maybe this isn’t relevant after almost two years since this first posting, but it is possible to set the proxy by setting the variable JAVA_OPTS before staring groovy.

    e.g.:
    set JAVA_OPTS=-Dhttp.proxyHost=webproxy -Dhttp.proxyPort=8080
    groovyconsole.bat

    Alternatively, set the -D parameters in the VM settings in the runtimeconfig in Ideas or Eclipse.

    I don’t know the syntax for Linux, but it must be something alike.

    Regards,

    Christian Sonne Jensen

  4. Christian,
    I was trying to avoid the cmd line switches all together because they’re a pain to remember. There was a secret file you could stick somewhere under JAVA_HOME but I forget where.

  5. ‘Sup Greg! Every so often someone like yourself comments on one of my older posts causing me to re-read the post and re-rememberize old solutions to current problems. Keep me bookmarked, or registered in your reader or however you navigate here. I’m cooking up something awesome that I’ll eventually put up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s