cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad <...@javawork.co.uk>
Subject Re: Intermittent NullPointerException in JAXRSUtils
Date Tue, 06 May 2008 09:27:41 GMT
Issue create in JIRA with patch attached:

    http://issues.apache.org/jira/browse/CXF-1570

Brad

On Fri, May 2, 2008 at 5:37 PM, Sergey Beryozkin
<sergey.beryozkin@iona.com> wrote:
> Many thanks Brad, if you don't get a chance to to do early next week then
> I'll do it once I set up an account, there're delays there due to the apache
> team working with hardware failures..
>
>
>  Cheers, Sergey
>
>
>
>  ----- Original Message ----- From: "Brad" <cfx@javawork.co.uk>
>  To: "Sergey Beryozkin" <sergey.beryozkin@iona.com>
>  Sent: Friday, May 02, 2008 5:03 PM
>
>
>  Subject: Re: Intermittent NullPointerException in JAXRSUtils
>
>
>
> > Sergey,
> >
> > sure, no problem. It will have to wait until Monday but happy to do it.
> >
> > Cheers,
> > Brad.
> >
> > On Fri, May 2, 2008 at 4:47 PM, Sergey Beryozkin
> > <sergey.beryozkin@iona.com> wrote:
> >
> > > Hi Brad,
> > >
> > >
> > >
> > > > well spotted. I made the change locally and it all works fine now.
> > > >
> > >
> > >  Fancy creating a patch :-) ? If you're on windows then there's an
> option
> > > there 'CreatePatch' so you create it and then attach it to a newly
> created
> > > JIRA. I can do this fix myself, but I guess it would be better if people
> who
> > > found the issue and fixed it, like yourself in this case, started
> > > accumulating patch points...I don't think tests are even needed in this
> > > case...
> > >
> > >  Let me know please if you can create a patch...If you're busy, then
> it's
> > > fine, I'll do it myself in the next few weeks, I still haven't set up my
> > > commiter account though...
> > >
> > >  Cheers, Sergey
> > >
> > >  ----- Original Message ----- From: "Brad" <cfx@javawork.co.uk>
> > >  To: "Sergey Beryozkin" <sergey.beryozkin@iona.com>
> > >  Sent: Friday, May 02, 2008 4:14 PM
> > >  Subject: Re: Intermittent NullPointerException in JAXRSUtils
> > >
> > >
> > >
> > >
> > >
> > > > Hi Sergey,
> > > >
> > > > well spotted. I made the change locally and it all works fine now.
> > > >
> > > > Always good to finish the week with a success :-)
> > > >
> > > > Cheers,
> > > > Brad.
> > > >
> > > > On Fri, May 2, 2008 at 3:58 PM, Sergey Beryozkin
> > > > <sergey.beryozkin@iona.com> wrote:
> > > >
> > > > > Hi Brad
> > > > >
> > > > >
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I'm seeing an intermittent problem where I get a NPE at
> > > JAXRSUtils:513:
> > > > > >
> > > > > >       List<String> results = values.get(parameterName);
> > > > > >       if (values != null && values.size() > 0) {
> > > > > >           result = results.get(results.size() - 1);
> > > > > <<<<<<<<<<<<<<<<<<here
> > > > > >       }
> > > > > >
> > > > >
> > > > >
> > > > >  This code looks a bit broken  :-) Seems like 'values' needs to be
> > > replaced
> > > > > with 'results' in the 'if' loop,
> > > > >  it probably works just by chance at the moment. Can you please try
> and
> > > > > update the 'if' loop and recompile ?
> > > > >
> > > > >  I'll update this code on the trunk later anyway...
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > I've stepped through the code and it looks like its going to
work
> but
> > > > > > then it goes round a second time and results is NULL. Here's
my
> class:
> > > > > >
> > > > > > @Path(value="/{domain}/{network}/{user}/mail")
> > > > > > public class MailService {
> > > > > >
> > > > > > @GET
> > > > > > @ConsumeMime({"application/xml", "application/json"})
> > > > > > @ProduceMime({"application/xml", "application/json"})
> > > > > > public MailFolderDocument listMail(@PathParam("domain")String
> domain,
> > > > > > @PathParam("network")String network, @PathParam("user")String
> user,
> > > > > > @HeaderParam("token")String token){
> > > > > >           ....
> > > > > >       }
> > > > > >
> > > > >
> > > > >  This method seems fine...
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > @Path(value="{messageId}", limited=true)
> > > > > > @GET
> > > > > > @ConsumeMime({"application/xml", "application/json"})
> > > > > > @ProduceMime({"application/xml", "application/json"})
> > > > > > public MessageDocument readMessage(@PathParam("user")String
user,
> > > > > > @PathParam("messageId")String messageId,
> @HeaderParam("token")String
> > > > > > token){
> > > > > >
> > > > >
> > > > >
> > > > >  should be fine too, provided that
> > > > >
> > > > >  /{domain}/{network}/{user}/mail/{messageId} requests are targeted
> at
> > > this
> > > > > method, somethink like
> > > > >  /aDomain/aNetwork/foo/mail/12345...
> > > > >
> > > > >
> > > > >
> > > > > >           ....
> > > > > >       }
> > > > > >
> > > > > > }
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > When I hit
> > > http://localhost:8080/cxf/rest/test/domain/network/brad/mail
> > > > > > it hits the breakpoint and in the variables I can see path="/"
and
> > > > > > parameterName=""user". It then hits that line again and this
time
> > > > > > path="/", parameterName="messageId" and results=null.
> > > > > >
> > > > > > I'm assuming there's something not quite right with my annotations
> > > > > > which is causing it to mix the methods up?
> > > > > >
> > > > >
> > > > >  Most likely there's something not quite right with the above code
> in
> > > > > JAXRSUtils :-)
> > > > >
> > > > >  Thanks, Sergey
> > > > >
> > > > >
> > > > > >
> > > > > > Thanks,
> > > > > > Brad.
> > > > > >
> > > > >
> > > > >  ----------------------------
> > > > >  IONA Technologies PLC (registered in Ireland)
> > > > >  Registered Number: 171387
> > > > >  Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > > Ireland
> > > > >
> > > > >
> > > >
> > >
> > >  ----------------------------
> > >  IONA Technologies PLC (registered in Ireland)
> > >  Registered Number: 171387
> > >  Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
> > >
> > >
> >
>
>  ----------------------------
>  IONA Technologies PLC (registered in Ireland)
>  Registered Number: 171387
>  Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Mime
View raw message