[Geoserver-devel] [jira] Created: (GEOS-1738) Ampersand in format description in catalog.xml causes failure to start geoserver

Ampersand in format description in catalog.xml causes failure to start geoserver
--------------------------------------------------------------------------------

                 Key: GEOS-1738
                 URL: http://jira.codehaus.org/browse/GEOS-1738
             Project: GeoServer
          Issue Type: Bug
          Components: Configuration
    Affects Versions: 1.6.0-RC3
         Environment: GeoServer 1.6.0 RC3 on Java 1.5 on OS X 10.4
            Reporter: Amos Hayes
            Assignee: Andrea Aime

Including a description to a coverage store which contains an ampersand (&) works while geoserver is up. But GeoServer will not restart.

The following in catalog.xml:

<format namespace = "glsl" enabled = "true" id = "general1811robhuron_4326.tif" >
      <description>CANADA / BY A. K. JOHNSTON F. R. G. S. // NATIONAL ATLAS // 38 //
Engraved by W. & A. K. Johnston. // [above the title overprinted
"LITHOGRAPHED EDITION" has been added in sepia] // [imprint at bottom
of sheet is partially cut off]

Alexander Keith Johnston (1804-1871), published [1849?].
Printed map. 50 cm x 61 cm, on sheet 52 cm x 64 cm. Boundaries and
outlines coloured. Gilt edges.
Scale: Two visual scales [67 mm = 90 Geographical Miles & 63 mm = 100
English Miles].
Taken from same original source as Accession # 107382.
Acquired as part of the Hodsoll Collection. </description>
      <type>GeoTIFF</type>
      <url>file:coverages/glsl/general1811robhuron_4326.tif</url>
    </format>

will generate this error:

[Fatal Error] :79:17: The entity name must immediately follow the '&' in the entity reference.
11 Feb 16:42:25 ERROR [context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config' defined in URL [jar:file:/usr/local/apache-tomcat-6.0.14/webapps/geo
server/WEB-INF/lib/main-1.6.0-RC3.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: Error reading : java.
io.InputStreamReader@anonymised.com
java.lang.RuntimeException: Error reading : java.io.InputStreamReader@anonymised.com
        at org.geoserver.util.ReaderUtils.parse(ReaderUtils.java:90)
        at org.vfny.geoserver.global.xml.XMLConfigReader.loadCatalog(XMLConfigReader.java:364)
        at org.vfny.geoserver.global.xml.XMLConfigReader.load(XMLConfigReader.java:222)
        at org.vfny.geoserver.global.xml.XMLConfigReader.<init>(XMLConfigReader.java:176)
        at org.vfny.geoserver.global.Config.setApplicationContext(Config.java:90)
        at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:84)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFacto
ry.java:248)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:362)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:312)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.geoserver.util.ReaderUtils.parse(ReaderUtils.java:87)
        ... 42 more
Feb 11, 2008 4:42:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Feb 11, 2008 4:42:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/geoserver] startup failed due to previous errors

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

     [ http://jira.codehaus.org/browse/GEOS-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arne Kepp reopened GEOS-1738:
-----------------------------

Thank you for your persistence :slight_smile:

So I didn't know the WCS configuration well enough. There are actually two closely related bugs here.

One is the writing of catalog.xml, which is covered in your report, and this has been fixed. But that is really from the datastore definition.

The same problem can occur in services.xml, which is where coverage keywords and abstracts are stored.

Ampersand in format description in catalog.xml causes failure to start geoserver
--------------------------------------------------------------------------------

                Key: GEOS-1738
                URL: http://jira.codehaus.org/browse/GEOS-1738
            Project: GeoServer
         Issue Type: Bug
         Components: Configuration
   Affects Versions: 1.6.0-RC3
        Environment: GeoServer 1.6.0 RC3 on Java 1.5 on OS X 10.4
           Reporter: Amos Hayes
           Assignee: Arne Kepp
            Fix For: 1.6.1

Including a description to a coverage store which contains an ampersand (&) works while geoserver is up. But GeoServer will not restart.
The following in catalog.xml:
<format namespace = "glsl" enabled = "true" id = "general1811robhuron_4326.tif" >
      <description>CANADA / BY A. K. JOHNSTON F. R. G. S. // NATIONAL ATLAS // 38 //
Engraved by W. & A. K. Johnston. // [above the title overprinted
"LITHOGRAPHED EDITION" has been added in sepia] // [imprint at bottom
of sheet is partially cut off]
Alexander Keith Johnston (1804-1871), published [1849?].
Printed map. 50 cm x 61 cm, on sheet 52 cm x 64 cm. Boundaries and
outlines coloured. Gilt edges.
Scale: Two visual scales [67 mm = 90 Geographical Miles & 63 mm = 100
English Miles].
Taken from same original source as Accession # 107382.
Acquired as part of the Hodsoll Collection. </description>
      <type>GeoTIFF</type>
      <url>file:coverages/glsl/general1811robhuron_4326.tif</url>
    </format>
will generate this error:
[Fatal Error] :79:17: The entity name must immediately follow the '&' in the entity reference.
11 Feb 16:42:25 ERROR [context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config' defined in URL [jar:file:/usr/local/apache-tomcat-6.0.14/webapps/geo
server/WEB-INF/lib/main-1.6.0-RC3.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: Error reading : java.
io.InputStreamReader@anonymised.com
java.lang.RuntimeException: Error reading : java.io.InputStreamReader@anonymised.com
        at org.geoserver.util.ReaderUtils.parse(ReaderUtils.java:90)
        at org.vfny.geoserver.global.xml.XMLConfigReader.loadCatalog(XMLConfigReader.java:364)
        at org.vfny.geoserver.global.xml.XMLConfigReader.load(XMLConfigReader.java:222)
        at org.vfny.geoserver.global.xml.XMLConfigReader.<init>(XMLConfigReader.java:176)
        at org.vfny.geoserver.global.Config.setApplicationContext(Config.java:90)
        at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:84)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFacto
ry.java:248)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:362)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:312)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.geoserver.util.ReaderUtils.parse(ReaderUtils.java:87)
        ... 42 more
Feb 11, 2008 4:42:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Feb 11, 2008 4:42:25 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/geoserver] startup failed due to previous errors

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira