【解决geoserver 日志加载报错 Failed to load logging configuration file ‘logging.xml‘】

  • Post author:
  • Post category:其他


【解决geoserver 日志加载报错 Failed to load logging configuration file ‘logging.xml’】



报错日志:

19 五月 10:56:30 WARN [org.geoserver] - Failed to load logging configuration file 'logging.xml'
com.thoughtworks.xstream.io.StreamException:
        at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:126)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)
        at com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:63)
        at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54)
        at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
        at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1347)
        at org.geoserver.config.util.XStreamPersister.load(XStreamPersister.java:718)
        at org.geoserver.config.GeoServerLoader.depersist(GeoServerLoader.java:1097)
        at org.geoserver.config.GeoServerLoader.readConfiguration(GeoServerLoader.java:941)
        at org.geoserver.config.DefaultGeoServerLoader.loadGeoServer(DefaultGeoServerLoader.java:70)
        at org.geoserver.config.GeoServerLoader.postProcessBeforeInitializationGeoServer(GeoServerLoader.java:307)
        at org.geoserver.config.GeoServerLoader.postProcessBeforeInitialization(GeoServerLoader.java:284)
        at org.geoserver.config.GeoServerLoaderProxy.postProcessBeforeInitialization(GeoServerLoaderProxy.java:60)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)



解决:

导致这个问题的原因是因为你的geoserver的日志加载目录做了修改,geoserver在你新修改的目录下面同样会创建一个logging.xml文件,问题的关键就是这个地方:这个新建的logging.xml文件是没有内容的这也就导致了logging.xml加载报错。

其实解决思路很简单,直接把之前的日志内容复制进去就行了,如果熟悉的话,自己去把内容加上也是一样的

<logging>
  <level>DEFAULT_LOGGING.properties</level>
  <location>logs/geoserver.log</location>
  <stdOutLogging>true</stdOutLogging>
</logging>

重新启动服务就不会报错了。



关于geoserver的相关配置之后有时间会写一些相关文章。



版权声明:本文为yu_pan_love_cat原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。