aspose file tools*
The moose likes Java in General and the fly likes Reading application.xml from ear in a java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reading application.xml from ear in a java class" Watch "Reading application.xml from ear in a java class" New topic
Author

Reading application.xml from ear in a java class

seenu akula
Greenhorn

Joined: Nov 23, 2009
Posts: 12
Hi,

There are six different ears in my application. there is one java file, which do some logic. this java file is common in all the ears. how can I read application.xml to identify which ear I am presently in? As if i know the display name of the application then that class can execute logic specific to that particular ear.
Infact is there any other way from where class can find out the ear to which it belongs??


K Abhijit
Ranch Hand

Joined: Mar 03, 2008
Posts: 88
how can you have 6 ears in one application ? you can't have ear inside ear ....
http://www.bea-weblogic.com/can-i-have-an-ear-file-packaged-inside-another-ear-file.html

Assuming you are talking about thr 6 six different ear...

well i know this is a workaround but you can use some property file...



“The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.”
seenu akula
Greenhorn

Joined: Nov 23, 2009
Posts: 12
Hi,

Thanks for your response.
These six ears are deployed in 6 jvms where a java class will have logic to perform based on context in application.xml
So, I want to get the context by reading the application.xml
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Reading application.xml from ear in a java class