cancel
Showing results for 
Search instead for 
Did you mean: 

Get InstanceNumber at Runtime of J2EE-App in 2004s

Former Member
0 Kudos

I wrote a J2EE Application for 2004s and this application needs a at runtime the http-port/InstanceNumber. How can I get this on runtime?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

http://system.Domain.com:5<Instance number>00/ and then use administrative privileges to log on to system information. There you will see all system related details.

Thanks

Subu

Former Member
0 Kudos

Maybe me first post was not carefully worded. I don't want to see the system info, I want to determine them on runtime of my java.program.

Now, I have a "half" solution for it: With the instance-number I can calculate all standard(!)-ports. I saw this calculating-ports-stuff in a word-doc.

//HTTP-Port = 50000InstanceNumber*1000

String InstanceNumber = java.lang.System.getProperty("SAPSYSTEM");

int temp = 50000 + Integer.valueOf(InstanceNumber).intValue() * 100;

String port = String.valueOf(temp);

But my problem with this solution is: I don't know weather the standard ports can be changed manually. When yes: this solution can have a problem...

Former Member
0 Kudos

Hi Remo,

Am not sure what u mean by Standard port. In my understanding, Ports can be changed in SMICM transcation code.

The J2EE ports are created via the following formula. Port Number = 50000100*instance_numberport_index

Am very sure the following Threads will answer your question...

Dont forget to grant me points Remo!!

Thanks

Subu