Reputation: 89
I have created the project using WSO2 Developer Studio.
Under src/main/java
I created the package samples.mediators
In that package the class 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;
}
}
To deploy the code an followed this instructions:
Right click on the project and select Export Project as Deployable Archive.
It created the jar file named Unzip.jar
I deployed the Jar file in to <ESB_HOME>/repository/components/lib
directory.
In the synapse configuration I call the class like this
<class name="samples.mediators.UnzipFileMediator"></class>
but when i try to save it.It generate the below error:
org.apache.axis2.AxisFault: Class samples.mediators.UnzipFileMediator not found in the path
What am I doing wrong here?
Upvotes: 3
Views: 1628
Reputation: 4749
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
.
Upvotes: 4