[Geoserver-devel] [Windows][IOException] The filename, directory name, or volume label syntax is incorrect

Hi all,
I was working on a 2.2.x GeoServer on windows, debugging to solve for this problem https://jira.codehaus.org/browse/GEOS-5324?focusedCommentId=309687#comment-309687 and I have found another windows related problem.

25 Sep 15:23:18 INFO [geoserver.gwc] - Saving GeoSeverTileLayer ‘test:pippo’
25 Sep 15:23:59 WARN [catalog.impl] - Catalog listener threw exception handling event.
java.lang.RuntimeException: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at org.geoserver.config.GeoServerPersister.handleModifyEvent(GeoServerPersister.java:202)
at org.geoserver.catalog.impl.CatalogImpl.event(CatalogImpl.java:1322)
at org.geoserver.catalog.impl.CatalogImpl.fireModified(CatalogImpl.java:1294)
at org.geoserver.catalog.impl.DefaultCatalogFacade.saved(DefaultCatalogFacade.java:943)
at org.geoserver.catalog.impl.DefaultCatalogFacade.save(DefaultCatalogFacade.java:530)
at org.geoserver.catalog.impl.CatalogImpl.save(CatalogImpl.java:796)
at org.geoserver.security.SecureCatalogImpl.save(SecureCatalogImpl.java:1161)
at org.geoserver.catalog.impl.AbstractCatalogDecorator.save(AbstractCatalogDecorator.java:441)
at org.geoserver.catalog.impl.LocalWorkspaceCatalog.save(LocalWorkspaceCatalog.java:193)
at org.geoserver.web.data.layergroup.LayerGroupEditPage.onSubmit(LayerGroupEditPage.java:66)
at org.geoserver.web.data.layergroup.AbstractLayerGroupPage.save(AbstractLayerGroupPage.java:213)
at org.geoserver.web.data.layergroup.AbstractLayerGroupPage.access$2(AbstractLayerGroupPage.java:212)
at org.geoserver.web.data.layergroup.AbstractLayerGroupPage$4.onSubmit(AbstractLayerGroupPage.java:201)
at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1561)
at org.apache.wicket.markup.html.form.Form.process(Form.java:958)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:920)
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)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)
at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:160)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:159)
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:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
at java.io.File.getCanonicalPath(File.java:559)
at org.geoserver.data.util.IOUtils.rename(IOUtils.java:450)
at org.geoserver.data.util.IOUtils.rename(IOUtils.java:439)
at org.geoserver.config.GeoServerPersister.renameLayerGroup(GeoServerPersister.java:754)
at org.geoserver.config.GeoServerPersister.handleModifyEvent(GeoServerPersister.java:132)
… 99 more

This is due to the name of the layer which is containing the special character “:”.

I’m thinking about this problem in terms of:

  1. an issue
  2. a wrong user configuration

What do you think about this?

Looking at the code found here:

LayerGroupInfo getLayerGroup(String id){
...
int colon = name.indexOf( ':' );
...

}


I see that we are trying to interpret the passed name (probably due to the REST interface?) as workspace:layername

This operation may be performed during the persist() operation checking the layername for ":" and storing it as workspace and layername instead.
This will obviously solve the above windows problem (if you think this is a problem).
What do you think?
In that case the provided GEOS-5324 patch is still valid and needed to keep backward compatibility with already configured layergroup.
Probably this also happens on Layers.

Regards,
Carlo


Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Dott. Carlo Cancellieri
@cancellieric
Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
mobile: +39 3371094494
fax: +39 0584 962313

http://www.geo-solutions.it
http://twitter.com/geosolutions_it