Tuesday, July 12, 2011

Jboss EAP 5.1.0GA and Spring

We were having trouble incorporating our version of Spring with Jboass EAP 5.1.0GA. We kept getting this exception:

java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)

What is that??
It turns out that if you're using
or scanning for @Component-annotated beans
in your spring xml files or your bean classes, spring can't find what it's looking for because of the way Spring's PathMatchingResourcePatternResolver behaves with JBoss' VFS.

To get around this you have to add Snowdrop-vfs-1.0.1.GA and tell spring to use the 0org.jboss.spring.vfs.context.VFSXmlWebApplicationContext class instead of it's default class when loading the Web Application Context.

More details can be found here:

https://issues.jboss.org/browse/JBPAPP-5051 (The 5th comment down details the work around)
Link
This link describes the problem in detail for those that are curious: http://www.redhat.com/f/pdf/jbw/mbogoevici_1050_spring_on_jboss.pdf

I've also read that upgrading to Spring 3.0 fixes the issue but I haven't tried it myself.


Intro

This blog is where I'm going to be posting about the various things I've learned pertaining to my work as a computer programmer. I need a place to keep track of all the little hints and magical incantations I've learned. Who knows, posting it publicly might help others along the way too.