How to access application.xml EAR file deployed in IBM WebSphere 6.1

I am deploying an EAR file on an IBM WebSpehre 6.1 server. I want to have access to the name of the EAR application, which is stored in the deployment file under the name "display-name". After reviewing stack overflow messages on related topics, I was able to understand that this is possible using the Java MBean API or the IBM WAS API. The problem is that I cannot find the place where these API lists summarize, i.e. Can not determine which one to start watching. I could hard install the WAS installation location and find the file by looking in the "installedApps" directory, but this is not dynamic.

Does anyone have any experience with these APIs? Any other way to dynamically find the expanded display name EAR?

EDIT - I must add that the reason I would like to get this information is to dynamically load our property files, which are called the following convention "EARAppName.properties" - so you see that there is a reasonable "rationale", the information in my annex

EDIT 2 - I should also note that this application will always be deployed to WAS, but in case it is not, a generic generic solution would be preferable, but at the moment it is not necessary.

EDIT 3 - What I want to do: Is there a way to dynamically find the expanded display name EAR from the application code?

+3
source share
4

. ApplicationName, META-INF/application.xml.

AppName Log4J File Appender , . , .

:

InputStream in = new MyObject().getClass().getResourceAsStream("META-INF/application.xml");

I also tried changing the classloader to "PARENT_LAST / FIRST" and "Single ClassLoader", but it does not work.

I could find application.xml in the file system regarding my war file, but I'm not sure if it will work all the time.

Is JMX Api the real only way?

+1
source

This is not for your application to know as such, but for EAR processing tools, including the application server.

0
source

Source: https://habr.com/ru/post/1728097/


All Articles