gpt4 book ai didi

java - 进行网络服务调用时出错

转载 作者:行者123 更新时间:2023-11-30 11:37:48 26 4
gpt4 key购买 nike

我正在使用 axis2 访问其他人作为客户端公开的 Web 服务我已经为 abcStub .java(通过运行一些批处理生成的 stub java 文件)创建了一个包装器方法,并尝试在包装器 java 文件中实例化 stub 文件。但我收到以下错误:

    INFO: ERROR org.apache.struts.actions.DispatchAction  - Dispatch[/remittanceTransaction] to method 'remTransApprove' returned an exception    java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:601)    Caused by: java.lang.NoSuchMethodError: org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy;    at org.tempuri.MIRSRemittanceServicesStub.getPolicy(MIRSRemittanceServicesStub.java:3558)    at org.tempuri.MIRSRemittanceServicesStub.populateAxisService(MIRSRemittanceServicesStub.java:57)    at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:268)    at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:257)    at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:305)    INFO: g.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:297)    at com.mtmrs.webservice.MIRSRemittanceTransactionManagerImpl.getAppDeclWrapper(MIRSRemittanceTransactionManagerImpl.java:201)    at com.mtmrs.business.backoffice.impl.RemittanceTransactionManagerImpl.remTransApprove(RemittanceTransactionManagerImpl.java:1417)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at com.mtmrs.application.backoffice.action.RemittanceTransactionAction.remTransApprove(RemittanceTransactionAction.java:1409)    ... 78 more    INFO: WARN  org.apache.struts.action.RequestProcessor  - Unhandled Exception thrown: class javax.servlet.ServletException     WARNING: StandardWrapperValve[action]: PWC1406: Servlet.service() for servlet action threw exception    java.lang.NoSuchMethodError: org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy;    at org.tempuri.MIRSRemittanceServicesStub.getPolicy(MIRSRemittanceServicesStub.java:3558)    at org.tempuri.MIRSRemittanceServicesStub.populateAxisService(MIRSRemittanceServicesStub.java:57)    at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:268)

I think there must be problem with this

org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy; 

或者我可能错了。无论哪种方式,不知道如何解决。如果有人知道以前遇到过/解决过这个问题,那将会很有帮助。

我在调用以下电话时得到了这个:


public String getAppDeclWrapper(String session, String parentAgent, String mirsTxnNo, String strReason, String isApprove, String modifiedBY){
String returnString = null;<br/>
try {



<pre><code> mtmrsLogger.info("Entering into Approve Decline procedure, Starting to send Status to MIRS");
MIRSRemittanceServicesStub stub = new MIRSRemittanceServicesStub(); //Error occurs at this line

ApproveDecline approvedEcline = new ApproveDecline();
ApproveDeclineResponse approveResponse = new ApproveDeclineResponse();
approvedEcline.setCParentAgent(parentAgent);
approvedEcline.setMirsSession(session);
approvedEcline.setModifiedBy(modifiedBY);
approvedEcline.setRefNo(mirsTxnNo);
approvedEcline.setStrReason(strReason);
approvedEcline.setIsApprove(isApprove);
</code></pre>

最佳答案

我猜你的类路径上有多个版本(或无效版本)的 PolicyEngine。我认为您在 servlet 引擎中运行。尝试使用以下代码来确定此版本的存储位置并修复它:

org.apache.neethi.PolicyEngine.class.getProtectionDomain().getCodeSource().getLo‌​cation() 

关于java - 进行网络服务调用时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13907723/

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