gpt4 book ai didi

java - CXF WebService 的 Spring 配置得到 java.lang.NoClassDefFoundError : javax/xml/ws/EndpointReference

转载 作者:搜寻专家 更新时间:2023-11-01 02:13:01 28 4
gpt4 key购买 nike

我正在尝试让 CXF 与 spring、maven on weblogic 一起工作。项目编译/构建正常,但是当我尝试部署它时出现此错误:

  <User defined listener org.springframework.web.context.ContextLoaderListener failed:    org.springframework.beans.factory.BeanCreationException: Error creating bean with name   'ibanInfos': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/ws/EndpointReference.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ibanInfos': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/ws/EndpointReference
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: javax/xml/ws/EndpointReference
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.beans.Introspector$1.run(Introspector.java:1265)
at java.security.AccessController.doPrivileged(Native Method)

知道如何解决这个问题吗?事实上,我正在使用 java 优先策略来生成 WSDL。

这是我的 Spring 文件:

  <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-servlet.xml" />
<import resource="classpath:service-definition-beans.xml"/>
<jaxws:endpoint id="ibanInfos" implementor="#ibanInfosService" address="http://localhost:7001/IbanInfos" />
</beans>

最佳答案

确保你有 jaxws-api-2.3.1.jar在你的类路径中。

可以通过上面的链接或者maven下载。

<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>

关于java - CXF WebService 的 Spring 配置得到 java.lang.NoClassDefFoundError : javax/xml/ws/EndpointReference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13644234/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com