1

I'm using URL Fetch Java API http://code.google.com/appengine/docs/java/urlfetch/overview.html#Fet... to get information from graph.facebook.com, however, i keep getting the error: java.lang.IllegalArgumentException at java.net.URI.create(URI.java:842) ... Caused by: java.net.URISyntaxException: Illegal character in query at index 58: https://graph.facebook.com/me?access_token=... Any idea?

1 Answer 1

1

The error message pretty much says it all: the URI you are attempting to fetch contains an illegal character at index 58. I also get the exception with your URL:

public static void main(String[] args) throws Exception {

    String s = "https://graph.facebook.com/me?access_token=593172238640599|e2a5e8bb8625b56358fe6219.1-530295086|zt7TYKmSF4e3WLWbF8jc7_P8MK8";

    URI uri = new URI(s);

}

throws:

Exception in thread "main" java.net.URISyntaxException: Illegal character in query at index 58: https://graph.facebook.com/me?access_token=593172238640599|e2a5e8bb8625b56358fe6219.1-530295086|zt7TYKmSF4e3WLWbF8jc7_P8MK8 at java.net.URI$Parser.fail(URI.java:2809) at java.net.URI$Parser.checkChars(URI.java:2982) at java.net.URI$Parser.parseHierarchical(URI.java:3072) at java.net.URI$Parser.parse(URI.java:3014) at java.net.URI.(URI.java:578)

The character at position 58 is the "|" character. You need to URL encode this character (and its other occurances).

Sign up to request clarification or add additional context in comments.

6 Comments

The issue is that it works fine on a stand alone application, but it is not working on Google Appengine for java.
Could it be the length? Is there limitation on the length of the URL you can fitch using google appneing for java.
@user458336 - can you paste the URL?
It is working in a standard web application, and in a java application, this error appears just when deploying it the Google AppEngin4java, development environment. That's why I don't think it is related to the content of the url!
It's throwing a URISyntaxException. There's a problem with the URL, even if it works on your system (are the versions of java the same on GAE??). Paste your url.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.