configuring Tomcat to use Proxy Server

  • Thread starter Christine Mayer
  • Start date
C

Christine Mayer

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
 
M

Manish Pandit

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
 
C

Christine Mayer

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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top