75inchpianist
75inchpianist

Reputation: 4102

can't figure out URIException

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);

Upvotes: 1

Views: 1932

Answers (2)

rolfl
rolfl

Reputation: 17707

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.....

Upvotes: 4

jarnbjo
jarnbjo

Reputation: 34313

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

Upvotes: 6

Related Questions