I'm using JBoss 5.1 AS on Mac 10.5.6 (Java 1.6). Is it possible to have a partially-exploded WAR deployment -- that is, have the WAR file, but then have the web.xml and/or jboss-web.xml live outside of it?
Dave Alvarado wrote:Is it possible to have a partially-exploded WAR deployment -- that is, have the WAR file, but then have the web.xml and/or jboss-web.xml live outside of it?
Thanks for your feedback, - Dave
No. As per the specification, the web.xml and the jboss-web.xml have their standard locations, which is within the WEB-INF of the .war.
What exactly are you trying? Maybe there's a different way of achieving that.
Joined: Jul 02, 2008
This relates to an older thread I had posted but the problem I'm trying to solve is I want to be able to use the same WAR file across dev/test/production environments but have different environment entries (<env-entry>) per each environment. Problem is, right now the only place I can see where to put these entries is the web.xml file, but then that would mean I would have a different WAR for each environment, which I want to avoid.
problem is, right now the only place I can see where to put these entries is the web.xml file, but then that would mean I would have a different WAR for each environment, which I want to avoid
With the approach suggested in that other thread, you will just have one web.xml for all environments, with something like this:
Then each environment would set the correct value as:
QA env (either through command line or within the run.bat/run.sh scripts):
Dev env (either through command line or within the run.bat/run.sh scripts):
Joined: Jul 02, 2008
That was a good suggestion but the team here does not want to alter the way we start our JBoss server and are also weary about other applications having access to those values. Do you know of a way that can be more file-based? I had come across something online called "GlobalNamingResources", which is supposed to be part of the server.xml JBoss configuration, but when I try and add it to mine I get XML validation errors. Sure wish this page -- http://www.jboss.org/file-access/default/members/jbossweb/freezone/docs/latest/config/globalresources.html -- would have had a bigger example.
I can see, how the explanation in that doc can be confusing. So here's what it's all about:
- The server has a "global" JNDI space which is accessible to applications within that server as well as outside that server (those are known as remote clients)
- Once any resource (/entry) is added to this "global" JNDI space, that resource becomes available to all the applications on that server.
- There also a "per-component"/"per-app" JNDI space on the server. Any resource (/entry) that needs to be added here, will have to be configured in the web.xml (or such similar metadata files).
- It's usually recommended that resources in the "global" JNDI space be accessed through a redirection from the "per-component"/"per-app" JNDI space. What this means is, if there's a resource at the global JNDI name "someglobaljndiname", then instead of looking it up using:
it's better to bind it to the per-app JNDI space (for ex: "somealias") and access it as follows:
The reason for doing this, isn't in the scope of this thread (however, we can discuss if you would want the details)
- The "per-app" namespace is not accessible outside the application. So "somealias" can't be accessed from outside the application, where it's configured. However, the "someglobaljndiname" will still be accessible from all other apps.
So the bottom line is - anything that goes in the global JNDI namespace, is available for all apps.
Joined: Jul 02, 2008
That was an outstanding explanation. Thanks. Although adding the entries would apply at a global level, I would like to do the proof of concept. However, when I add
as a child element of either the "<Server>" or '<Service name="jboss.web">' elements within my server.xml file, I get this error when I try and deploy my web application ...
Any ideas where I would add the "GlobalNamingResources" element? - Dave