4.5. Spring in Application Archives

Packaging Spring in application archives is a more common approach than installing Spring as a shared library in the application server. In this method, the Spring files are required to be at the following locations inside the application archives:
In WAR
In the WEB-INF/lib directory.
In EAR
In the /lib folder of the archive, or another folder specified in the META-INF/application.xml descriptor.
In EARs that contain WARs, package Spring either in the shared library directory of the EAR, or in the WEB-INF/lib directory of individual WARs that use Spring. Unless the WARs use different versions of Spring (not a common case), Red Hat recommends you to package Spring as a shared library of the EARs.
In RAR
In the root directory of the archive.

Warning

The SpringContextResourceAdaptor present in Spring 3.0.7.RELEASE and Spring 2.5.6.SEC03 violates section 5.3.1 of the JCA 1.5 specification. As a consequence, RARs containing packaged Spring files from these versions cause deployment errors on Red Hat JBoss Enterprise Application Platform.
To work around this issue, disable archive validation in the JCA subsystem by adding the following code to the server configuration:

<subsystem xmlns="urn:jboss:domain:jca:1.1">
	<archive-validation enabled="false" />
</subsystem>