java.lang.NoClassDefFoundError

0
Hello, I'm building a "CustomOData" module using the Apache Olingo library. I copied the library .jars into the userlib folder of my project and also added them to the java build path in eclipse. I have an EdmProvider class that I defined in the javasource/customodata directory (see below). package customodata; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; import org.apache.olingo.commons.api.ex.ODataException; public class EdmProvider extends CsdlAbstractEdmProvider { @Override public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) throws ODataException { CsdlEntityType entityType = null; return entityType; } } I'm getting the error below when running a java action that creates an instance of my EdmProvider class. -> Uncaught error from thread [MxRuntimeSystem-action-dispatcher-22]: org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider, shutting down for ActorSystem[MxRuntimeSystem] java.lang.NoClassDefFoundError: org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279) at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at customodata.actions.CreateEdmProvider.executeAction(CreateEdmProvider.java:29) at customodata.actions.CreateEdmProvider.executeAction(CreateEdmProvider.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.execute(InternalCore.java:496) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:168) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:172) at com.mendix.core.component.InternalCore.execute(InternalCore.java:496) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:144) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:312) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:302) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:302) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:161) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:163) at scala.util.Try$.apply(Try.scala:192) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:157) at akka.actor.Actor$class.aroundReceive(Actor.scala:502) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:153) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) at akka.actor.ActorCell.invoke(ActorCell.scala:495) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) at akka.dispatch.Mailbox.run(Mailbox.scala:224) at akka.dispatch.Mailbox.exec(Mailbox.scala:234) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.ClassNotFoundException: org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider not found by project [136] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 47 more SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder". SLF4J: Defaulting to no-operation MDCAdapter implementation. SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details. Anyone have any insight on why this is happening? All of the related topics I've found seem to have been solved by adding the .jars to the userlib directory of the project, but this isn't working.
asked
1 answers
2

I'm going to add the answer here so you can close this question.

 

After you add the jar file to your userlib, try cleaning the deployment directory and rerunning the project

answered