Gwt -> RPC -> MongoDB (Morphia)
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at
com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at
com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
at com.mongodb.MongoOptions.reset(MongoOptions.java:47)
at com.mongodb.MongoOptions.<init>(MongoOptions.java:29)
at com.mongodb.Mongo.<init>(Mongo.java:148)
at com.mongodb.Mongo.<init>(Mongo.java:113)
at
myapp.database.MyCodeImpl.getDataSource(MyCodeImpl.java:42)
at
MyCodeImpl.getDataSource():
public Datastore getDataSource() {
try {
Morphia morphia = new Morphia();
Mongo db = new Mongo("localhost");
return morphia.createDatastore(db, getDatabaseName());
} catch (UnknownHostException e) {
e.printStackTrace();
throw new DatabaseException();
}
}
第 42 行:Mongo db = new Mongo("localhost");
没有 GWT 可以正常工作。为什么不能与 GWT 一起使用?com.mongodb.DbDecoder 看起来有问题......有什么建议吗?