gpt4 book ai didi

java - 可用方法的 NoSuchMethodException

转载 作者:搜寻专家 更新时间:2023-11-01 03:54:01 24 4
gpt4 key购买 nike

我正在为我的应用程序使用 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 并且如前所述,一旦它出现,它就会一直出现,直到我重新启动服务器。

任何帮助...

最佳答案

com.openkm.ws.client.document.Document 是一个接口(interface)。我怀疑运行时部署中缺少实现。

关于java - 可用方法的 NoSuchMethodException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14452201/

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