cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain J2EE instance port number from Java?

Former Member
0 Kudos

In my application, I need to be able to obtain the HTTP port number of the instance the application is currently running on (clustering is not an issue).

I poked through the system database tables "j2ee_config" and "j2ee_configentry" and found the values located under the name "cluster_data/dispatcher/IDXXXXXXXXX/services/http" (where XXXXXXXXXX is my instance number)

Unfortunately, im at a loss as to how I can look up this value from within my J2EE application.

Can anyone assist me? I assume theres some API for querying configuration data, but I havent been able to find it..

thanks very much

David Mitchell

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

David,

Probably the workaround I've found could be useful for you:

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

This last suggestion from Valery Silaev is exactly what I needed!

Thanks for all the quick replies.

yours,

David

Answers (2)

Answers (2)

former_member185864
Active Participant
0 Kudos

HI David Mitchell,

For finding the J2EE instance port number; Please follow below steps:

<u><b>Formula for finding J2EE Port number</b></u>

1. Portnumber = 50000 + 100 * Instance number + Port Index

Ex: Port number = 50000 + 100 * 02 ( Inst_num) + 00 (http index value is "00")

Port number is : 50000 + 200 + 00 = 50200.

<u>Just for your information:</u>

1. How to find <b>"Instance number"</b>

C:\usr\sap\<SID>\<engine-instance>\j2ee

Ex 1: D:\usr\sap\F02\JC00\j2ee --> instance number is "00"

Ex 2: D:\usr\sap\F02\JC01\j2ee --> instance number is "01"

Ex 3: D:\usr\sap\F02\JC02\j2ee --> instance number is "02"

.....................

.....................

Ex 4: D:\usr\sap\F02\JC99\j2ee --> instance number is "99"

2.How to find <u><b>Port Index:</b></u>

HTTP --> 00

HTTPS --> 01

TELNET --> 08

P4 --> 04

3. Docs

http://help.sap.com/saphelp_nw2004s/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/frameset.htm

Please Reward points; if it is usefull.

Thanks,

Nagaraju

Former Member
0 Kudos

you can check out in J2EE logs/trace file by transaction SMICM. it should provide you the http and https listening ports.

HttpSAPR3SetParam: switch j2ee http port from to: 51000

HttpSAPR3SetParam: switch j2ee https port from to: 51001

Let me know if it helps