cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Dolg <steven.d...@indoqa.com>
Subject Re: URLConnectionUtils.closeLoudly()
Date Fri, 04 Dec 2009 14:35:29 GMT
Jos Snellings schrieb:
> Hi!
>
> At the end of RESTController I get:
>
> 2009-12-04 14:57:26,014 ERROR http-8080-Processor20
> org.apache.cocoon.sitemap.InvocationImpl/handle-errors - Error while
> executing the sitemap. [request-uri=/editor/put/definition/1124]
> java.lang.NullPointerException
>         at
> org.apache.cocoon.pipeline.util.URLConnectionUtils.closeQuietly(URLConnectionUtils.java:37)
>         at
> org.apache.cocoon.rest.controller.response.URLResponse.execute(URLResponse.java:91)
>         at
> org.apache.cocoon.rest.controller.SpringRESTController.invoke(SpringRESTController.java:88)
>         at
> org.apache.cocoon.controller.SpringControllerComponent.execute(SpringControllerComponent.java:50)
>         at
> org.apache.cocoon.pipeline.AbstractPipeline.invokeStarter(AbstractPipeline.java:147)
>         at
> org.apache.cocoon.pipeline.CachingPipeline.execute(CachingPipeline.java:126)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>
> It is certainly not closing a connection quietly :-) 
>
> In URLResponse.java, is it possible that in execute()
>
> servletConnection = this.url.openConnection(); is null?
>
> Responses are like:
>    if (action.equals("st")) return new
> URLResponse("servlet:/thesaurusedit/stdemo",data);
>             	if (action.equals("term")) return new
> URLResponse("servlet:/edit/term", data);
>             }
>             
> 	return new URLResponse("servlet:editor/workspace", data);
>
> Is there an obvious mistake I am making?
>   

Hi,

the only difference I can spot is that your last URL does not include a 
leading slash after the protocol: "servlet:editor/workspace" instead of 
"servlet:/editor/workspace".
However throwing the NPE in closeQuietly() is a genuine bug IMO.

Does this happen in all cases of your "action" variable or only for a 
specific one?

IIRC, URL.openConnection will either return a connection of throw an 
exception.
Which would mean that openConnection fails and thus servletConnection 
remains null, which is then not handled correctly...


Steven


> Thanks,
> Jos
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message