We help IT Professionals succeed at work.

how to get websphere port number

aaaaaa
aaaaaa asked
on
3,082 Views
Last Modified: 2013-12-10
i am using websphere application server 5.1.2
i set my 2 application port as 9080, and 9081

in my java code, how can i get the current running application port?
Comment
Watch Question

HonorGodSoftware Engineer
CERTIFIED EXPERT

Commented:
Please provide more information.

You want a Java Application that is running on a WebSphere JVM to determine
the port number that was used to access the resource.  Is this correct?

Author

Commented:
i got a java application, this is to get the port number of websphere application.
but how to get?
HonorGodSoftware Engineer
CERTIFIED EXPERT

Commented:
I'm sorry, I must not have been clear enough with my question.

Are you asking:

How should a Java application running on a WebSphere Application Server determine the port number being used?

HonorGodSoftware Engineer
CERTIFIED EXPERT

Commented:
If this is the case, you need to look into the available on-line documentation that talks about developing Administrative programs in Java.

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welcadminprogram.html

You probably will want to investigate the section entitled:
Create a custom Java admininstrative client program using the Java administrative APIs
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//topic/com.ibm.websphere.base.doc/info/aes/ae/tjmx_customjava.html

Is this what you want/need?

Author

Commented:
firstly
when a WebSphere Application Server run,
we can access it by
http://127.0.0.1:9080/myweb or
http://127.0.0.1:9081/myweb  right?

so now my question, my servlet or any java class, how do i know which one above is running?
Software Engineer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.