2
我正在使用axis2
訪問其他人作爲客戶端公開的web服務,並且我爲abcStub .java(通過運行一些批處理創建的Stub java文件)製作了一個包裝方法,並試圖實例化存根包裝器java文件內的文件。但我得到以下錯誤: Web服務調用時出錯
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)
我想一定有問題,此
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;
try {
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);
我的猜測是您的類路徑中有多個版本(或無效版本)的PolicyEngine。我認爲你正在運行一個servlet引擎。嘗試下面的代碼來確定這個版本存儲和修復它的位置:org.apache.neethi.PolicyEngine.class.getProtectionDomain()。getCodeSource()。getLocation() –
@UsmanSaleem謝謝Worked :) Neethi jar的問題,有多個版本那個罐子裏。 –
但niw我面對嚴重:org.apache.axis2.AxisFault:由於內部錯誤,服務器無法處理請求。 –