Question

I receive the following error:

java.net.URISyntaxException: Illegal character in scheme name at index 0: "http://localhost:8080/MyService"

Is there really something wrong with my 'h' character? Or is there maybe some hidden character I'm not seeing?

I am loading that string in from a property file, so I even made sure I called trim() before using it to construct the URI.

This is the code where it is occuring. the value of uri is that of the string in the exception printout. Client is that of the jersey framework

    final Client CLIENT = Client.create();
    final WebResource webResource = CLIENT.resource(uri);
Was it helpful?

Solution

The problem is not the h, but that the first character in your string is a quotation mark (").

OTHER TIPS

I believe (if I recall properly) that that particular error message should not quote the URI, thus the URI must have been quoted to start with.....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top