javadatabasegwtmapdb

java.lang.NoClassDefFoundError: org/mapdb/DBMaker


I have problem using mapDB on GWT, i found error in this line:

File utilizzo = new File("saveme.db");

DB db;

db = DBMaker.newFileDB(utilizzo).closeOnJvmShutdown().make();

the error is in the third line and is:

nov 20, 2014 11:20:30 AM com.google.appengine.tools.development.ApiProxyLocalImpl log GRAVE: javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.sample.Doodle.client.GreetingService.greetServer(java.util.ArrayList) throws java.lang.IllegalArgumentException' threw an unexpected exception: java.lang.NoClassDefFoundError: org/mapdb/DBMaker


Solution

  • This error means that a class is not available on the server. It's not enough to add a jar to your classpath - you also need to add it to your /WEB-INF/lib folder.

    If you use Eclipse, select your project and look in the Problems tab. There may be a warning there that a particular resource will not be available on the server. Right-click on this warning and select "Copy to..." option. Or add this jar to this folder manually.