webservices中遇到的问题

在使用CXF生成的客户端调用WebService时遇到了NoClassDefFoundError,具体为找不到DescriptionFactory类。该类位于axis2-metadata包中。解决方案是下载并引入该依赖包到项目的lib目录下,可以从Maven仓库获取版本为1.5.6的axis2-metadata包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

webservices中遇到的问题
1.cxf生成客户端调用webservices报如下错:
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/axis2/jaxws/description/DescriptionFactory
at org.apache.axis2.jaxws.spi.ServiceDelegate.(ServiceDelegate.java:212)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:59)
at javax.xml.ws.Service.(Unknown Source)
at com.pcitc.project.hengyi.webservices.materialsType.client.MaterialsTypeService_Service.(MaterialsTypeService_Service.java:47)
at com.pcitc.project.hengyi.webservices.materialsType.client.TestMaterialsType.main(TestMaterialsType.java:5)
Caused by: java.lang.ClassNotFoundException: org.apache.axis2.jaxws.description.DescriptionFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader 1. r u n ( U n k n o w n S o u r c e ) a t j a v a . s e c u r i t y . A c c e s s C o n t r o l l e r . d o P r i v i l e g e d ( N a t i v e M e t h o d ) a t j a v a . n e t . U R L C l a s s L o a d e r . f i n d C l a s s ( U n k n o w n S o u r c e ) a t j a v a . l a n g . C l a s s L o a d e r . l o a d C l a s s ( U n k n o w n S o u r c e ) a t s u n . m i s c . L a u n c h e r 1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher 1.run(UnknownSource)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.net.URLClassLoader.findClass(UnknownSource)atjava.lang.ClassLoader.loadClass(UnknownSource)atsun.misc.LauncherAppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 5 more
原因:找不到这个类DescriptionFactory,这个类在axis2-metadata包里,下载这个包并放到lib下面
下载包的路径,maven:
https://mvnrepository.com/artifact/org.apache.axis2/axis2-metadata/1.5.6
maven截图在这插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值