首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >验证vfs时出错

验证vfs时出错
EN

Stack Overflow用户
提问于 2013-08-15 05:47:17
回答 1查看 1.3K关注 0票数 0

我现在已经设置了jboss 7。然而,尝试用CXF设置JAX时,我得到了以下错误:

代码语言:javascript
复制
13:43:29,166 WARN  [org.jboss.weld.Bootstrap] WELD-001208 Warning when validating vfs:/C:/Users/mtatlong/Documents/jboss-as-7.1.1.Final/standalone/deployments/java_cxf_rest_test.war/WEB-INF/beans.xml@15 against xsd. schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.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>.
13:43:29,182 ERROR [org.jboss.msc.service.fail] MSC00001: Failed to start service jboss.deployment.unit."java_cxf_rest_test.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."java_cxf_rest_test.war".PARSE: Failed to process phase PARSE of deployment "java_cxf_rest_test.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]

我有一个beans.xml:

代码语言:javascript
复制
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:security="http://www.springframework.org/schema/security"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    <jaxrs:server id="bookservice" address="/">
        <jaxrs:serviceBeans>
            <ref bean="customerservice" />
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <bean class="demo.jaxrs.service.SecurityExceptionMapper" />
        </jaxrs:providers>
    </jaxrs:server>
    <bean id="customerservice" class="demo.jaxrs.service.CustomerServiceImpl" />


</beans>

有人能帮我吗。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-15 06:58:05

不确定,但这似乎奏效了:

代码语言:javascript
复制
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://cxf.apache.org/jaxrs
        http://cxf.apache.org/schemas/jaxrs.xsd">

可以通过添加正确的jars来修复这个问题,显然,JBoss7已经有了它自己的cxf罐子,但是我在我的应用程序中使用的jars是一个不同的版本。我刚刚匹配了jars,它起作用了,还排除了classpath/put.xml中的jetty。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18247011

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档