How can I determine the Java EE 6 application server type?

Our Java EE 6 Application is deployed to JBoss 7.1 or WebLogic 12c. Our application contains WebService and EJB. Can I know which one is being used?

Thank you.

Upvotes: 0

Views: 441

Answers (2)

Jboss application server java.naming.factory.initial not defined.

InitialContext ic = new InitialContext();
System.out.println((String)ic.getEnvironment().get("java.naming.factory.url.pkgs"));

Upvotes: 1

JoseK
JoseK

Reputation: 31371

If I understand your problem correctly, your client app as well as the EJB app are deployed on the same app server? So both are either Weblogic or both are JBoss?

If so, on the client app you can look up the environment property java.naming.factory.initial

InitialContext ic = new InitialContext();
System.out.println((String)ic.getEnvironment().get("java.naming.factory.initial"));

On weblogic this returns,

weblogic.jndi.WLInitialContextFactory

Upvotes: 0

Related Questions