Sharing jars (or modules) between web application contexts in Idea Follow
I want to run two webapp contexts /foo and /bar inside of idea (i use Selena build 7065). I allow the contexts to access each other's servletContext by specifying crossContext="true" in the /META-INF/context.xml of each context.
Now, to do anything useful with this setup I need to ensure that both class loaders see the same dependencies (.jars). In a standalone Tomcat configuration I believe the standard way of doing this is to drop them in CATALINA_HOME/shared/lib.
First, this "standard way" does not seem to work when running the apps inside of Idea. Can I fix this?
Better still, can I accomplish the same thing some other way (without dropping things into my tomcat installation).
Or even better, can I configure /foo and /bar to share a Java module in Idea in such a way that cross context access will work?
Thanks in advance,
Please sign in to leave a comment.
Generally a bad idea, and a good indication they should be the same webapp rather than two different ones.
Equally a bad idea. Anything placed there is accessible to the entire server with no way to override it at application level.
If you put a jar there and need a different version of a class in that jar in some web application your only recourse is to run it in a different Tomcat installation.
Combine the apps into one, or find some other way for them to communicate (like HTTP requests or RMI).
I'm bulding a portal. Portlets are deployed as separate contexts, just as they are in other portlet containers, such as the reference implementation Pluto.
If this is a bad idea, then I'm interested in any alternatives you can come up with.
However, I was actually looking for is advise on how to run such a setup inside Idea.