I have a java project that uses an external custom jar generated by me, I've imported my jar in my build.gradle as:
repositories {
mavenCentral()
flatDir { dirs './src/dist/lib' } }
dependencies {
implementation name: 'PaymentServer-Lite'
compile group: 'org.jpos', name:'jpos', version:'1.9.2'
compile group: 'org.jpos.ee', name: 'jposee-server-simulator', version: '2.0.2-SNAPSHOT'
compile ('org.jpos:jpos:2.1.2') {
exclude(module: 'junit')
exclude(module: 'hamcrest-core')
}
testCompile 'junit:junit:4.8.2' }
My class imported another class from my jar called Loader and it looks something like this:
import com.recharge.mongo.Loader.Loader;
public class PaymentQ2 extends org.jpos.q2.iso.QServer {
Loader loader;
public PaymentQ2(){
loader = Loader.getInstance();
}
}
My problem is that when I run my app, with run gradle I receive the following error:
<exception name="Error thrown in the MBean's constructor">
javax.management.RuntimeErrorException: Error thrown in the MBean's constructor
at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:330)
at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:620)
at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(MBeanInstantiator.java:527)
at com.sun.jmx.mbeanserver.JmxMBeanServer.instantiate(JmxMBeanServer.java:990)
at org.jpos.q2.QFactory.instantiate(QFactory.java:78)
at org.jpos.q2.Q2.deploy(Q2.java:578)
at org.jpos.q2.Q2.deploy(Q2.java:391)
at org.jpos.q2.Q2.run(Q2.java:259)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: com/recharge/mongo/Loader/Loader
I don't know if this is a problem of my dependencies or is a problem caused by my jar