2013-10-07 11 views
11

Ho aggiunto spring-security-config-3.1.0.RC3 .jar nella mia cartella lib e ho ancora questo errore. Quale può essere la ragione possibile ??cvc-complex-type.2.4.c: Il carattere jolly corrispondente è rigoroso, ma non è possibile trovare alcuna dichiarazione per l'elemento 'mvc: annotation-driven' error

Ecco il mio dispatcher-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

    <context:component-scan base-package="com.tcs.rspm.controller" /> 
<mvc:annotation-driven /> 
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     <property name="prefix" value="/webpages/" /> 
     <property name="suffix" value=".jsp" /> 
    </bean> 

</beans> 

risposta

29

Hai questo:

xmlns:mvc="http://www.springframework.org/schema/mvc" 

ma non sei menzionare qui:

xsi:schemaLocation=" 
http://www.springframework.org/schema/beans  
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

Per rimediare, dovresti avere

http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 

anche lì, come

xsi:schemaLocation=" 
http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
http://www.springframework.org/schema/beans  
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

Nota: in realtà è comune che i riferimenti dello schema non menzionano la versione di primavera per consentire la più agevole l'aggiornamento, così da poter utilizzare i riferimenti come http://www.springframework.org/schema/context/spring-context.xsd pure.

Problemi correlati