Skip to: Site menu | Main content

Confused Narcissus

Ok, so a while ago I set up a Google Alert to inform me of happenings related to myself, and periodically it tells me someone on the web called “Dan Walmsley” (typically an Irish F1 Engineer, but occasionally me) has been written about.

Today, however, the results were far more disturbing.

Dan twinned the Steward way in back circuitously 2002 for example a musician in re the non-philharmonic restlessness. “Ace did exclamation in order to the administration ‘oh, ourselves sense, Themselves do up have it gently too’,” me recalled as to his untimely days. “Nonetheless top brass didn’t factually accredit oneself.”

First of all, I think I’ve been misquoted.

Second of all, who does this article benefit?

Thirdly, the post categories are: “african american, audism, feel good tips, republicans, yasin”. Why?

Fourthly, it’s clearly a translation of this article. But a translation into what? Half-English gibberish?

Welcome, ladies and gentlemen, to hard evidence that synonym-generation does not lead to 100% readability during summary generation. This reminds me of my lost year at NICTA.

Wicket, Tomcat, Debian: Sometimes a little security goes way too far

Was up until 3am last night banging my head against another frustrating go-nowhere issue deploying Wicket on Debian Etch’s default Tomcat5.5.

Apparently the latest version (5.5.20-2etch1) has additional security headaches features which prevent wicket from functioning properly out-of-the-box:

  • First of all, there’s still an (as-yet-unsolved) mystery around why I couldn’t get Wicket to start up as a filter. Just the mysterious “ERROR: filterStart” which makes me want to feed Tomcat to angry lions. Worked around it by using Wicket in Servlet mode instead.
  • Tomcat’s juli.jar can’t access WEB-INF/classes/logging.properties. Fixed (in sledgehammer-like way) by adding “permission java.security.AllPermission;” to /etc/tomcat5.5/policy.d/03catalina.policy, in the Juli section.
  • Tomcat security prevents webapps from accessing all sorts of features and methods by default, including wicket.properties, methods inside shipped jars, etc. Not being a Tomcat expert, and trusting the innate security of the server and millions of lines of third party code (i.e. I’m an idiot) I again just popped a java.security.AllPermission; in appropriate spots in /etc/tomcat5.5/policy.d/04webapps.policy. Let the flames commence!

If Tomcat was a little more helpful in its error messages, this would never have been so painful. Jetty has always run my Wicket apps without complaint (though I’ve never tried the official Debian Jetty packages - maybe they’re crippleware secure too?).

The only reason I use Tomcat at all is the remote management and deployment features, which are well-supported by Cargo. Now that these issues are out of the way (mostly) I can take another few steps towards my dream of a seamless, fire-and-forget, auto-deploying, smoke-tested, pluggable and modular web app deployment system.

Oh, and have I mentioned recently how much I LOVE IInitializer?

Bless you, Wicket. Bless you.

Live in constant, irrational fear

Some cartoons are just too cute not to pass on.

Geek humour, take thy place alongside dirty limericks and sea shanties as a subcultural envelope for broad social commentary.

End the Wicket PermGen issue

Update: This doesn’t seem to have completely fixed the problem, although perhaps I’m reloading the context to often for the garbage collector to keep up. I’ll keep you posted. Anyhoo, if you read this and try it out, please let me know if it works for you.


Anyone who develops Wicket applications and doesn’t have a bajillion gigabytes of RAM (and java command line options to match) eventually runs into the “Out of PermGen Space” issue. This happens because, by default, the JVM doesn’t reclaim this kind of memory.

For those of us who value the ability to hot-redeploy a context without bringing down our entire container (Geronimo, anyone?), the following JVM command-line options are invaluable:

-XX:MaxPermSize=256m \
-XX:+UseConcMarkSweepGC \
-XX:+CMSPermGenSweepingEnabled \
-XX:+CMSClassUnloadingEnabled

Note that not all of them are necessary, but if you want to reclaim PermGen space you must have the last two at least.

I hope this helps someone else out there, this was caving my head in for a while before I realised the fix was so simple.

On another note, I have now read this Coderspiel article and am a convert to the world of individual Jetty containers running on their own VM. Memory’s cheap, right?

And, for my own 2c, Java frameworks are now so abstracted and separable that it’s possible to achieve 90% of what a full J2EE stack gives you just by cherry-picking a few bits and pieces (say, Hibernate + Wicket + Jetty). That gives you a much leaner, meaner stack and you can tune the Heck out of it.

Add Maven2 to the picture and you’re in pluggable, extensible, fire-and-forget heaven.

Portable Film Academy

Last weekend I was lucky enough to be part of the inaugural Portable Film Academy. Thanks to Andrew Apostola and all the crew, helpers, speakers and other attendees it was a great weekend and I really learned a lot.

The core task for the weekend was to create an original online series, and below you can watch Episode 1 of our series called “Forever”. This was produced by myself, Johnny Blank and Sebastian Goldspink.

Also a huge thanks to our star Oliver Clark, who was just brilliant as Karl. He nailed every scene in one or two takes, which was great because we were under a lot of time pressure.

Training Junk Mail filter using Apple Mail and GMail IMAP Connector

Like most people, I get literally thousands of spam messages a month. I never see them, of course, because they’re filtered out by Gmail’s incredible spam filtering system.

This is all well and good if you’ve got a Gmail account, but what if you want Google-quality filtering for your business or other mail accounts?

Well, thanks to Gmail IMAP support, we now have a massive and incredibly accurate data set for training Apple Mail’s junk filter. Gmail IMAP lets you browse folders other than your inbox. So once you’ve added it to your Apple Mail account list, simply browse to the Spam folder, select all, then mark those messages As Junk.

This simple act will train Mail’s bayesian spam filtering system on everything in your GMail spam folder, no doubt instantly improving its performance somewhat. In my case, the spam folder usually has 3000-4000 messages in it, which is fairly hefty and it would certainly take a lot of clicking to get that kind of data by hand.

Thanks Google!

Jackrabbit, Wicket, Tomcat, Maven2… hell.

What follows is lessons learned migrating to the potentially magnificent Maven2 for dependency management.

Put <scope>provided</scope> on Tomcat shared resources in your pom.xml

If you deploy jars as a shared resource on Tomcat (i.e. put the jars in common/lib) then be sure to add the <scope>provided</scope> to those dependencies in your project’s pom.xml. Otherwise, you’ll get absolutely daft class-cast errors on shared resources like:


2007-10-21 12:42:19,425 ERROR 0-SNAPSHOT] - Servlet /myExample2-1.0-SNAPSHOT threw load() exception
java.lang.ClassCastException: org.apache.jackrabbit.core.jndi.BindableRepository cannot be cast to org.apache.jackrabbit.core.jndi.BindableRepository

Hahahahahahaha I think I want to kill myself. The problem is that Tomcat’s shared libraries are loaded by a different classloader than your web-app’s shared libraries (which is nice in a way, because it means you can use different versions of log4j or whatever).

So the lesson here is: Anything you want created by Tomcat and loaded by name (e.g. “jcr/repository”), be sure to exclude from your WEB-INF/lib when you deploy.

You can load the same shared resource by name for all apps

Deploying a Maven2-enabled app using Codehaus Mojo is a breeze… unless you want to deploy a context with it. And a context is the only way to load up named shared resources like a Jackrabbit repository. The solution?

$TOMCAT_HOME/conf/Catalina/$HOSTNAME/context.xml.shared

The contents are loaded for all contexts. Brilliant.

Class blahblah violates loader constraints

Oh no. This was awful. For me it was:


2007-10-21 13:16:26,331 ERROR 0-SNAPSHOT] - Exception starting filter DataServlet
java.lang.LinkageError: Class org/slf4j/ILoggerFactory violates loader constraints

I needed to scour the dependencies that Maven was loading into my webapp automatically and explicitly label them as provided.

Planet Nerd videos now on Veoh.com

Planet Nerd is a variety show for and about nerds of all stripes. Whether you’re a died-in-the-wool Trekkie or you just went “heh!” at an episode of Buffy once, this show is for you. Featuring music, sketch comedy, documentaries, and uncategorisable flights of fancy.

It was created by me, along with a rag-tag bunch of miscreants, mostly Paul Verhoeven, Simon Barber and Ben McKenzie.

Go to the web site to download full episodes in near-DVD-quality - free! Or you can play selected episodes and segments using the players below.

Episodes


Online Videos by Veoh.com

Selected Highlights


Online Videos by Veoh.com

Virtualising Magnolia CMS

In a sharp left-turn for the danwalmsley.com ouvre, what follows is instructions for virtualising Magnolia CMS. Magnolia is an open-source Content Management system available in both community and enterprise versions, and is elegant and easy-to-use.

If you want to deploy Magnolia for multiple clients across multiple virtual domains hosted through a single instance of Apache HTTPD and a single instance of Apache Tomcat, read on.

Virtualising Magnolia

Virtualises magnolia for an apache virtual host under / for root and /admin for admin stuff

What you get:

  • myclient.com: magnolia public content (i.e. everything normally under /magnoliaPublic)
  • myclient.com/admin: magnolia authoring interface (i.e. everything normally under /magnoliaAuthor)

Variables:
$CLIENT = client name, e.g. myclient
$CLIENT_HOSTNAME = client host name to be proxied, e.g. myclient.com
$CLIENT_PORT = selected port on which Tomcat should host the site, e.g. 8082.
$TOMCAT_HOME = installation directory of TOMCAT

Tomcat Config

mkdir $TOMCAT_HOME/webapps_$CLIENT

unzip magnoliaPublic.war to webapps_$CLIENT/ROOT
unzip magnoliaAuthor.war to webapps_$CLIENT/admin

cd $TOMCAT_HOME/conf/Catalina

mkdir $CLIENT_HOSTNAME
(e.g. mkdir myclient.com)

edit $TOMCAT_HOME/conf/server.xml to include the following elements:



      
        
        

      
]]>-->

Configure Apache

Enable mod_proxy

Create a config, $CLIENT.conf:


    ServerName $CLIENT_HOSTNAME

    ProxyRequests Off
    
        Order deny,allow
        Allow from all
    

    ProxyPass / http://localhost:$CLIENT_PORT/
    ProxyPassReverse / http://localhost:$CLIENT_PORT/

    
        Order allow,deny
        Allow from all
    

]]>

Planet Nerd is about to blow this sh*t sky-high

Hey all,

My infrequent posting has been due to a time-consuming new project. Yea, indeed it is the Sarlacc of projects.

I speak of none other than Planet Nerd.

For those who haven’t yet come up to speed:

I hope you all take the time to pop over to our site and check out the show, and please feel free give us some feedback using the form on the front page.

Thanks,
Dan