2017-09-22 2 views
0

Einer von ‚{ "http://www.springframework.org/schema/beans": meta,„h ttp: //www.springframework.org/ ungültiger Inhalt wurde beginnend mit dem Element gefunden Schema/Beans ": Konstruktor-Arg," http://www.springframework.org/schema/beans ": Eigenschaft," http://www.springframework.org/schema/beans ": Qualifier," http://www.springframework.or g/Schema/Bohnen ": Lookup-Methode," http://www.springframework.org/schema/beans ": ersetzte-Methode, WC [## andere:" http://www.springframework.org/schema/beans "]}" wird erwartet.cvc-Komplex-type.2.4.a: ': Bohne Bohnen'

Tomcat zeigt mir über Fehler

Meine feder servlet.xml unten gegeben. Ich benutze .3.11.RELEASE Version von Springframework.

<?xml version="1.0" encoding="UTF-8"?> 
<beans:bean xmlns="http://www.springframework.org/schema/mvc" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:context="http://www.springframework.org/schema/context" 
      xmlns:beans="http://www.springframework.org/schema/beans" 
      xsi:schemaLocation=" 
       http://www.springframework.org/schema/mvc 
       http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd 
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-4.3.xsd 
       http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"> 

    <context:component-scan base-package="in.project.*" /> 


    <annotation-driven/> 

    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     <beans:property name="prefix" value="/views/"/> 
     <beans:property name="suffix" value=".jsp"/> 
    </beans:bean> 

</beans:bean> 

Antwort

2

die Root-Entität des Kontextes XML-Anwendung ist <beans>, nicht <bean>. So könnten Sie sich mit

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns="http://www.springframework.org/schema/mvc" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"> 
... 
</beans:beans> 

Haben am Ende ist, sollte nicht getestet, aber funktionieren. Ich hoffe, das hilft.

Verwandte Themen