2016-09-21 3 views
-2
cvc-complex-type.2.4.a: Invalid content was found starting with element 'resources'. One of '{"http://www.springframework.org/schema/beans":import, "http:// 
www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"], 
"http://www.springframework.org/schema/beans":beans}' is expected. 

Ich bekomme den obigen Fehler. Bitte helfen Sie mir .. siehe unten meine Dateien:Ungültiger Inhalt wurde gefunden, beginnend mit dem Element 'resources' Einer von '{"http://www.springframework.org/schema/beans" erwartet

<context:component-scan base-package="com.blog.samples.services" /> <sws:annotation-driven /> <resources mapping="/resources/**" location="/resources/" /> 

Antwort

1

ich die folgenden Zeilen hinzugefügt haben, und es funktioniert gut ...

<mvc:resources mapping="/resources/**" location="/resources/" /> 

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


    <context:component-scan base-package="com.blog.samples.services" /> 
    <sws:annotation-driven /> 

    <mvc:resources mapping="/resources/**" location="/resources/" /> 

    <!-- 
     test service bean 
    --> 
    <bean id="AnimalDetailsService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true"> 
     <property name="schemaCollection"> 
      <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection"> 
       <property name="inline" value="true" /> 
       <property name="xsds"> 
        <list> 
         <value>schemas/AnimalDetailsServiceOperations.xsd</value> 
        </list> 
       </property> 
      </bean> 
     </property> 
     <property name="portTypeName" value="AnimalDetailsService"/> 
     <property name="serviceName" value="AnimalDetailsServices" /> 
     <property name="locationUri" value="/endpoints"/> 
    </bean> 

</beans> 
Verwandte Themen