Forum Stats

  • 3,726,727 Users
  • 2,245,248 Discussions
  • 7,852,377 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

URLConnections,

User13468339-Oracle
User13468339-Oracle Member Posts: 90 Employee

Hello Expert, I am facing a strange issue which the below code when executed on windows it works fine but the same code when trying to run on linux it gives 504 bad gateway error. Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("X.X.X.X", 8080)); //Change the proxy address accordingly and try URL url =  new URL(null,"http://XXX/login.jsp",new sun.net.www.protocol.http.Handler()); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); Integer responseCode = connection.getResponseCode(); When i print the response code i get 504 on linux and on windows I get 200.         JDK version 1.6.35 oracle sun jdk and it is same for both windows and linux.         Any suggestion or inputs will help me to fix this issue. Also note that there is no firewal or proxy setting.. Thanks Chetan

eudriscabrera-JavaNet

Answers

  • karianna
    karianna Member Posts: 205 Blue Ribbon
    edited December 2016

    Hi there,

    This question should be moved to the appropriate Java --> Networking space.  Can a moderator please move?

    As an aside, I would not be using Java 1.6.0_35 it has many security vulnerabilities and is no longer supported.

    eudriscabrera-JavaNet
Sign In or Register to comment.