I am trying to bind already functional JAXWS web service deployed on IBM WAS Liberty 8.5.5.4 using JDK 1.7 but getting following error when binding the service as per applicationContext.xml. It is a simple web application with nothing other than web service, spring version is 4.1.0
schema_reference.4: Failed to read schema document 'http://jax-ws.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>
.[ERROR ] Context initialization failed Line 30 in XML document from ServletContext resource [/META-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 30; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'.
[ERROR ] SRVE0283E: Exception caught while initializing context: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 30 in XML document from ServletContext resource [/META-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 30; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
Caused by: org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 30; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
I searched existing issues and found same exception in an issue active a year ago old issue link . As per the solution I have
- jaxws-rt.jar version 2.2.7 in the classpath - the applicationContext.xml does find it and resolves the binding tag at compile time but gives problem at runtime
- I have updated the xsd location as mentioned in the issue and also verified that xsd does exist at http://jax-ws.java.net/spring/servlet.xsd
Below is applicationContext.xml contents
<?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-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.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">
<bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="cache" value="false" />
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
<bean id="mathService" class="com.adp.sbs.jaxws.service.MathServiceImpl" />
<wss:binding url="/math">
<wss:service>
<ws:service bean="#mathService" />
</wss:service>
</beans>
Any ideas why do I still get the exception?