[Geoserver-users] geowebcache - seeding - java.lang.IllegalStateException: getWriter() has already been called for this response

All,

I am trying without success to seed a layer in geowebcache.

Here is the url I am using to do the seeding:
    http://127.0.0.1:8080/geowebcache/seed?layers=map&start=12&stop=14

When I enter this url into firefox, I see this...

Seeding map from level 12 to level 14 for format image/png and bounds Min X:
-2.003750834E7 Min Y: -2.003750834E7 Max X: 2.003750834E7 Max Y:
2.003750834E7
Level 12, ~672400 metatile(s) [16777216 tile(s)]
0,

and then it stops.

When use curl I see this:

[pmccullough@anonymised.com ~]$ curl
"http://10.1.15.73:8080/geowebcache/seed?layers=map&start=12&stop=14"
<html><body><table><tr><td>Seeding map from level 12 to level 14 for format
image/png and bounds Min X: -2.003750834E7 Min Y: -2.003750834E7 Max X:
2.003750834E7 Max Y: 2.003750834E7</td></tr><tr><td>Level 12, ~672400
metatile(s) [16777216 tile(s)]</td></tr><tr><td>0, [pmccullough@anonymised.com ~]$

and I am suddenly back at the command prompt.

Here is the stack trace in the tomcat logfile:
    INFO: Initializing Spring FrameworkServlet 'geowebcache'
    Aug 13, 2008 8:57:05 AM org.apache.catalina.core.StandardWrapperValve
invoke
    SEVERE: Servlet.service() for servlet geowebcache threw exception
    java.lang.IllegalStateException: getWriter() has already been called for
this response
      at
org.apache.catalina.connector.Response.getOutputStream(Response.java:579)
      at
org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:183)
      at
org.geowebcache.GeoWebCacheDispatcher.writeError(GeoWebCacheDispatcher.java:381)
      at
org.geowebcache.GeoWebCacheDispatcher.handleRequestInternal(GeoWebCacheDispatcher.java:156)
      at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
      at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
      at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
      at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:453)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)

I see no output to the geoserver log file.
    
Here is the layer definition in geowebcache:
    #Type, determines configuration parser
    layername=map
    type=wms
    
    # Backend
    wmsurl=http://localhost:8080/geoserver/wms
    wmslayers=layer-group_map
    
    # Tile profile
    mimetypes=image/png
    palette=sfmaps
    srs=EPSG:900913
    grid=-20037508.34,-20037508.34,20037508.34,20037508.34
    bbox=-20037508.34,-20037508.34,20037508.34,20037508.34
    
    width=256
    height=256
    version=1.1.0
    errormime=application/vnd.ogc.se_inimage
    tiled=false
    transparent=true
    metatiling=5x5
    debugheaders=true
    
    # Cache backend settings
    cacheprefix=c:\\geowebcache\\map

This config works properly using openlayers; images get cached, etc.
I am careful to delete c:\\geowebcache\\ ech time through.
I am careful to restart tomcat.

My environment is
- geowebcache 0.8.4
- geoserver 1.6.3
- java 1.6.0_05
- tomcat 6.0.16
- windows xp sp2

Thanks,
Paul

--
View this message in context: http://www.nabble.com/geowebcache---seeding---java.lang.IllegalStateException%3A-getWriter()-has-already-been-called-for-this-response-tp18969233p18969233.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Paul,

sorry I didn't have time to test and respond before now. I understand the error message, I'm surprised it doesn't show up when I run it in Jetty (I guess the Servlet implementations differ? or there is some other library difference).

Anyway, I've made you a version that just prints plusses justing OutputStream instead of Writer, I don't think they get sent to the client though, so it'll probably act completely silent. http://geo.openplans.org/~ak/geowebcache.war

A new (proper, queued and multithreaded) seeding mechanism has been written as part of a Google Summer of Code project and we will try to get that out and make a nice JavaScript GUI for it in the next two weeks :slight_smile:

Please note that seeding level 12 alone can easily take 23 days, and if the HTTP connection drops you probably have to start over. So I would recommend running it using curl on the same machine as the server.

-Arne

Paul McCullough wrote:

All,

I am trying without success to seed a layer in geowebcache.

Here is the url I am using to do the seeding:
    http://127.0.0.1:8080/geowebcache/seed?layers=map&start=12&stop=14

When I enter this url into firefox, I see this...

Seeding map from level 12 to level 14 for format image/png and bounds Min X:
-2.003750834E7 Min Y: -2.003750834E7 Max X: 2.003750834E7 Max Y:
2.003750834E7
Level 12, ~672400 metatile(s) [16777216 tile(s)]
0,

and then it stops.

When use curl I see this:

[pmccullough@anonymised.com ~]$ curl
"http://10.1.15.73:8080/geowebcache/seed?layers=map&start=12&stop=14&quot;
<html><body><table><tr><td>Seeding map from level 12 to level 14 for format
image/png and bounds Min X: -2.003750834E7 Min Y: -2.003750834E7 Max X:
2.003750834E7 Max Y: 2.003750834E7</td></tr><tr><td>Level 12, ~672400
metatile(s) [16777216 tile(s)]</td></tr><tr><td>0, [pmccullough@anonymised.com ~]$

and I am suddenly back at the command prompt.

Here is the stack trace in the tomcat logfile:
    INFO: Initializing Spring FrameworkServlet 'geowebcache'
    Aug 13, 2008 8:57:05 AM org.apache.catalina.core.StandardWrapperValve
invoke
    SEVERE: Servlet.service() for servlet geowebcache threw exception
    java.lang.IllegalStateException: getWriter() has already been called for
this response
      at
org.apache.catalina.connector.Response.getOutputStream(Response.java:579)
      at
org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:183)
      at
org.geowebcache.GeoWebCacheDispatcher.writeError(GeoWebCacheDispatcher.java:381)
      at
org.geowebcache.GeoWebCacheDispatcher.handleRequestInternal(GeoWebCacheDispatcher.java:156)
      at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
      at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
      at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
      at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:453)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)

I see no output to the geoserver log file.
    Here is the layer definition in geowebcache:
    #Type, determines configuration parser
    layername=map
    type=wms
        # Backend
    wmsurl=http://localhost:8080/geoserver/wms
    wmslayers=layer-group_map
        # Tile profile
    mimetypes=image/png
    palette=sfmaps
    srs=EPSG:900913
    grid=-20037508.34,-20037508.34,20037508.34,20037508.34
    bbox=-20037508.34,-20037508.34,20037508.34,20037508.34
        width=256
    height=256
    version=1.1.0
    errormime=application/vnd.ogc.se_inimage
    tiled=false
    transparent=true
    metatiling=5x5
    debugheaders=true
        # Cache backend settings
    cacheprefix=c:\\geowebcache\\map

This config works properly using openlayers; images get cached, etc.
I am careful to delete c:\\geowebcache\\ ech time through.
I am careful to restart tomcat.

My environment is
- geowebcache 0.8.4
- geoserver 1.6.3
- java 1.6.0_05
- tomcat 6.0.16
- windows xp sp2

Thanks,
Paul