Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java SpringWebService无效命名空间处理程序问题(jaxws)_Java_Web Services_Spring_Jax Ws_Javabeans - Fatal编程技术网

Java SpringWebService无效命名空间处理程序问题(jaxws)

Java SpringWebService无效命名空间处理程序问题(jaxws),java,web-services,spring,jax-ws,javabeans,Java,Web Services,Spring,Jax Ws,Javabeans,我正在用spring构建一个web服务。我可以将项目构建并部署到tomcat,但当服务器启动时,我会遇到以下错误: 无效的NamespaceHandler类 [org.apache.cxf.jaxws.spring.NamespaceHandler] 用于命名空间 [http://cxf.apache.org/jaxws]:问题 使用处理程序类文件或依赖 阶级;嵌套异常是 java.lang.NoClassDefFoundError: org/springframework/beans/fact

我正在用spring构建一个web服务。我可以将项目构建并部署到tomcat,但当服务器启动时,我会遇到以下错误:

无效的NamespaceHandler类 [org.apache.cxf.jaxws.spring.NamespaceHandler] 用于命名空间 [http://cxf.apache.org/jaxws]:问题 使用处理程序类文件或依赖 阶级;嵌套异常是 java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerSupport

我已经在我的类路径中包含了cxf-rt-frontend-jaxws.jar

我的bean定义如下:

 <jaxws:endpoint id="helloWebservice"
  implementor="#com.xxx.impl.HelloWebserviceImpl"
  address="/hellows">
 </jaxws:endpoint>
还有我的外部罐子:

cxf-2.2.5.jar
geronimo-activation_1.1_spec-1.0.2.jar
geronimo-jaxws_2.1_spec-1.0.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
jaxb-api-2.1.jar
jaxb-impl-2.1.12.jar
neethi-2.0.4.jar
saaj-api-1.3.jar
saaj-impl-1.3.2.jar
stax-api-1.0.1.jar
wsdl4j-1.6.2.jar
wss4j-1.5.8.jar
wstx-asl-3.2.9.jar
xml-resolver-1.2.jar
XmlSchema-1.4.5.jar
xmlsec-1.4.3.jar
WEB-INF/lib/cxf-rt-frontend-jaxws.jar

您可能缺少一个springjar,或者您有一个旧版本的springjar。尝试在类路径上获取最新的
springbeans.jar
。还要确保类路径上没有另一个更旧的类似jar。

因此,我也偶然发现了这个错误,这真的让我很紧张。因此,没有进一步的到期日

环境:

spring-aop-5.2.9.RELEASE.jar
spring-beans-5.2.9.RELEASE.jar
spring-context-5.2.9.RELEASE.jar
spring-core-5.2.9.RELEASE.jar
spring-expression-5.2.9.RELEASE.jar
spring-jcl-5.2.9.RELEASE.jar
spring-tx-5.2.9.RELEASE.jar
spring-web-5.2.9.RELEASE.jar
Wildfly 20.0.1.1决赛

爪哇11

目标:

我只想添加cxf,以便在applicationContext.xml中使用cxf-spring描述符(特别是jaxws:endpoint),即

<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">
    <!-- one or more jaxws:endpoint POJO declarations -->
    <jaxws:endpoint id="POJOEndpoint" address="/test" implementor="com.test.myRandomPojoEndpoint">
        <jaxws:invoker>
            <bean class="org.jboss.wsf.stack.cxf.InvokerJSE"/>
        </jaxws:invoker>
    </jaxws:endpoint>
</beans>
安装路径如下所示

wildfly-20.0.1.Final\modules\system\layers\base\org\springframework\spring\main

只需将spring库放在这个路径中,并添加module.txt(与spring库相同的文件夹),如下所示

module.txt

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<module name="org.springframework.spring" xmlns="urn:jboss:module:1.6">

    <resources>
        <resource-root path="spring-aop-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-beans-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-context-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-core-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-expression-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-jcl-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-tx-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-web-5.2.9.RELEASE.jar"/>
    </resources>
    <dependencies>
        <module name="org.reactivestreams" />
            <module name="org.apache.commons.logging" />
            <module name="javaee.api"/>
            <module name="javax.api" export="true" />
            <module name="javax.servlet.api" />
            <module name="org.jboss.vfs" />
    </dependencies>
</module>

希望它能帮助其他迷失的灵魂。

我有com.springframework.beans-3.0.3.RELEASE.jar就是你所说的那一个。.我已经下载并替换了beans.jar,但错误仍然是一样的。还有其他想法吗?@dds然后检查是否有另一个这样的罐子,那是旧的。更好-给出lib的目录结构folder@Bozho我没有看到任何复制品。我已编辑我的问题以显示我的库文件夹。你能看到什么错误吗?实际上,它是添加到我的类路径中的外部jar,我给出的第一个列表是WEB-INF/lib文件夹。现在我添加了外部JAR..嗨,dds,你能解决这个问题吗?我对JBoss5.1、Spring3.0.3和嵌入webapp的Mule也有同样的问题-Omhi,是的,我克服了这个错误,但不幸的是我忘记了怎么做:(通过添加到beans.xml?
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<module name="org.springframework.spring" xmlns="urn:jboss:module:1.6">

    <resources>
        <resource-root path="spring-aop-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-beans-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-context-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-core-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-expression-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-jcl-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-tx-5.2.9.RELEASE.jar"/>
        <resource-root path="spring-web-5.2.9.RELEASE.jar"/>
    </resources>
    <dependencies>
        <module name="org.reactivestreams" />
            <module name="org.apache.commons.logging" />
            <module name="javaee.api"/>
            <module name="javax.api" export="true" />
            <module name="javax.servlet.api" />
            <module name="org.jboss.vfs" />
    </dependencies>
</module>
    <module name="org.springframework.spring" optional="true">
        <imports>
            <include path="META-INF"/>
        </imports>
    </module>
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.springframework.spring">
                <imports>
                    <include path="META-INF"/>
                </imports>
                <exports>
                    <include path="META-INF"/>
                </exports>
            </module>
            <module name="org.apache.cxf">
                <imports>
                    <include path="META-INF/cxf"/>
                    <include path="META-INF"/>
                </imports>
                <exports>
                    <include path="META-INF/cxf"/>
                    <include path="META-INF"/>
                </exports>
            </module>
            <module name="org.apache.cxf.impl">
                <imports>
                    <include path="META-INF/cxf"/>
                    <include path="META-INF"/>
                </imports>
                <exports>
                    <include path="META-INF/cxf"/>
                    <include path="META-INF"/>
                </exports>
            </module>
        </dependencies>
    </deployment>
</jboss-deployment-structure>
https://stackoverflow.com/questions/44033999/jboss-eap-7-exclude-webservices-subsystem-gives-noclassdeffounderror-failed-to

http://www.mastertheboss.com/javaee/jboss-web-services/using-spring-cxf-descriptors-in-wildfly

http://www.mastertheboss.com/javaee/jboss-web-services/using-spring-cxf-descriptors-in-wildfly

https://cxf.apache.org/docs/embedding-cxf-inside-spring.html