org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name
来源:互联网 发布:网络知名言情女作家 编辑:程序博客网 时间:2024/05/18 16:56
前言:
在一个JavaWeb项目中,要接入WebService时,使用CXF。启动已经成功,接口也已经成功发布,但是在调用的时候报出如下异常:
org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name {http://impl.webservice.barcode.*****.com/}TestService.at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:332)at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)at com.yealink.barcode.junit.WebServiceTest.testwebclient(WebServiceTest.java:52)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)at org.junit.runners.ParentRunner.run(ParentRunner.java:236)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
解决过程:
看报错情况,好像是项目没有查找到TestService这个方法,但是从wsdl中,可以看到,有存在这个方法。
Attach cxf2.6.0的源码进行跟踪,后来发现,cxf会在其内部用一个map来保存QName,而这个map里,有validCodeReq,但是前半部分不对,不是 {http://impl.webservice.barcode.*****.com/},而是{http://webservice.barcode.*****.com/}。原来是命名空间的问题!返回服务端代码,在服务实现类的注解
@WebService(targetNamespace = "http://webservice.barcode.*****.com/",endpointInterface = "com.*****.barcode.webservice.WebServices")这下,问题解决。
PS:从这个错误中可以看出,如若我们的webservice接口和实现类Impl放置在同一个包下,而不分包,就不会有这个错误。
阅读全文
1 0
- org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name
- CXF异常:No operation was found with the name
- cxf调用WebService时出现No operation was found with the name {http://impl.server.test.com/}helloWorld
- No operation was found with the name {http://impl.service.xq.com/}sayHi
- CXF异常 No DestinationFactory was found for the namespace http://schemas.xmlsoap.org
- org.apache.cxf.interceptor.Fault: No such operation
- cxf /webservice出错 org.apache.cxf.interceptor.Fault: No such operation: (HTTP GET PATH_INFO: /CxfDem
- APScheduler: LookupError: No trigger by the name "interval" was found
- org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the
- no row with the given identifier was found: 200
- CXF报错Error creating bean with name 'org.apache.cxf.buslifecycle.BusLifeCycleManager'
- CXF异常:Error creating bean with name 'org.apache.cxf.jaxws.EndpointImpl---86262394
- WebService报错:org.apache.cxf.interceptor.Fault: No such operation
- WebService放发布服务之后访问报错org.apache.cxf.interceptor.Fault: No such operation:
- org.apache.cxf.interceptor.Fault: The given SOAPAction ... does not match an operation
- org.apache.cxf.interceptor.Fault: The given SOAPAction ... does not match an operation
- The project was not built due to "org.apache.subversion.javahl.ClientException: Previous operation h
- Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource
- WKWebView 获取标题+进度条+常用代理方法以及native兼容处理
- 快慢指针-
- [agc003e]Sequential operations on Sequence
- 一招解决maven中的pom.xml文件报错问题 missing artifact failed to transfer等问题
- 记响应式布局vh/vw单位在安卓端微信浏览器以及UC浏览器的坑
- org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name
- 究竟是什么学问?PCB线路板导通孔必须塞孔
- VueI18n插件的简单应用于国际化
- Android 自定义UI组合控件设计方法
- 值得收藏!这是SQL数据库优化的六种方法
- Django安装指南
- zookeeper安装和使用 windows环境
- 关于滚动条的应用
- [LC解题报告]16. 3Sum Closest