Reputation: 2986
I'm trying to deploy a custom class mediator packed in a .car
file. The WSO2 documentation on the subject isn't very specific and there's no example available.
What I've done is:
.jar
to $CARBON_HOME/repository/components/lib/
.car
, which is then manually uploaded to the ESB using Management Console.The problem: the server fails to find the mediator's class:
[2017-01-30 18:12:37,810] WARN - SynapseXMLConfigurationFactory Proxy Service configuration: test cannot be built - Continue in fail-safe mode
org.apache.synapse.SynapseException: Error loading class : nl.my.mediators.HashMediator - Class not found
at org.apache.synapse.config.xml.ClassMediatorFactory.createSpecificMediator(ClassMediatorFactory.java:107)
at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:94)
...
The .car
file does contain the .jar
in question:
Archive: mediators-v1_1_1.1.3-SNAPSHOT.car
Length Date Time Name
--------- ---------- ----- ----
...
0 2017-01-30 18:07 ca-mediators_1.1.3-SNAPSHOT/
5399 2017-01-30 18:07 ca-mediators_1.1.3-SNAPSHOT/ca-mediators-1.1.3-SNAPSHOT.jar
257 2017-01-30 18:07 ca-mediators_1.1.3-SNAPSHOT/artifact.xml
...
But, apparently, it's not picked up by the ESB. The artifact.xml
file generated by the maven-car-plugin
(which lacks documentation completely, by the way):
<?xml version="1.0" encoding="UTF-8"?><artifact name="ca-mediators" version="1.1.3-SNAPSHOT" type="lib/library/bundle" serverRole="EnterpriseServiceBus">
<file>ca-mediators-1.1.3-SNAPSHOT.jar</file>
</artifact>
How can I make ESB pick up the classes in my JAR?
Upvotes: 2
Views: 1773
Reputation: 2986
This problem is described in WSO2 documentation on extending the ESB:
When we ship the mediator through a CAR file, the mediator is accessible only to the artifacts (sequences, proxy services, APIs) available in the same CAR file. The mediator is not available globally.
The solution is proposed on the same page further on:
I tried that and it worked out.
Upvotes: 1