从ServletContext资源解析XML文档时出现意外异常[/WEB-INF/config/spring-config.xml]

时间:2017-02-15 14:44:35

标签: spring javabeans

  

严重:上下文初始化失败   org.springframework.beans.factory.BeanDefinitionStoreException:   从ServletContext解析XML文档时出现意外异常   资源[/WEB-INF/config/spring-config.xml]

<?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"
    xsi:schemaLocation="http://www.springframework.org/schema/beans  
                                     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
                                     http://www.springframework.org/schema/web-services  
                                     http://www.springframework.org/schema/web-services/web-services-2.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.blog.samples.services" />
    <sws:annotation-driven />
    <!-- Our test service bean -->
    <bean id="AccountDetailsService"
        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/AccountDetailsServiceOperations.xsd</value>
                    </list>
                </property>
            </bean>
        </property>
        <property name="portTypeName" value="AccountDetailsService" />
        <property name="serviceName" value="AccountDetailsServices" />
        <property name="locationUri" value="/endpoints" />
    </bean>

</beans>

1 个答案:

答案 0 :(得分:0)

确保您的类路径中有这些依赖项(更改为正确的版本):

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>version</version>
</dependency>


<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>version</version>
</dependency>

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws</artifactId>
    <version>version</version>
</dependency>