Search code examples
javaserverjbossweblogic

How to identify if an application is running on WebLogic or JBoss?


On the basis of which instance an application running (like WebLogic or JBoss), I have to fetch the IP, which is mapped with a different header. So how I can identify programmatically with Java if a webapp is running on WebLogic or JBoss?


Solution

  • You can try to get the jboss.server.name system property (so you know your app is running in a JBoss container) and the weblogic.Name one (for the WebLogic version).

    Ex.

    String weblogicServerName = System.getProperty("weblogic.Name");
    String jbossServerName = System.getProperty("jboss.server.name");
    

    The one set identify your container.