configuring Tomcat to use Proxy Server

Discussion in 'Java' started by Christine Mayer, Jul 6, 2007.

  1. To connect to web services, web pages and so on, I need to use a proxy
    server. To make my application work, I need to adjust Tomcat so that
    it uses my proxy server. I tried to adjust catalina.bat -
    There is a variable "JAVA_OPTS". I added my proxy server by adding:
    -Dhttp.proxyHost=www-my.proxy.server.com -Dhttp.proxyPort=8080

    However, it doesn't work. I also tried to echo the variable's conntent
    on the tomcat console,
    but this neither worked. Any ideas how to add a proxy server in
    tomcat? Maybe I am looking in the wrong direction??

    Thanks in advance,

    Christine
     
    Christine Mayer, Jul 6, 2007
    #1
    1. Advertising

  2. On Jul 6, 6:32 am, Christine Mayer <> wrote:
    > To connect to web services, web pages and so on, I need to use a proxy
    > server. To make my application work, I need to adjust Tomcat so that
    > it uses my proxy server. I tried to adjust catalina.bat -
    > There is a variable "JAVA_OPTS". I added my proxy server by adding:
    > -Dhttp.proxyHost=www-my.proxy.server.com -Dhttp.proxyPort=8080
    >
    > However, it doesn't work. I also tried to echo the variable's conntent
    > on the tomcat console,
    > but this neither worked. Any ideas how to add a proxy server in
    > tomcat? Maybe I am looking in the wrong direction??
    >
    > Thanks in advance,
    >
    > Christine


    It is not so much of adding proxy to tomcat, but setting up the jvm
    running tomcat to recognize the proxy settings. If you tried printing
    the values and nothing showed up, JAVA_OPTS did not get picked up. You
    might want to try using API instead of passing it as JAVA_OPTS (that
    should work too, but no harm trying alternate route). If you have a
    bootstrap class, have it read a properties file and set the system
    properties for proxy :

    System.setProperty("http.proxyHost",...);
    System.setProperty("http.proxyPort",...);

    -cheers,
    Manish
     
    Manish Pandit, Jul 6, 2007
    #2
    1. Advertising

  3. Well, I am completly new to the system,
    and I need to start at some point! ;-)
    Going deep into the Java files just to add the proxy will let me lose
    the scope imho.
    About the Java JVM, I don't understand it anyway, as in my system
    settings the java console is set to "use browser proxy configuration"
    - so imho it should actually use the proxy, or is that something
    else???

    About printing from the batch file, well, I doesn't print anything at
    all, even if I just say "echo helloooo" in the very first line. I am
    not in expert in batch files, though, and maybe this tomcat batch file
    does something that prevents my echo to appear in the tomcat console...
     
    Christine Mayer, Jul 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ones Self

    Configuring a Realm in Tomcat

    Ones Self, Aug 31, 2003, in forum: Java
    Replies:
    2
    Views:
    526
    Ones Self
    Sep 3, 2003
  2. Dean Rettig
    Replies:
    2
    Views:
    5,484
    X_AWemner_X
    Dec 29, 2003
  3. Stian Kaasa

    Apache + Tomcat + mod_jk configuring

    Stian Kaasa, Jan 18, 2004, in forum: Java
    Replies:
    1
    Views:
    2,425
    Sudsy
    Jan 18, 2004
  4. vidy5300
    Replies:
    0
    Views:
    885
    vidy5300
    Jun 7, 2004
  5. Rodolfo
    Replies:
    3
    Views:
    6,193
    Juha Laiho
    Jul 15, 2004
Loading...

Share This Page