[seam-dev] Multiple WAR in EAR

Stuart Douglas stuart at baileyroberts.com.au
Thu Apr 23 19:27:04 EDT 2009


I have done some investigating into multiple war support in seam. When
running a seam app with multiple wars you and up with two seam apps
running side by side, with different application contexts and
components. The Lifecycle and ServletLifecycle classes both maintain a
static reference to the servlet context (abstracted as a map in
LifeCycle). This means that only one of the seam apps will have their
application context stored in these classes. This seam app will work
fine. The seam app that is not referenced has the following problems:

- Cannot load resource bundles due to use of the wrong ServletContext in
ServletLifecycle (or wrong bundles loaded).

- Timers and async methods started in the second app will be run in the
app context of the first

- The wrong identity component will be created by the IdentityFilter.

- The resource servlet for the second app is run the app context of the
first, and will not work

- Wicket integration for the second app will not work

- Spring integration will not work in the second app

- jbpm integration in the second app is broken.

Some of these are easier to fix than others. The servlet and filter
problems are easy to fix as they have direct access to the
ServletContext and can simply pass it through to Lifecycle (abstracted
as a map of course)

The timer and async method issues are a bit harder. They will need to
store a reference to the application scope that they are meant to be run
in, same with the jbpm integration.

I do not know if it will be possible to get full spring support in multi
war apps, but I don't really know enough about spring to be able to say
one way or another.

As far as I can tell these are the only major problems with multi war
apps, if these are resolved it should work fine.

Stuart



More information about the seam-dev mailing list