可用方法的NoSuchMethodException

时间:2013-01-22 05:36:26

标签: java jboss7.x webservice-client

我正在为我的应用程序使用Open KM应用程序框架。很奇怪看到我的代码中有时会得到NoSuchMethodException以获得可用的方法。一旦我开始得到这个异常,它就会一直重复,直到我重新启动服务器(Jboss7)。一旦重新启动,这将工作文件,直到某一点,然后再次发生此异常并继续发生。

有人可以帮忙吗?

我的例外追踪

19:34:10,725 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/CAMSWeb].[spring]] (http--192.168.1.62-8080-2) Servlet.service() for servlet spring threw exception: java.lang.NoSuchMethodException: com.openkm.ws.client.document.OKMDocument.create(java.lang.String, com.openkm.ws.client.document.Document, [B)
    at java.lang.Class.getMethod(Class.java:1622) [:1.7.0_09]
    at org.apache.cxf.jaxws.JAXWSMethodDispatcher.getImplementationMethod(JAXWSMethodDispatcher.java:109)
    at org.apache.cxf.jaxws.JAXWSMethodDispatcher.bind(JAXWSMethodDispatcher.java:55)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.bindOperation(JaxWsServiceFactoryBean.java:280)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:254)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:645)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:289)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:392)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:499)
    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
    at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
    at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:152)
    at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
    at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318)
    at javax.xml.ws.Service.getPort(Service.java:99) [jboss-jaxws-api_2.2_spec-2.0.0.Final.jar:2.0.0.Final]
    at com.openkm.ws.client.document.OKMDocument_Service.getOKMDocumentPort(OKMDocument_Service.java:72) [okm-ws-client-6.0.jar:]

我已经提出了一些其他的痕迹以了解什么是调用类和预期的方法..这些是结果

19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) Trying to fetch method ========      create from class : interface com.openkm.ws.client.document.OKMDocument
19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) Length of the method name  ======== 6
19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) The parameters for the expected method are
19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) >>>>>>>>>.... java.lang.String
19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) >>>>>>>>>....   com.openkm.ws.client.document.Document
19:34:10,719 INFO  [stdout] (http--192.168.1.62-8080-2) >>>>>>>>>.... [B

这是来自调用方法端点类

的getMethods的结果
19:34:10,721 INFO  [stdout] (http--192.168.1.62-8080-2)  Method Name :: create
19:34:10,721 INFO  [stdout] (http--192.168.1.62-8080-2) Parameters.... java.lang.String
19:34:10,721 INFO  [stdout] (http--192.168.1.62-8080-2) Parameters....  com.openkm.ws.client.document.Document
19:34:10,721 INFO  [stdout] (http--192.168.1.62-8080-2) Parameters.... [B

我们可以看到呼叫签名是

create(String, com.openkm.ws.client.document.Document, byteArray)

并且目标类也有一个具有相同签名的方法,但有时我仍然会得到这个NoSucnMethodException,并且一旦它出现,它就会一直存在,直到我重新启动服务器。

任何帮助......

1 个答案:

答案 0 :(得分:0)

com.openkm.ws.client.document.Document是一个界面。我怀疑运行时部署中缺少实现。