[Geoserver-users] IOexception in TransactionResponse

Hi all !

I made a small java client which post an xml wfs request to geoserver1.6.x
the xml post data is quite big. (336489 bytes)

I got the following response :
Exception : The server localhost failed to respond
NoHttpResponseException
with the stack trace :
org.apache.commons.httpclient.NoHttpResponseException: The server localhost failed to respond
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1972)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1727)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1090)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)

The data are processed by geoserver and are in the postgis database !!
but http response is not good...

where can i search ?
in geotools.Encoder ?

Result:
26 oct. 12:43:08 WARN [geoserver.ows] -
java.io.IOException
        at org.geoserver.wfs.response.TransactionResponse.v_1_1(TransactionResponse.java:209)
        at org.geoserver.wfs.response.TransactionResponse.write(TransactionResponse.java:63)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:608)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
        at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
        at org.mortbay.jetty.Server.handle(Server.java:269)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:701)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:617)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:193)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
        at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: org.mortbay.jetty.EofException
        at org.apache.xml.serialize.XMLSerializer.endElement(Unknown Source)
        at org.geotools.xml.Encoder.end(Encoder.java:719)
        at org.geotools.xml.Encoder.encode(Encoder.java:373)
        at org.geoserver.wfs.response.TransactionResponse.v_1_1(TransactionResponse.java:207)
        ... 44 more

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

Hi all !

I made a small java client which post an xml wfs request to geoserver1.6.x
the xml post data is quite big. (336489 bytes)

This is the actual exception:

Caused by: org.mortbay.jetty.EofException
        at org.apache.xml.serialize.XMLSerializer.endElement(Unknown Source)
        at org.geotools.xml.Encoder.end(Encoder.java:719)
        at org.geotools.xml.Encoder.encode(Encoder.java:373)
        at org.geoserver.wfs.response.TransactionResponse.v_1_1(TransactionResponse.java:207)
        ... 44 more

So it seems the client you wrote did not way for the response
to come back and close the http connection instead.
Given the transaction is big, may it be http client timed out?
Cheers
Andrea

OK i try with no limit : httpclient.getParams().setParameter("http.connection.timeout", new Integer(0));
It works.

I stop/start geoserver, and try again..
New exception :
Caused by: java.nio.channels.ClosedChannelException
        at sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:112)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:139)
        at org.mortbay.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:127)
        at org.mortbay.jetty.nio.HttpChannelEndPoint.fill(HttpChannelEndPoint.java:129)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:263)

I try again : OK
...

so weird...

Andrea Aime a écrit :

Sébastien Geindre ha scritto:

Hi all !

I made a small java client which post an xml wfs request to geoserver1.6.x
the xml post data is quite big. (336489 bytes)

This is the actual exception:

Caused by: org.mortbay.jetty.EofException
        at org.apache.xml.serialize.XMLSerializer.endElement(Unknown Source)
        at org.geotools.xml.Encoder.end(Encoder.java:719)
        at org.geotools.xml.Encoder.encode(Encoder.java:373)
        at org.geoserver.wfs.response.TransactionResponse.v_1_1(TransactionResponse.java:207)

        ... 44 more

So it seems the client you wrote did not way for the response
to come back and close the http connection instead.
Given the transaction is big, may it be http client timed out?
Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

OK i try with no limit : httpclient.getParams().setParameter("http.connection.timeout", new Integer(0));
It works.

I stop/start geoserver, and try again..
New exception :
Caused by: java.nio.channels.ClosedChannelException
       at sun.nio.ch.SocketChannelImpl.ensureReadOpen(SocketChannelImpl.java:112)
       at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:139)
       at org.mortbay.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:127)
       at org.mortbay.jetty.nio.HttpChannelEndPoint.fill(HttpChannelEndPoint.java:129)

       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:263)

I try again : OK
...

so weird...

Not so much... the first request you make to a GeoServer 1.6 series
will have to parse the wfs/gml/whatnot schemas, this is expensive and
a result the first request will be served a lot slower than the others
(the others do not have to parse the schemas anymore because we
do cache them).

Cheers
Andrea