简体   繁体   English

java.lang.NoClassDefFoundError:org / mapdb / DBMaker

[英]java.lang.NoClassDefFoundError: org/mapdb/DBMaker

I have problem using mapDB on GWT, i found error in this line: 我在GWT上使用mapDB时遇到问题,我在此行中发现错误:

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 2014年11月20日,上午11:20:30 com.google.appengine.tools.development.ApiProxyLocalImpl日志GRAVE:javax.servlet.ServletContext日志:调度传入的RPC调用com.google.gwt.user.server.rpc.UnexpectedException时发生异常:服务方法“公共抽象java.lang.String com.sample.Doodle.client.GreetingService.greetServer(java.util.ArrayList)抛出java.lang.IllegalArgumentException”引发了意外的异常:java.lang.NoClassDefFoundError:org / mapdb / DBMaker

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. 仅将jar添加到类路径中是不够的-您还需要将其添加到/WEB-INF/lib文件夹中。

If you use Eclipse, select your project and look in the Problems tab. 如果使用Eclipse,请选择您的项目,然后在“问题”选项卡中查找。 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. 或手动将此jar添加到此文件夹。

I had the same error when I changed an object that was already persisted. 当我更改一个已经存在的对象时,我遇到了同样的错误。 When DBMaker tried to make the existing database it tries to map the persisted objects to existing classes in the classpath. 当DBMaker尝试建立现有数据库时,它将尝试将持久对象映射到类路径中的现有类。 If the class has changed signature - ie, name or package - it cannot be mapped to the persisted object, hence the ClassNotFoundException. 如果类更改了签名(即名称或包),则无法将其映射到持久对象,因此将ClassNotFoundException映射到持久对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoClassDefFoundError:org / hibernate / MappingException - java.lang.NoClassDefFoundError: org/hibernate/MappingException java.lang.NoClassDefFoundError:org / lwjgl / LWJGLException - java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException java.lang.NoClassDefFoundError:org / jnetpcap / Pcap - java.lang.NoClassDefFoundError: org/jnetpcap/Pcap java.lang.NoClassDefFoundError: org/hamcrest/Matchers - java.lang.NoClassDefFoundError: org/hamcrest/Matchers java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing - java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing java.lang.NoClassDefFoundError: org/quartz/SchedulerFactory - java.lang.NoClassDefFoundError: org/quartz/SchedulerFactory java.lang.NoClassDefFoundError:org / apache / commons / lang / text / StrLookup - java.lang.NoClassDefFoundError: org/apache/commons/lang/text/StrLookup java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder - java.lang.NoClassDefFoundError: org/apache/commons/lang/builder/CompareToBuilder java.lang.NoClassDefFoundError:org.apache.commons.lang3.ArrayUtils - java.lang.NoClassDefFoundError: org.apache.commons.lang3.ArrayUtils jython java.lang.NoClassDefFoundError:java.lang.NoClassDefFoundError:org / json / simple / JSONObject - jython java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/json/simple/ JSONObject
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM