• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Possible to deploy a partially-expldoed WAR file?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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?

Thanks for your feedback, - Dave
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi....

I am a stranger to SCJP.
Tell me some ideas to complete the certification succesfully.
Thank you....
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

m lk wrote:Hi....

I am a stranger to SCJP.
Tell me some ideas to complete the certification succesfully.
Thank you....


"m lk",

Please do not hijack threads. The right place for your question is here https://coderanch.com/forums/f-24/Programmer-Certification-SCJP. So please create a new thread in that forum. Also, please click on the "My Private Messages" link on top of this page, for a message from JavaRanch.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

- Dave
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean this one? https://coderanch.com/t/472412/JBoss/Strategy-configuring-app-differently-based

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):
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

- Dave
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Alvarado wrote: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 haven't looked at those configs, but it clearly states that:

These resources are listed in the server's global JNDI resource context.



Which means that other applications can access those values too. Isn't that what you are trying to avoid?
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are correct that I would like to avoid that ideally, but so I'm clear, when they say,

"server's global JNDI resource context"

is that referring to the server.xml file or the "GlobalNamingResources" element? Also, they go on to say that

The resources defined in this element are not visible in the per-web-application contexts unless you explicitly link them with <ResourceLink> elements

So doesn't that mean I can determine which applications have access to the environment variables and which do not?

Thanks for all your help, - Dave
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic