I try to implement a webservice in an existing standalone spring application.
I configured spring:
<?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:jaxws="http://cxf.apache.org/jaxws"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:beans/webservice.xml" />
....
webservice.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:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<bean id="CheckService" class="test.ws.CheckService">
</bean>
<jaxws:endpoint
id="checkService"
implementor="#CheckService"
address="http://localhost:9000/CheckService" />
I made the configuration according to official documentation and samples from books. I get exception:
03/11/2010 09:34:12 WARN Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.开发者_开发知识库4: Failed to read schema document 'http://cxf.apache.org/schemas/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 <xsd:schema>.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
...
http://cxf.apache.org/schemas/jaxws.xsd is accessible from browser and I think it is well formed (official xsd).
I suspect that the problem is not related to cxf rather swing configuration related.
Thanks,
Hubidubi
This means that it could not access the url when you are running it. This happens to us when we start our struts/tiles application without internet connection first. What you can do as an alternative is download the xsd and put it somewhere where you application can read it.
and replace http://cxf.apache.org/schemas/jaxws.xsd with /path/to/file/jaxws.xsd
Could it be that you're in an environment where you need to set up a proxy to access the web? You have set the proxy in you browser and can thus access the .xsd via browser.
You need to set up your IDE appropriately or set a system-wide proxy.
Hope I guessed right :p
Finally I figured out the resolution. I had to add appropirate dependencies to maven pom.xml.
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.2</version>
</dependency>
for me works w/ this.
Clearing the files from the Eclipse cache fixed this problem for me.
In Eclipse preferences, I went to General > Network Connections > Cache and removed the cxf files that were causing the issue. The error went away the next time I validated the file.
精彩评论