Wednesday, December 9, 2009

JasperServer embedded in JBoss 5 with other Spring enabled applications simulataneously.

So, you've downloaded JasperServer (which is still stuck under Spring 1.1) and you've given them money and want to embed it as a war under JBoss so you don't have to manage 18 different services? Well, as long as you don't have any Spring 2.0 web applications, you're golden. Oh, you have Apache Mina or a custom web app that uses Hibernate with Spring? Yeah, you're screwed.

When Spring does its injection magic, it's after the JBoss class-loader has collapsed all the application paths that were separate on load. Now that Spring 2.0 implementing class's signature in a different app doesn't match some Spring 1.1 interface and it crashes. That sucks.

Well, what you'll need to do is create a dummy class with the same package and name and have it implement the 1.1 interface. Jar it up and include it in the JasperServer war. Now Spring resolves the class locally (as will your other application on the flip side).

This is king kludge but when you got to, it works.

Count out.