Announcement Announcement Module
No announcement yet.
Web service consumer ignores http.proxyHost and http.proxyPort in webapp Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web service consumer ignores http.proxyHost and http.proxyPort in webapp

    I have a web application which monitors a message queue on RabbitMQ using Spring AMQP. When the queue being monitored gets a message, the web application will take the value in the message and use it to perform a web service call (through Spring Integration's abstraction). In development, I had Tomcat running on my laptop and things worked fine. The queue was read and the web service was consumed and the data downloaded. In production, the Tomcat server exists on a linux server behind a proxy server. Reading from the queue works fine, but consuming the web service times out. I have http.proxyHost and http.proxyPort set in the environment variable $JAVA_OPTS, but it seems to be ignored. So I modified the Tomcat startup script so that it would add -Dhttp.proxyHost and -Dhttp.proxyPort when Tomcat starts. Still, consuming the web service times out. I'm really not sure what else to try. I don't want to configure the HttpClient in my application config because I'd have to change it any time I deploy to a server which uses a different proxy.

    Your help is appreciated, Thanks

  • #2
    I found my problem. Problem was with the proxy server IP address.


    • #3
      Hi pgrimard,
      We have same problem,we developed Spring MVC application which consumes alfresco webservices sdk,It works locally fine but our production environment is in linux,it gives the connection timeout exception,But in the server logs it shows success message as 200,we have developed this app in STS ide 2.8.1,with java system library 1.7,So could you please explain briefly ,how you solved your problem..
      Thanks in advance


      • #4
        Well like my reply said, the first thing I determined was that the IP address I was using as my proxy host was incorrect. Once I corrected it at the server level, my application running in Tomcat still couldn't get through. What I ended up doing was modifying the Tomcat script which gets used when Tomcat is started as a service. It's located in the Tomcat bin directory.

        The highlighted text is what I added to the existing script.

        if [ "$1" = "start" ]; then
            -Dhttp.proxyHost= \
            -Dhttp.proxyPort=8080 \
            -classpath "$CLASSPATH" \
            -Dcatalina.base="$CATALINA_BASE" \
            -Dcatalina.home="$CATALINA_HOME" \
            -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
            -Djava.util.logging.config.file="${CATALINA_BASE}/conf/" \
            -Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" \
            org.apache.catalina.startup.Bootstrap start \
            >> ${CATALINA_BASE}/logs/catalina.out 2>&1 &
            if [ ! -z "$CATALINA_PID" ]; then
              echo $! > $CATALINA_PID
        I had first attempted to add the proxy settings to the $JAVA_OPTS environment variable since it's used at the beginning of the start command, but for some reason it didn't work. Placing the proxy settings directly in the script is the only way I've managed to get it working.


        • #5
          Thank you So much for brief explanation