You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Mat Mannion <M....@warwick.ac.uk> on 2010/08/03 16:57:01 UTC

NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Hi all,

The BBC news gadget
(http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml)
includes some rather strange image URLs for stats tracking that have
quotes and tildes in the query string, which causes Uri.parse to throw
a UriException:

org.apache.shindig.common.uri.Uri$UriException:
java.lang.IllegalArgumentException: java.net.URISyntaxException:
Illegal character in query at index 107:
http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~"http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~

Currently in ProxyingVisitor:105 we add null to the list of URIs when
we receive an exception, but this is always a bad idea, because it
will ALWAYS throw a NullPointerException immediately after when we
iterate through the list in DefaultProxyUriManager:92

I'm not familiar enough with this part of the code to see where the
wrong behaviour is, but could somebody please have a look at it?

Thanks,

Mat

-- 
Mat Mannion
Web Developer
IT Services
University of Warwick
Coventry
CV4 7AL

Tel: 024 765 74433
Email: M.Mannion@warwick.ac.uk

Re: NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Posted by Gagandeep singh <ga...@gmail.com>.
>From my chat with Mat, he means that patching in
http://codereview.appspot.com/1869052/show fixes the problem.

Thanks
Gagan

On Wed, Aug 4, 2010 at 2:08 PM, Mat Mannion <M....@warwick.ac.uk> wrote:

> Thanks; can confirm my problem is now resolved.
>
> Mat
>
> On 3 August 2010 22:01, Gagandeep singh <ga...@gmail.com> wrote:
> > Reviewers: dev-remailer@shindig.apache.org
> >
> > Message:
> > Please review.
> >
> > As reported by Mat, currently ProxyingVisitor adds null to reservedUri
> list
> > for uri's that are not
> > parsed. It looks like its done in order to keep reserverUri list and node
> > list
> > in sync.
> > However, this causes a NullPointerException at DefaultProxyUriManager:92.
> >
> > This change ignores the uri's (and corresponding nodes) which fail to
> parse.
> >
> > http://codereview.appspot.com/1869052/show
> >
> >
> > On Tue, Aug 3, 2010 at 10:50 PM, Gagandeep singh <gagan.goku@gmail.com
> >wrote:
> >
> >> Probably something along these lines would be better:
> >> http://codereview.appspot.com/1869052/show ?
> >> <http://codereview.appspot.com/1869052/show>
> >>
> >> On Tue, Aug 3, 2010 at 9:04 PM, Gagandeep singh <gagan.goku@gmail.com
> >wrote:
> >>
> >>> Hi Mat
> >>>
> >>> I think this was done to ensure that the node list and reservedUris
> list
> >>> stay in sync. But you raise a good point, its probably better to ignore
> the
> >>> failing uri and its corresponding node altogether.
> >>>
> >>> On Tue, Aug 3, 2010 at 8:27 PM, Mat Mannion <M.Mannion@warwick.ac.uk
> >wrote:
> >>>
> >>>> Hi all,
> >>>>
> >>>> The BBC news gadget
> >>>> (
> >>>>
> http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml
> >>>> )
> >>>> includes some rather strange image URLs for stats tracking that have
> >>>> quotes and tildes in the query string, which causes Uri.parse to throw
> >>>> a UriException:
> >>>>
> >>>> org.apache.shindig.common.uri.Uri$UriException:
> >>>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
> >>>> Illegal character in query at index 107:
> >>>>
> >>>>
> http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~
> >>>> "http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~
> >>>>
> >>>> Currently in ProxyingVisitor:105 we add null to the list of URIs when
> >>>> we receive an exception, but this is always a bad idea, because it
> >>>> will ALWAYS throw a NullPointerException immediately after when we
> >>>> iterate through the list in DefaultProxyUriManager:92
> >>>>
> >>>> I'm not familiar enough with this part of the code to see where the
> >>>> wrong behaviour is, but could somebody please have a look at it?
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Mat
> >>>>
> >>>> --
> >>>> Mat Mannion
> >>>> Web Developer
> >>>> IT Services
> >>>> University of Warwick
> >>>> Coventry
> >>>> CV4 7AL
> >>>>
> >>>> Tel: 024 765 74433
> >>>> Email: M.Mannion@warwick.ac.uk
> >>>>
> >>>
> >>>
> >>
> >
>
>
>
> --
> Mat Mannion
> Web Developer
> IT Services
> University of Warwick
> Coventry
> CV4 7AL
>
> Tel: 024 765 74433
> Email: M.Mannion@warwick.ac.uk
>

Re: NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Posted by Mat Mannion <M....@warwick.ac.uk>.
Thanks; can confirm my problem is now resolved.

Mat

On 3 August 2010 22:01, Gagandeep singh <ga...@gmail.com> wrote:
> Reviewers: dev-remailer@shindig.apache.org
>
> Message:
> Please review.
>
> As reported by Mat, currently ProxyingVisitor adds null to reservedUri list
> for uri's that are not
> parsed. It looks like its done in order to keep reserverUri list and node
> list
> in sync.
> However, this causes a NullPointerException at DefaultProxyUriManager:92.
>
> This change ignores the uri's (and corresponding nodes) which fail to parse.
>
> http://codereview.appspot.com/1869052/show
>
>
> On Tue, Aug 3, 2010 at 10:50 PM, Gagandeep singh <ga...@gmail.com>wrote:
>
>> Probably something along these lines would be better:
>> http://codereview.appspot.com/1869052/show ?
>> <http://codereview.appspot.com/1869052/show>
>>
>> On Tue, Aug 3, 2010 at 9:04 PM, Gagandeep singh <ga...@gmail.com>wrote:
>>
>>> Hi Mat
>>>
>>> I think this was done to ensure that the node list and reservedUris list
>>> stay in sync. But you raise a good point, its probably better to ignore the
>>> failing uri and its corresponding node altogether.
>>>
>>> On Tue, Aug 3, 2010 at 8:27 PM, Mat Mannion <M....@warwick.ac.uk>wrote:
>>>
>>>> Hi all,
>>>>
>>>> The BBC news gadget
>>>> (
>>>> http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml
>>>> )
>>>> includes some rather strange image URLs for stats tracking that have
>>>> quotes and tildes in the query string, which causes Uri.parse to throw
>>>> a UriException:
>>>>
>>>> org.apache.shindig.common.uri.Uri$UriException:
>>>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
>>>> Illegal character in query at index 107:
>>>>
>>>> http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~
>>>> "http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~
>>>>
>>>> Currently in ProxyingVisitor:105 we add null to the list of URIs when
>>>> we receive an exception, but this is always a bad idea, because it
>>>> will ALWAYS throw a NullPointerException immediately after when we
>>>> iterate through the list in DefaultProxyUriManager:92
>>>>
>>>> I'm not familiar enough with this part of the code to see where the
>>>> wrong behaviour is, but could somebody please have a look at it?
>>>>
>>>> Thanks,
>>>>
>>>> Mat
>>>>
>>>> --
>>>> Mat Mannion
>>>> Web Developer
>>>> IT Services
>>>> University of Warwick
>>>> Coventry
>>>> CV4 7AL
>>>>
>>>> Tel: 024 765 74433
>>>> Email: M.Mannion@warwick.ac.uk
>>>>
>>>
>>>
>>
>



-- 
Mat Mannion
Web Developer
IT Services
University of Warwick
Coventry
CV4 7AL

Tel: 024 765 74433
Email: M.Mannion@warwick.ac.uk

Re: NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Posted by Gagandeep singh <ga...@gmail.com>.
Reviewers: dev-remailer@shindig.apache.org

Message:
Please review.

As reported by Mat, currently ProxyingVisitor adds null to reservedUri list
for uri's that are not
parsed. It looks like its done in order to keep reserverUri list and node
list
in sync.
However, this causes a NullPointerException at DefaultProxyUriManager:92.

This change ignores the uri's (and corresponding nodes) which fail to parse.

http://codereview.appspot.com/1869052/show


On Tue, Aug 3, 2010 at 10:50 PM, Gagandeep singh <ga...@gmail.com>wrote:

> Probably something along these lines would be better:
> http://codereview.appspot.com/1869052/show ?
> <http://codereview.appspot.com/1869052/show>
>
> On Tue, Aug 3, 2010 at 9:04 PM, Gagandeep singh <ga...@gmail.com>wrote:
>
>> Hi Mat
>>
>> I think this was done to ensure that the node list and reservedUris list
>> stay in sync. But you raise a good point, its probably better to ignore the
>> failing uri and its corresponding node altogether.
>>
>> On Tue, Aug 3, 2010 at 8:27 PM, Mat Mannion <M....@warwick.ac.uk>wrote:
>>
>>> Hi all,
>>>
>>> The BBC news gadget
>>> (
>>> http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml
>>> )
>>> includes some rather strange image URLs for stats tracking that have
>>> quotes and tildes in the query string, which causes Uri.parse to throw
>>> a UriException:
>>>
>>> org.apache.shindig.common.uri.Uri$UriException:
>>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
>>> Illegal character in query at index 107:
>>>
>>> http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~
>>> "http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~
>>>
>>> Currently in ProxyingVisitor:105 we add null to the list of URIs when
>>> we receive an exception, but this is always a bad idea, because it
>>> will ALWAYS throw a NullPointerException immediately after when we
>>> iterate through the list in DefaultProxyUriManager:92
>>>
>>> I'm not familiar enough with this part of the code to see where the
>>> wrong behaviour is, but could somebody please have a look at it?
>>>
>>> Thanks,
>>>
>>> Mat
>>>
>>> --
>>> Mat Mannion
>>> Web Developer
>>> IT Services
>>> University of Warwick
>>> Coventry
>>> CV4 7AL
>>>
>>> Tel: 024 765 74433
>>> Email: M.Mannion@warwick.ac.uk
>>>
>>
>>
>

Re: NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Posted by Gagandeep singh <ga...@gmail.com>.
Probably something along these lines would be better:
http://codereview.appspot.com/1869052/show ?
<http://codereview.appspot.com/1869052/show>

On Tue, Aug 3, 2010 at 9:04 PM, Gagandeep singh <ga...@gmail.com>wrote:

> Hi Mat
>
> I think this was done to ensure that the node list and reservedUris list
> stay in sync. But you raise a good point, its probably better to ignore the
> failing uri and its corresponding node altogether.
>
> On Tue, Aug 3, 2010 at 8:27 PM, Mat Mannion <M....@warwick.ac.uk>wrote:
>
>> Hi all,
>>
>> The BBC news gadget
>> (
>> http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml
>> )
>> includes some rather strange image URLs for stats tracking that have
>> quotes and tildes in the query string, which causes Uri.parse to throw
>> a UriException:
>>
>> org.apache.shindig.common.uri.Uri$UriException:
>> java.lang.IllegalArgumentException: java.net.URISyntaxException:
>> Illegal character in query at index 107:
>>
>> http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~
>> "http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~
>>
>> Currently in ProxyingVisitor:105 we add null to the list of URIs when
>> we receive an exception, but this is always a bad idea, because it
>> will ALWAYS throw a NullPointerException immediately after when we
>> iterate through the list in DefaultProxyUriManager:92
>>
>> I'm not familiar enough with this part of the code to see where the
>> wrong behaviour is, but could somebody please have a look at it?
>>
>> Thanks,
>>
>> Mat
>>
>> --
>> Mat Mannion
>> Web Developer
>> IT Services
>> University of Warwick
>> Coventry
>> CV4 7AL
>>
>> Tel: 024 765 74433
>> Email: M.Mannion@warwick.ac.uk
>>
>
>

Re: NullPointerException in ProxyingVisitor/DefaultProxyUriManager (latest trunk breaking gadget rendering of some important gadgets)

Posted by Gagandeep singh <ga...@gmail.com>.
Hi Mat

I think this was done to ensure that the node list and reservedUris list
stay in sync. But you raise a good point, its probably better to ignore the
failing uri and its corresponding node altogether.

On Tue, Aug 3, 2010 at 8:27 PM, Mat Mannion <M....@warwick.ac.uk> wrote:

> Hi all,
>
> The BBC news gadget
> (
> http://bbcnewsgadget.googlecode.com/svn/trunk/Gadget/bbc_igoogle_ukedition12.xml
> )
> includes some rather strange image URLs for stats tracking that have
> quotes and tildes in the query string, which causes Uri.parse to throw
> a UriException:
>
> org.apache.shindig.common.uri.Uri$UriException:
> java.lang.IllegalArgumentException: java.net.URISyntaxException:
> Illegal character in query at index 107:
>
> http://stats.bbc.co.uk/o.gif?~RS~s~RS~News~RS~t~RS~Google_i_1~RS~i~RS~0~RS~p~RS~0~RS~a~RS~Domestic~RS~u~RS~
> "http://www.google.com/ig/"~RS~r~RS~0~RS~q~RS~~RS~z~RS~51~RS~
>
> Currently in ProxyingVisitor:105 we add null to the list of URIs when
> we receive an exception, but this is always a bad idea, because it
> will ALWAYS throw a NullPointerException immediately after when we
> iterate through the list in DefaultProxyUriManager:92
>
> I'm not familiar enough with this part of the code to see where the
> wrong behaviour is, but could somebody please have a look at it?
>
> Thanks,
>
> Mat
>
> --
> Mat Mannion
> Web Developer
> IT Services
> University of Warwick
> Coventry
> CV4 7AL
>
> Tel: 024 765 74433
> Email: M.Mannion@warwick.ac.uk
>