Spring Deployment Errors

Source: Internet
Author: User

1. Error message

Severity: Context initialization failed
Org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line 1 in XML document from class path resource [ ] is invalid; Nested exception is org.xml.sax.SAXParseException:Content are not allowed in Prolog.



Complete error message

2015-8-17 10:06:06 org.apache.catalina.core.AprLifecycleListener init info: The Apache Tomcat Native Library which allows op Timal performance in production environments is not found on the Java.library.path:d:\java\myeclipse10\common\binary\co M.sun.java.jdk.win32.x86_1.6.0.013\bin;d:\java\myeclipse10\common\plugins\ COM.GENUITEC.ECLIPSE.EASIE.TOMCAT.MYECLIPSE_9.0.0.ME201211011550\TOMCAT\BIN2015-8-17 10:06:06 Org.apache.coyote.http11.Http11Protocol init information: Initializing Coyote http/1.1 on http-80802015-8-17 10:06:06 Org.apache.catalina.startup.Catalina Load Info: Initialization processed in 259 MS2015-8-17 10:06:06 Org.apache.catalina.core.StandardService Start info: Starting service catalina2015-8-17 10:06:06 Org.apache.catalina.core.StandardEngine Start Info: Starting Servlet engine:apache tomcat/6.0.132015-8-17 10:06:06 Org.apache.catalina.loader.WebappClassLoader validatejarfile Info: validatejarfile (E:\SrcMyeclipse10\ Opensourceproject1\heilan\.metadata\.me_tcat\webapps\root\web-inf\lib\servlet-aPi.jar)-jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending CLASS:JAVAX/SERVLET/SERVLET.CLASS2015-8-17 10:06:06 org.apache.catalina.core.ApplicationContext log information: Initializing Spring root webapplicationcontext2015-8-17 10:06:06 org.springframework.web.context.ContextLoader Initwebapplicationcontext Info: Root webapplicationcontext:initialization started2015-8-17 10:06:06 Org.springframework.context.support.AbstractApplicationContext Preparerefresh Info: Refreshing o[email  Protected]18f729c:display name [Root Webapplicationcontext]; startup Date [Mon-10:06:06 CST 2015]; Root of context hierarchy2015-8-17 10:06:07 Org.springframework.beans.factory.xml.XmlBeanDefinitionReader Loadbeandefinitions info: Loading XML Bean Definitions from class path resource [SPRINGAPPLICATIONCONTEXT.XML]2015-8-17 10:06:07 Org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadbeandefinitions Info: Loading XML bean Definitions from class path resource []2015-8-17 10:06:07 org.springFramework.web.context.ContextLoader Initwebapplicationcontext Serious: Context initialization Failedorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line 1 in XML document from class path Resource [] is invalid; Nested exception is org.xml.sax.SAXParseException:Content are not allowed in prolog.at org.springframework.beans.factory . Xml. Xmlbeandefinitionreader.doloadbeandefinitions (xmlbeandefinitionreader.java:404) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (Xmlbeandefinitionreader.java : 342) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions ( xmlbeandefinitionreader.java:310) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:143) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:178) at Org.springframework.beans.factory.support.AbstractBeanDefinitionREader.loadbeandefinitions (abstractbeandefinitionreader.java:149) at Org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions ( xmlwebapplicationcontext.java:124) at Org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions ( xmlwebapplicationcontext.java:92) at Org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory ( abstractrefreshableapplicationcontext.java:123) at Org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory ( abstractapplicationcontext.java:422) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:352) at Org.springframework.web.context.ContextLoader.createWebApplicationContext (contextloader.java:255) at Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:199) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:45) at Org.apacHe.catalina.core.StandardContext.listenerStart (standardcontext.java:3827) at Org.apache.catalina.core.StandardContext.start (standardcontext.java:4334) 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.deployDirectory (hostconfig.java:920) at Org.apache.catalina.startup.HostConfig.deployDirectories (hostconfig.java:883) at Org.apache.catalina.startup.HostConfig.deployApps (hostconfig.java:492) 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:597) 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: Content is not allowed in prolog.at Com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (Errorhandlerwrapper.java : 195) at Com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalerror (errorhandlerwrapper.java:174) at Com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (xmlerrorreporter.java:388) at Com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError (xmlscanner.java:1411) at Com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl$prologdriver.next (XMLDocumentScannerImpl.java : 1038) at Com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (xmldocumentscannerimpl.java:648) at Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next (xmlnsdocumentscannerimpl.java:140) at Com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument ( xmldocumentfragmentscannerimpl.java:510) at Com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse ( xml11configuration.java:807) at Com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse ( xml11configuration.java:737) at Com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (xmlparser.java:107) at Com.sun.org.apache.xerces.Internal.parsers.DOMParser.parse (domparser.java:225) at Com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (documentbuilderimpl.java:283) at Org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument (defaultdocumentloader.java:75) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:396) ... Panax Notoginseng more2015-8-17 10:06:07 org.apache.catalina.core.StandardContext listenerstart severity: Exception Sending context Initialized event to listener instance of class Org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.xml.XmlBeanDefinitionStoreExceptio N:line 1 in XML document from the class path resource [] is invalid; Nested exception is org.xml.sax.SAXParseException:Content are not allowed in prolog.at org.springframework.beans.factory . Xml. Xmlbeandefinitionreader.doloadbeandefinitions (xmlbeandefinitionreader.java:404) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeAndefinitions (xmlbeandefinitionreader.java:342) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (Xmlbeandefinitionreader.java : 310) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:143) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:178) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:149) at Org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions ( xmlwebapplicationcontext.java:124) at Org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions ( xmlwebapplicationcontext.java:92) at Org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory ( abstractrefreshableapplicationcontext.java:123) at Org.springframework.context.support.AbstractApplicAtioncontext.obtainfreshbeanfactory (abstractapplicationcontext.java:422) at Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:352) at Org.springframework.web.context.ContextLoader.createWebApplicationContext (contextloader.java:255) at Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:199) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:45) at Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:3827) at Org.apache.catalina.core.StandardContext.start (standardcontext.java:4334) 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.deployDirectory (hostconfig.java:920) at Org.apache.catalina.startup.HostConfig.deployDirectories (hostconfig.java:883) at Org.apache.catalina.startup.HostConfig.deployApps (hostconfig.java:492) 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:597) 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:Content is Not allowed in prolog.at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException ( errorhandlerwrapper.java:195) at Com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError ( errorhandlerwrapper.java:174) at Com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError ( xmlerrorreporter.java:388) at Com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError ( xmlscanner.java:1411) at Com.sun.org.apache.xerces.internal.impl.xmldocumentscannerimpl$prologdriver.next ( xmldocumentscannerimpl.java:1038) at Com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next ( xmldocumentscannerimpl.java:648) at Com.sun.org.apache.xerces.internal.impl.XMLnsdocumentscannerimpl.next (xmlnsdocumentscannerimpl.java:140) at Com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument ( xmldocumentfragmentscannerimpl.java:510) at Com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse ( xml11configuration.java:807) at Com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse ( xml11configuration.java:737) at Com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (xmlparser.java:107) at Com.sun.org.apache.xerces.internal.parsers.DOMParser.parse (domparser.java:225) at Com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (documentbuilderimpl.java:283) at Org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument (defaultdocumentloader.java:75) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:396) ... PNS more2015-8-17 10:06:07 org.apache.catalina.core.StandardContext start severity: Error listenerstart2015-8-17 10:06:07 Org.apachE.catalina.core.standardcontext start severity: Context [] startup failed due to previous ERRORS2015-8-17 10:06:07 org.apache.ca Talina.core.ApplicationContext Log Info: Closing Spring root webapplicationcontext2015-8-17 10:06:07 Org.apache.coyote.http11.Http11Protocol Start Info: Starting Coyote http/1.1 on HTTP-80802015-8-17 10:06:07 Org.apache.jk.common.ChannelSocket init info: jk:ajp13 listening on/0.0.0.0:80092015-8-17 10:06:07 Org.apache.jk.server.JkMain Start info: JK Running id=0 time=0/25 config=null2015-8-17 10:06:07 Org.apache.catalina.startup.Catalina Start Information: Server Startup in 1111 MS


2. Workaround


Here's the correct wording.

<!--the path of the spring configuration file--><context-param><param-name>contextconfiglocation</param-name>< Param-value>classpath:springapplicationcontext.xml,                  Classpath:com/heilan/springbasebean/*.xml,            Classpath:com/heilan/springbean/*.xml                  </param-value></context-param>



Note 2 points

1) configuration file path don't write it wrong.

2) The few lines of code in the configuration file do not add comments.



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Spring Deployment Errors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.