Search Results

Search found 127 results on 6 pages for 'httpurlconnection'.

Page 6/6 | < Previous Page | 2 3 4 5 6 

  • Opening port 80 with Java application on Ubuntu

    - by Featheast
    What I need to do is running a Java application which is a RESTful service server side writtern by Restlet. And this service will be called by another app running on Google App Engine. Because of the restriction of GAE, every http call is limited to port 80 and 443 (http and https) with HttpUrlConnection class. As a result, I have to deploy my server side application on port 80 or 443. However, because the app is running on Ubuntu, and those ports under 1024 cannot be accessed by non-root user, then a Access Denied exception will be thrown when I run my app. The solutions that have come into my mind includs: Changing the security policy of JRE, which is the files resides in /lib/security/java.policy, to grantjava.net.SocketPermission "*.80" "listen, connect, accept, resolve" permission?However, neither using command line to include this file or overrides the content in JRE's java.policy file, the same exception keeps coming out. try to login as a root user, however because my unfamiliarity with Unix, I don't know how to do it. another solution I haven't try is to map all calls to 80 to a higher port like 1234, then I can deploy my app on 1234 without problem, and GAE call send request to port 80. But how to connect the missing gap is still a problem. Currently I am using a "hacking" method, which is to package the application into a jar file, and sudo running the jar file with root privilege. It works now, but definitely not appropriate in the real deployment environment. So if anyone have any idea about the solution, thanks very much!

    Read the article

  • Java getInputStream 400 errors

    - by Bill Szerdy
    When I contact a web service using a Java HttpUrlConnection it just returns a 400 Bad Request (IOException). How do I get the XML information that the server is returning; it does not appear to be in the getErrorStream of the connection nor is it in any of the exception information. When I run the following PHP code against a web service: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.myclientaddress.com/here/" ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($ch, CURLOPT_POST,1 ); curl_setopt($ch, CURLOPT_POSTFIELDS,"username=ted&password=scheckler&type=consumer&id=123456789&zip=12345"); $result=curl_exec ($ch); echo $result; ?> it returns the following: <?xml version="1.0" encoding="utf-8"?> <response> <status>failure</status> <errors> <error name="RES_ZIP">Zip code is not valid.</error> <error name="ZIP">Invalid zip code for residence address.</error> </errors> </response> so I know the information exists

    Read the article

< Previous Page | 2 3 4 5 6