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