javaweb-servicesspringspring-integrationjava-metro-framework

Spring metro integration cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'


I try to integrate metro web-service with spring. But I get errors in my applicationContext.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:ws="http://jax-ws.dev.java.net/spring/core"
        xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans.xsd
                            http://jax-ws.dev.java.net/spring/core 
                            http://jax-ws.dev.java.net/spring/core.xsd
                            http://jax-ws.dev.java.net/spring/servlet 
                            https://jax-ws.dev.java.net/spring/servlet.xsd">
//Some beans

//!!!!!!!!ERROR
    <wss:binding url="/ws">
        <wss:service>
            <ws:service bean="#newsWebService" />
        </wss:service>
    </wss:binding>

    <bean id="newsWebService" class="com.news.webservice.NewsWebService">
        <property name="newsBo" ref="newsBo"/>
    </bean>

</beans>

Error message:

Multiple annotations found at this line:
    - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'.
    - schema_reference.4: Failed to read schema document 'https://jax-ws.dev.java.net/spring/servlet.xsd', because 1) could 
     not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

I add lib x-bean-spring-3.7.jar and jaxws-spring-1.8.jar

Also I check spring.schemas in jaxws-spring-1.8.jar and get

# See XBEAN-60. To work around the overwriting issue, this file is maintained manually.
# this file is used by Spring to resolve resources locally.
# the key is the system ID and the value is the actual file location in this jar.
http\://jax-ws.dev.java.net/spring/core.xsd=spring-jax-ws-core.xsd
http\://jax-ws.dev.java.net/spring/servlet.xsd=spring-jax-ws-servlet.xsd
http\://jax-ws.dev.java.net/spring/local-transport.xsd=spring-jax-ws-local-transport.xsd

I included shemas according with this.

#UPDATED I found something strange. I open in spring-beans-3.2.0.M1.jar spring.shemas

http\://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd
http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd

I get applicationContext.xml without error just with http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd next pair

Please, help me find reason.


Solution

  • EDIT: The previous answer was accepted by eclipse, but triggered an exception at runtime. Here is my final working config

    Use this, the xsd schemas have been moved :

    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:ws="http://jax-ws.dev.java.net/spring/core"
           xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
    
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
                http://jax-ws.dev.java.net/spring/core http://jax-ws.java.net/spring/core.xsd
                http://jax-ws.dev.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"
           default-lazy-init="true">