Skip to Content
author's profile photo Former Member
Former Member

Proxy-Configuration for Java applications

Hi guys

I'm connecting to an url through a proxy within a servlet. For this purpose I entered the following coding

System.setProperty("http.proxyHost", "proxyserver.com");

System.setPropery("http.proxyPort", "8080");

This works fine so far. However I would like to specify these settings on a administrative level. Thus I entered the following configuration parameters in the configtool->instance->server:

-Dhttp.setProxy=true

-Dhttp.proxyHost=proxyserver.com

-Dhttp.proxyPort=8080

-Dhttp.nonProxyHosts="localhost|*.company.com"

However they don't work .. allthough they're properly written into the instance.properties file after restart.

The test System.getProperties("http.proxyHost") just returns null.

Do you have an idea why this doesn't work?

Cheers

Stephan

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2005 at 06:49 AM

    Hi Mirko,

    unfortunately, this servlet runs besides the portal on the WAS. Thus the proxy settings of the portal won't work for this app.

    You're right: I should have selected a different forum ... hope find a solution anyway.

    Thanks a lot and regards

    Stephan

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Stephan, hi Mirko,

      Even if your app is a servlet app beneath the portal, if the portal is running, the service gets started with the portal and sets the system parameters itself from it's configuration (if there are any). See sourcecode of com.sapportals.portal.ivs.proxy.ProxyServerService (you'll have to decompile).

      So, you can try to use this EP service as your central configuration point.

      Anyhow, this does not explain why the settings -D... are not retrievable (for the EP service does not override them if no proxy is set within EP config; this at least holds for EP6 SP2 P32). I just tested it within my environment - setting -Dhttp.proxyHost=my.proxy.com has been retrievable, no problem at all.

      Some additional remark: "http.setProxy=true" must read "http.proxySet=true".

      Hope it helps

      Detlev

      PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2005 at 06:10 AM

    Hi Stephan,

    as you are posting your question in an EP forum I guess your servlet is running as an iView. If this is the case you can configure a HTTP-Proxy in the EP. This is pretty well documented under:

    http://help.sap.com/saphelp_nw04/helpdata/en/33/8abf9e0ce011d7b84900047582c9f7/content.htm

    Best Regards

    Mirko

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.