Home > FAQs > Multiple Struts 2 wars in a single ear |

Apache Struts 2 Documentation
Multiple Struts 2 wars in a single ear
Edit Page Browse Space Add Page Add News

Deploying multiple Struts 2 wars in a single ear may not work, due to each Struts 2 instance seeing configuration from the other war. Struts 2 doesn't allow multiple configuration files for the same package, or more specifically in this case, multiple struts-default.xml files. If possible, configure your application server to better isolate wars using a child first strategy for classloading.

Wander Grevink reported the following (on GlassFish 2.1):

    EAR
        WAR-1
            META-INF
                MANIFEST.MF

        lib
            struts*.jar
            struts*.xml

        META-INF
            application.xml

        WAR-2
            META-INF
                MANIFEST.MF

Where both MANIFEST.MF files contain the following entry:

MANIFEST.MF

    Class-Path: lib

And application.xml contains this entry:

    <library-directory>/lib</library-directory>

All struts related files go into the shared lib directory.