SSM Mall System Development Note-issue 01-wildcard matching is comprehensive, but the declaration of element ' Mvc:annotation-driven ' cannot be found.

Source: Internet
Author: User

Post request after configuration is completed test times error:

caused by:org.xml.sax.SAXParseException; linenumber:14; columnnumber:29; CVC-COMPLEX-TYPE.2.4.C:wildcard match is comprehensive, but cannot find the declaration of element ' Mvc:annotation-driven '。
At Com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (Errorhandlerwrapper.java : 203)
At Com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error (errorhandlerwrapper.java:134)
At Com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (xmlerrorreporter.java:396)
At Com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (xmlerrorreporter.java:327)
At Com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (xmlerrorreporter.java:284)
At Com.sun.org.apache.xerces.internal.impl.xs.xmlschemavalidator$xsierrorreporter.reporterror ( xmlschemavalidator.java:452)
At Com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError (xmlschemavalidator.java:3230 )
At Com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement (Xmlschemavalidator.java : 1911)
At Com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement (xmlschemavalidator.java:760)
At Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement ( xmlnsdocumentscannerimpl.java:357)
At Com.sun.org.apache.xerces.internal.impl.xmldocumentfragmentscannerimpl$fragmentcontentdriver.next ( xmldocumentfragmentscannerimpl.java:2787)
At Com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (xmldocumentscannerimpl.java:606)
At Com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next (xmlnsdocumentscannerimpl.java:118)
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:848)
At Com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (xml11configuration.java:777)
At Com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (xmlparser.java:141)
At Com.sun.org.apache.xerces.internal.parsers.DOMParser.parse (domparser.java:243)
At Com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (documentbuilderimpl.java:339)
At Org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument (defaultdocumentloader.java:76)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument (Xmlbeandefinitionreader.java : 429)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:391)
... Panax Notoginseng More

View the SPRINGMVC configuration file Spring-web.xml as follows, discovering that although MVC is declared but not configured

<?XML version= "1.0" encoding= "UTF-8"?><Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:mvc= "Http://www.springframework.org/schema/mvc"Xmlns:context= "Http://www.springframework.org/schema/context"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-4.0.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/con Text/spring-context.xsd ">    <!--Configure Spring MVC -    <!--1, turn on SPRINGMVC annotation mode A. Autoenrollment Defaultannotationhandlermapping,annotationmethodhandleradapter b. Default provides a range of functions: data binding, Number and date [email protected], @DateTimeFormat c:xml,json default read/write support -    <Mvc:annotation-driven/>    <!--@ResponseBody Annotation Support -    <Beanclass= "Org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>    <Beanclass= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">        < Propertyname= "Messageconverters">            <List>                <refBean= "Mappingjackson2httpmessageconverter"/>            </List>        </ Property>    </Bean>    <BeanID= "Mappingjackson2httpmessageconverter"class= "Org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">        < Propertyname= "Supportedmediatypes">            <List>                <value>Text/html;charset=utf-8</value>                <value>Text/json;charset=utf-8</value>                <value>Application/json;charset=utf-8</value>            </List>        </ Property>    </Bean>    <!--2. Static resource default servlet configuration -    <!--1). Add to the static resource processing: Js,gif,png 2). Allow the use of "/" for the overall mapping Internalresourceviewresolver -    <Mvc:default-servlet-handler/>    <Beanclass= "Org.springframework.web.servlet.view.InternalResourceViewResolver">        < Propertyname= "Viewclass"value= "Org.springframework.web.servlet.view.JstlView"/>        < Propertyname= "prefix"value= "/web-inf/jsp/"/>        < Propertyname= "suffix"value= ". jsp"/>    </Bean>    <!--4: Scan Web-related beans -    <Context:component-scanBase-package= "Com.boron.controller"/></Beans>

Plus after configuration

<?XML version= "1.0" encoding= "UTF-8"?><Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc= "Http://www.springframework.org/schema/mvc" Xmlns:context= "Http://www.springframework.org/schema/context"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-4.0.xsd Http://www.springframework.org/schema/mvc Http://www.springframework.org/schema/mvc /spring-mvc.xsd Http://www.springframework.org/schema/context Http://www.springframework.org/schema/con Text/spring-context.xsd ">

SSM Mall System Development Note-issue 01-wildcard matching is comprehensive, but the declaration of element ' Mvc:annotation-driven ' cannot be found.

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.