Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've successfully deployed your custom mediator using the maven approach. Here's what I've done.</p> <p>I created the following directory structure and placed your SiriBankMediator.java in src/main/java:</p> <pre><code>. ├── pom.xml ├── src │   └── main │   └── java │   └── SiriBankMediator.java </code></pre> <p>The pom.xml file is as follows:</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.samples.mediator&lt;/groupId&gt; &lt;artifactId&gt;siribankmediator&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;repositories&gt; &lt;repository&gt; &lt;id&gt;wso2-maven2-repository&lt;/id&gt; &lt;url&gt;http://dist.wso2.org/maven2&lt;/url&gt; &lt;/repository&gt; &lt;repository&gt; &lt;id&gt;apache-Incubating-repo&lt;/id&gt; &lt;name&gt;Maven Incubating Repository&lt;/name&gt; &lt;url&gt;http://people.apache.org/repo/m2-incubating-repository&lt;/url&gt; &lt;/repository&gt; &lt;repository&gt; &lt;id&gt;apache-maven2-repo&lt;/id&gt; &lt;name&gt;Apache Maven2 Repository&lt;/name&gt; &lt;url&gt;http://repo1.maven.org/maven2/&lt;/url&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.0&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.5&lt;/source&gt; &lt;target&gt;1.5&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt; &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt; &lt;version&gt;1.4.0&lt;/version&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; &lt;instructions&gt; &lt;Bundle-SymbolicName&gt;org.test&lt;/Bundle-SymbolicName&gt; &lt;Bundle-Name&gt;org.test&lt;/Bundle-Name&gt; &lt;Export-Package&gt; org.test.mediator.*, &lt;/Export-Package&gt; &lt;Import-Package&gt; *; resolution:=optional &lt;/Import-Package&gt; &lt;Fragment-Host&gt;synapse-core&lt;/Fragment-Host&gt; &lt;/instructions&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;archive&gt; &lt;manifest&gt; &lt;mainClass&gt;fully.qualified.MainClass&lt;/mainClass&gt; &lt;/manifest&gt; &lt;/archive&gt; &lt;descriptorRefs&gt; &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt; &lt;/descriptorRefs&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.synapse&lt;/groupId&gt; &lt;artifactId&gt;synapse-core&lt;/artifactId&gt; &lt;version&gt;1.3.0.wso2v1&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>Then inside the directory containing the POM file, we do <code>mvn compile package</code>. This should build the jar file you need to put inside of <code>$ESB_HOME/repository/components/lib</code> in the folder called target. </p> <p>Finally you can load the class as org.samples.mediator.SiriBankMediator through the carbon management frontend. Don't forget to restart your ESB. Hope that helps. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload