cvc-elt.1 Cannot find the declaration of element 'additionalHeaders'











up vote
0
down vote

favorite












Upgrading an old Spring MVC 2 project to Spring Boot 2, such error occurs:




2018-11-07 15:26:38.371 ERROR 4893 --- [ main]
o.s.boot.SpringApplication : Application run failed



org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 8 in XML document from URL
[jar:file:/Users/guojiahao/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar!/xml-header-style.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 8; columnNumber: 20; cvc-elt.1: Cannot find the
declaration of element 'additionalHeaders'. at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromImportedResources$0(ConfigurationClassBeanDefinitionReader.java:358)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
~[na:1.8.0_172] at
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:325)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
com.example.ite.Application.main(Application.java:9) [classes/:na]
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'additionalHeaders'. at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
~[na:1.8.0_172] at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
~[na:1.8.0_172] at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] ... 23 common frames
omitted



Process finished with exit code 1




Validation-api is one of dependencies of spring-starter-web:



enter image description here



I have no idea why the problem occurs. Could you offer some hint or are there any ways I could go to debug to find out the solution of the problem?










share|improve this question


























    up vote
    0
    down vote

    favorite












    Upgrading an old Spring MVC 2 project to Spring Boot 2, such error occurs:




    2018-11-07 15:26:38.371 ERROR 4893 --- [ main]
    o.s.boot.SpringApplication : Application run failed



    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
    Line 8 in XML document from URL
    [jar:file:/Users/guojiahao/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar!/xml-header-style.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
    lineNumber: 8; columnNumber: 20; cvc-elt.1: Cannot find the
    declaration of element 'additionalHeaders'. at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromImportedResources$0(ConfigurationClassBeanDefinitionReader.java:358)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
    ~[na:1.8.0_172] at
    org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:325)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
    ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
    [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
    [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
    [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
    [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
    com.example.ite.Application.main(Application.java:9) [classes/:na]
    Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
    declaration of element 'additionalHeaders'. at
    com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    ~[na:1.8.0_172] at
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    ~[na:1.8.0_172] at
    org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
    ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] ... 23 common frames
    omitted



    Process finished with exit code 1




    Validation-api is one of dependencies of spring-starter-web:



    enter image description here



    I have no idea why the problem occurs. Could you offer some hint or are there any ways I could go to debug to find out the solution of the problem?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Upgrading an old Spring MVC 2 project to Spring Boot 2, such error occurs:




      2018-11-07 15:26:38.371 ERROR 4893 --- [ main]
      o.s.boot.SpringApplication : Application run failed



      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
      Line 8 in XML document from URL
      [jar:file:/Users/guojiahao/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar!/xml-header-style.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
      lineNumber: 8; columnNumber: 20; cvc-elt.1: Cannot find the
      declaration of element 'additionalHeaders'. at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromImportedResources$0(ConfigurationClassBeanDefinitionReader.java:358)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
      ~[na:1.8.0_172] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:325)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
      ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      com.example.ite.Application.main(Application.java:9) [classes/:na]
      Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
      declaration of element 'additionalHeaders'. at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
      ~[na:1.8.0_172] at
      org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] ... 23 common frames
      omitted



      Process finished with exit code 1




      Validation-api is one of dependencies of spring-starter-web:



      enter image description here



      I have no idea why the problem occurs. Could you offer some hint or are there any ways I could go to debug to find out the solution of the problem?










      share|improve this question













      Upgrading an old Spring MVC 2 project to Spring Boot 2, such error occurs:




      2018-11-07 15:26:38.371 ERROR 4893 --- [ main]
      o.s.boot.SpringApplication : Application run failed



      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
      Line 8 in XML document from URL
      [jar:file:/Users/guojiahao/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar!/xml-header-style.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
      lineNumber: 8; columnNumber: 20; cvc-elt.1: Cannot find the
      declaration of element 'additionalHeaders'. at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:224)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:195)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromImportedResources$0(ConfigurationClassBeanDefinitionReader.java:358)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
      ~[na:1.8.0_172] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:325)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
      ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
      ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
      [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE] at
      com.example.ite.Application.main(Application.java:9) [classes/:na]
      Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
      declaration of element 'additionalHeaders'. at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1901)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
      ~[na:1.8.0_172] at
      com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
      ~[na:1.8.0_172] at
      org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:434)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] at
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
      ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE] ... 23 common frames
      omitted



      Process finished with exit code 1




      Validation-api is one of dependencies of spring-starter-web:



      enter image description here



      I have no idea why the problem occurs. Could you offer some hint or are there any ways I could go to debug to find out the solution of the problem?







      java spring spring-mvc spring-boot






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 7:50









      guo

      3,49772048




      3,49772048





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185364%2fcvc-elt-1-cannot-find-the-declaration-of-element-additionalheaders%23new-answer', 'question_page');
          }
          );

          Post as a guest





































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185364%2fcvc-elt-1-cannot-find-the-declaration-of-element-additionalheaders%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          這個網誌中的熱門文章

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Xamarin.form Move up view when keyboard appear

          JBPM : POST request for execute process go wrong