How to get the websphere cellname from the Java code

reddy2388 used Ask the Experts™

we  have a typical application    which is irritating  where we have copy the properties files after installing the EAR

inside the ear  have to repeat the process for two environments  

we are planning to avoid this issue  

in the process i need to get the CELLNAME  using the JAVA CODE
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can use the "" class to get information about WAS management in your application running on WAS.
You will find the class in 1 of the jar files under the WAS lib directory; I don't remember the exact jar and it will differe from WAS version to version.
The code would be
AdminService adminService = AdminServiceFactory.getAdminService() ;
System.out.println(adminService.getCellName()); //Returns the name used to identify the current cell in which this process is configured. 


Thanks  anil for the info


it helped little  bit

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial