You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marco Crivellaro <ma...@gmail.com> on 2015/07/10 16:03:59 UTC

java.net.URISyntaxException using recipientList

Hi,
I am trying to upgrade to Camel 2.15 from camel 2.8.6 and I am finding a
problem when trying to serve endpoints which URIs contains the character {
as a java.net.URISyntaxException is thrown.

As an example a destination FTP endpoint contains the character '{' in the
password; ie: '12{34' 

when using the endpoint as a direct destination 'to' the following URI works
fine:
<to uri="ftp://bracket@hostname?password=RAW(12{34)" />

If I use the same uri in a recipientList a java.net.URISyntaxException is
thrown:

<setHeader headerName="recipients">
  <constant>ftp://bracket@hostname?password=RAW(12{34)</constant>
</setHeader>
<recipientList delimiter=",">
  <header>recipients</header>
</recipientList>


java.net.URISyntaxException: Illegal character in query at index 38:
ftp://bracket@hostname?password=RAW(12{34)
	at java.net.URI$Parser.fail(URI.java:2829)
	at java.net.URI$Parser.checkChars(URI.java:3002)
	at java.net.URI$Parser.parseHierarchical(URI.java:3092)
	at java.net.URI$Parser.parse(URI.java:3034)
	at java.net.URI.<init>(URI.java:595)
	at
org.apache.camel.util.EndpointHelper.resolveExchangePatternFromUrl(EndpointHelper.java:501)
	at
org.apache.camel.processor.RecipientListProcessor.resolveExchangePattern(RecipientListProcessor.java:263)



I've also tried to URLEncode the character { as %7B but this is not making
any difference.

Is it a bug in the recipientlist URL processing or am I doing something
wrong?


Thanks,
Marco




--
View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: java.net.URISyntaxException using recipientList

Posted by Marco Crivellaro <ma...@gmail.com>.
Thanks for the feedback, much appreciated.



--
View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103p5769126.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: java.net.URISyntaxException using recipientList

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I am currently testing all of Camel with the fix and a bunch of recent
fix before pushing.

On Fri, Jul 10, 2015 at 4:50 PM, Marco Crivellaro <ma...@gmail.com> wrote:
> Fastest fix ever!
> I don't see it yet in master or 2.15.x branch, was just wondering where the
> problem was.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103p5769115.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: java.net.URISyntaxException using recipientList

Posted by Marco Crivellaro <ma...@gmail.com>.
Fastest fix ever!
I don't see it yet in master or 2.15.x branch, was just wondering where the
problem was.



--
View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103p5769115.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: java.net.URISyntaxException using recipientList

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I found and fixed the bug
https://issues.apache.org/jira/browse/CAMEL-8951

On Fri, Jul 10, 2015 at 4:18 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Ah yeah thats a little bug in the recipient list. You are welcome to log a JIRA
>
> On Fri, Jul 10, 2015 at 4:03 PM, Marco Crivellaro <ma...@gmail.com> wrote:
>> Hi,
>> I am trying to upgrade to Camel 2.15 from camel 2.8.6 and I am finding a
>> problem when trying to serve endpoints which URIs contains the character {
>> as a java.net.URISyntaxException is thrown.
>>
>> As an example a destination FTP endpoint contains the character '{' in the
>> password; ie: '12{34'
>>
>> when using the endpoint as a direct destination 'to' the following URI works
>> fine:
>> <to uri="ftp://bracket@hostname?password=RAW(12{34)" />
>>
>> If I use the same uri in a recipientList a java.net.URISyntaxException is
>> thrown:
>>
>> <setHeader headerName="recipients">
>>   <constant>ftp://bracket@hostname?password=RAW(12{34)</constant>
>> </setHeader>
>> <recipientList delimiter=",">
>>   <header>recipients</header>
>> </recipientList>
>>
>>
>> java.net.URISyntaxException: Illegal character in query at index 38:
>> ftp://bracket@hostname?password=RAW(12{34)
>>         at java.net.URI$Parser.fail(URI.java:2829)
>>         at java.net.URI$Parser.checkChars(URI.java:3002)
>>         at java.net.URI$Parser.parseHierarchical(URI.java:3092)
>>         at java.net.URI$Parser.parse(URI.java:3034)
>>         at java.net.URI.<init>(URI.java:595)
>>         at
>> org.apache.camel.util.EndpointHelper.resolveExchangePatternFromUrl(EndpointHelper.java:501)
>>         at
>> org.apache.camel.processor.RecipientListProcessor.resolveExchangePattern(RecipientListProcessor.java:263)
>>
>>
>>
>> I've also tried to URLEncode the character { as %7B but this is not making
>> any difference.
>>
>> Is it a bug in the recipientlist URL processing or am I doing something
>> wrong?
>>
>>
>> Thanks,
>> Marco
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: java.net.URISyntaxException using recipientList

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah yeah thats a little bug in the recipient list. You are welcome to log a JIRA

On Fri, Jul 10, 2015 at 4:03 PM, Marco Crivellaro <ma...@gmail.com> wrote:
> Hi,
> I am trying to upgrade to Camel 2.15 from camel 2.8.6 and I am finding a
> problem when trying to serve endpoints which URIs contains the character {
> as a java.net.URISyntaxException is thrown.
>
> As an example a destination FTP endpoint contains the character '{' in the
> password; ie: '12{34'
>
> when using the endpoint as a direct destination 'to' the following URI works
> fine:
> <to uri="ftp://bracket@hostname?password=RAW(12{34)" />
>
> If I use the same uri in a recipientList a java.net.URISyntaxException is
> thrown:
>
> <setHeader headerName="recipients">
>   <constant>ftp://bracket@hostname?password=RAW(12{34)</constant>
> </setHeader>
> <recipientList delimiter=",">
>   <header>recipients</header>
> </recipientList>
>
>
> java.net.URISyntaxException: Illegal character in query at index 38:
> ftp://bracket@hostname?password=RAW(12{34)
>         at java.net.URI$Parser.fail(URI.java:2829)
>         at java.net.URI$Parser.checkChars(URI.java:3002)
>         at java.net.URI$Parser.parseHierarchical(URI.java:3092)
>         at java.net.URI$Parser.parse(URI.java:3034)
>         at java.net.URI.<init>(URI.java:595)
>         at
> org.apache.camel.util.EndpointHelper.resolveExchangePatternFromUrl(EndpointHelper.java:501)
>         at
> org.apache.camel.processor.RecipientListProcessor.resolveExchangePattern(RecipientListProcessor.java:263)
>
>
>
> I've also tried to URLEncode the character { as %7B but this is not making
> any difference.
>
> Is it a bug in the recipientlist URL processing or am I doing something
> wrong?
>
>
> Thanks,
> Marco
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/java-net-URISyntaxException-using-recipientList-tp5769103.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/