1

Hi all I am using Weblogic11, EJB3.0

I am working in Cluster. I would like to retrieve inside the Java code the current server Name(instance/id). since I want to do some operation on one server one and a different operation on another

thanks,

ray.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
rayman
  • 20,786
  • 45
  • 148
  • 246

1 Answers1

1

If you look at the command line parameters you will see -Dweblogic.Name=[ServerName]. You can get this from the Java environment parameters. Here's how you can access it:

System.getProperty("weblogic.Name")
Jeff West
  • 1,563
  • 9
  • 11
  • Do you also know a Property which I could use in order to retrieve the server IP? – rayman Aug 09 '11 at 08:35
  • That's a bit more complex. There is a listen address that the managed server listens to that may be empty, which means it listens to all addresses. If the setting has a value then it will listen to the IP address that is set. So, you would have to check the property and then you could use java.net to see what the IP address of the machine is, I suppose... – Jeff West Aug 09 '11 at 14:49