I created a plugin on my own that uses a JSON library. The project builds, runs and tests in IntelliJ and on the console.
When I import my plugin to Anypoint Studio I'm getting this error:
ERROR 2021-06-04 06:41:34,587 [[MuleRuntime].uber.01: [p-buchzentrum].get:\delays:p-buchzentrum-config.BLOCKING @2eb68d5] [processor: p-buchzentrum-implementationSub_Flow1/processors/4; event: 23dce8c1-c4ef-11eb-96c7-00e04c682392] org.mule.runtime.core.internal.exception.OnCriticalErrorHandler:
********************************************************************************
Message : java.lang.NoClassDefFoundError: org/json/JSONObject
Element : p-buchzentrum-implementationSub_Flow1/processors/4 @ p-buchzentrum:p-buchzentrum-implementation.xml:22 (Write)
Element DSL : <bookit:write doc:name="Write" doc:id="1b4c08ce-1f90-459b-821d-78ad2a4f0f19" payload="#[payload]"></bookit:write>
Error type : MULE:FATAL_JVM_ERROR
FlowStack : at p-buchzentrum-implementationSub_Flow1(p-buchzentrum-implementationSub_Flow1/processors/4 @ p-buchzentrum:p-buchzentrum-implementation.xml:22 (Write))
at get:\delays:p-buchzentrum-config(get:\delays:p-buchzentrum-config/processors/0 @ p-buchzentrum:p-buchzentrum.xml:130 (Flow Reference))
at p-buchzentrum-main(p-buchzentrum-main/processors/0 @ p-buchzentrum:p-buchzentrum.xml:17)
(set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
ERROR 2021-06-04 06:41:34,597 [[MuleRuntime].uber.01: [p-buchzentrum].get:\delays:p-buchzentrum-config.BLOCKING @2eb68d5] [processor: p-buchzentrum-implementationSub_Flow1/processors/4; event: 23dce8c1-c4ef-11eb-96c7-00e04c682392] org.mule.runtime.core.internal.exception.OnCriticalErrorHandler:
********************************************************************************
Message : java.lang.NoClassDefFoundError: org/json/JSONObject
Element : (None)
Element DSL : (None)
Error type : MULE:FATAL_JVM_ERROR
FlowStack : (None)
Both my plugin and my Anypoint studio project contain the library:
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
My Operations class does not expose any methods that take or return any JSONObjects:
public class BookitOperations {
@MediaType(value = ANY, strict = false)
public String read(String payload) {
return FileHandler.read(payload);
}
@MediaType(value = ANY, strict = false)
public String write(String payload) {
return FileHandler.write(payload);
}
}
I tried packing the maven dependency with the assembly-plugin:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
But unpacking the plugin with:
jar xf {my-connector.jar}
Shows that this has not worked.
Any help would be appriciated!
Cheers