在路徑中找不到 WSO2ESB 自定義中介 Java 類 (WSO2ESB Custom Mediator Java Class is not found in the path)


問題描述

在路徑中找不到 WSO2ESB 自定義中介 Java 類 (WSO2ESB Custom Mediator Java Class is not found in the path)

我使用 WSO2 Developer Studio 創建了項目。在 src/main/java 我創建了包 samples.mediators 在該包中的類 UnzipFileMediator:

package samples.mediators;
import org.apache.synapse.MessageContext; 
import org.apache.synapse.mediators.AbstractMediator;

public class UnzipFileMediator extends AbstractMediator {
    public boolean mediate(MessageContext context) { 
        // TODO Implement your mediation logic here 
        System.out.println("UnzipFile Mediation entered");
        return true;
    }
}

按照以下說明部署代碼:

  1. 右鍵單擊項目並選擇將項目導出為可部署存檔。

  2. < p>它創建了名為 Unzip.jar 的 jar 文件

  3. 我將 Jar 文件部署到 /repository/components/lib 目錄.

在突觸配置中我這樣調用類

<class name="samples.mediators.UnzipFileMediator"></class>

但是當我嘗試保存它時,它會產生以下錯誤:

org.apache.axis2.AxisFault: Class samples.mediators.UnzipFileMediator not found in the path

我在這裡做錯了什麼?


參考解法

方法 1:

Use a different package name.

Because the namespace (or package) samples.mediators is already used by WSO2 in a different jar. You had deployed now a second jar with the same package name, these classes will not be found in the Classpath by WSO2.

Choose for your own classes a correct package (namespace) with your company name like com.mycompany.mediators.

(by Mohammad IrfanFiveO)

參考文件

  1. WSO2ESB Custom Mediator Java Class is not found in the path (CC BY‑SA 2.5/3.0/4.0)

#wso2-esb






相關問題

WSO2 Carbon 管理控制台異常 (WSO2 Carbon Management Console Exception)

WSO2 ESB 中介序列與代理服務 (WSO2 ESB Mediation Sequence vs Proxy Service)

帶有 XPath 擴展的 WSO2 Developer Studio (WSO2 Developer Studio with XPath extensions)

我們可以使用 wso2esb Jms 消費消息嗎 (Can we Consume the Messages using wso2esb Jms)

使用 WSO2 peoplehr 連接器時出錯 (Error using WSO2 peoplehr connector)

在路徑中找不到 WSO2ESB 自定義中介 Java 類 (WSO2ESB Custom Mediator Java Class is not found in the path)

WSO2 豐富陣列 (WSO2 Enrich array)

wso2代理服務出錯 (Error in wso2 proxy service)

如何豐富 OM 屬性中的節點值? (How to enrich a node value in OM property?)

如何發送字符串內容作為來自 WSO2 ESB 代理的響應? (How to send string content as the response from WSO2 ESB Proxy?)

wso2-esb 集群後,每個 carbon 控制台(管理和工作人員)都不工作 (wso2-esb After clustering, every carbon console(management and worker) doesn't work)

WSO2 ESB:如何處理端點返回的內部錯誤 (WSO2 ESB: How to handle internal error returned by an endpoint)







留言討論