I have a piece of code that get's the spring context using
context = new ClassPathXmlApplicationContext("application-context.xml");
The file is located inside the WAR's "WEB-INF/application-context.xml" In JBoss 4.2.3, the above code works fine. In JBoss 5.1, after experimenting, it seems to expect the file to be in "WEB-INF/classes/application-context.xml". And after shifting the file there it works.
I also googled around saw lots of references to how the VFS messes with Spring's classpath or something..
The WEB-INF
directory itself is not supposed to be on the classpath. If that was working on JBoss 4.x, then it must've been specifically configured to do so.
WEB-INF/classes
, on the other hand, is on the standard classpath. This is the correct place for the file to go.
JBoss 5.x doesn't mess around with Spring in the way that you're suggesting. It did, however, tighten up some loose behaviour present in JBoss 4.x, and this may be an example of this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With