I have a spring config to create a client with cxf using jaxws. when I run my testcase from a main class with this code:
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:spring/client-context.xml");
return (VisitService) ctx.getBean("client");
I get this exception
org.xml.sax.SAXParseException; lineNumber: 21; columnNumber: 71; schema_reference.4: Failed to read schema document 'http://cxf.apache.org/schema/jaxws.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .
I understand the exception and found this in the documentation of cxf http://cxf.apache.org/docs/embedding-cxf-inside-spring.html
Include <import resource="classpath:META-INF/cxf/cxf.xml" />
When I include the context.xml that is described in the documentation, I just get the same error. Spring validates its schema's before it loads this xml. Wrapping the application context would probably solve my problem, but it seems a inferior solution. I know the xsd should be on my classpath, and it is, in the cxf-rt-frontend-jaxws jar.