求助,CXF整合Spring时配置文件的问题

gloomybima 2011-05-27 04:37:33
服务发布文件如下
<?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">

<!--导入与CXF框架有关的xml-->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

<!--WebService接口-->
<jaxws:endpoint id="service"
implementor="com.itdcl.service.ServiceImpl" address="/Service">

</jaxws:endpoint>
</beans>


在<jaxws:endpoint id="service"
implementor="com.itdcl.service.ServiceImpl" address="/Service">

</jaxws:endpoint>
处报错:
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 'jaxws:endpoint'.
- 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>.


好像是读不到 http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
不知是否有人遇到过同样的问题,求助。
...全文
1522 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
glamorous720 2011-08-29
  • 打赏
  • 举报
回复
楼主问题怎么解决的啊 我也遇到这个错误了
立行独见 2011-06-14
  • 打赏
  • 举报
回复
楼主问题解决的话,不要忘了射分。
立行独见 2011-06-14
  • 打赏
  • 举报
回复
3.第二步执行过就没错误了,我是又将原来的替换过来了,重新编译并且不报错了。

分析可能是cxf版本冲突造成的。
立行独见 2011-06-14
  • 打赏
  • 举报
回复
我也有同样的问题,刚解决
1.将cxf-2.3.3.jar包替换成cxf-2.2.6.jar
2.重新编译工程,如果不行的话,将xml的开头替换成如下

<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:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
benfangdewoniu 2011-06-01
  • 打赏
  • 举报
回复
我前几天做了一个:beans.xml的配置
<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"
default-autowire="byType">

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

<import resource="spring-service.xml"/>
<import resource="spring-dao.xml"/>
<import resource="spring-action.xml"/>
<import resource="spring-quartz.xml"/>

<bean id="SearchServiceImpl" class="com.iotaad.webservice.business.SearchServiceImpl"></bean>

<jaxws:endpoint
id="searchService"
implementor="#SearchServiceImpl"
address="/SearchService" >
</jaxws:endpoint>
web.xml的配置:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/webservice/search/*</url-pattern>
</servlet-mapping>

对比一下
gloomybima 2011-06-01
  • 打赏
  • 举报
回复
从网上下载了jaxws.xsd后,在myeclipse的xml catalog里配置了 http://cxf.apache.org/schemas/jaxws.xsd
编译时就不报错了,但是在tomcat中发布时还是会报错...
Tal 2011-05-27
  • 打赏
  • 举报
回复

<?xml version="1.0" encoding="UTF-8"?>

<!-- START SNIPPET: beans -->
<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.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
liu_9764 2011-05-27
  • 打赏
  • 举报
回复
试着修改一下头<beans>节点

<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:soap="http://cxf.apache.org/bindings/soap"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd">

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧