Transition problem in useing AutoBean

230 views
Skip to first unread message

jinker jiang

unread,
Sep 13, 2011, 5:48:44 AM9/13/11
to Google Web Toolkit
Before gwt 2.3 use autoBean, import com.google.gwt.autobean.shared,
and my autobean worked.

But in 2.4, this packege is removed, so import
com.google.web.bindery.autobean.shared, but the old code not work any
more,

Any one encountered this problem, and any suggestion.
Tks!

Thomas Broyer

unread,
Sep 13, 2011, 6:25:50 AM9/13/11
to google-we...@googlegroups.com
Hard to tell without an error message.

Did you think about changing the <inherits/> in your gwt.xml too?

jinker jiang

unread,
Sep 13, 2011, 6:29:00 AM9/13/11
to Google Web Toolkit
This is usage:

BeanFactory:
public interface BeanFactory extends AutoBeanFactory {
AutoBean<IUser> user();
}

IUser:
public interface IUser extends Serializable {

public abstract Long getId();

public abstract void setId(Long id);

public abstract String getName();

public abstract void setName(String name);

}

toJson :
BeanFactory factory = GWT.<BeanFactory> create(BeanFactory.class);

IUser user = factory.user().as();
user.setId(0l);
user.setName("abc");

String userJson = AutoBeanCodex.encode(AutoBeanUtils.getAutoBean(user)).getPayload();

exception :
java.lang.NoClassDefFoundError: org/json/JSONException
    at com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(StringQuoter.java:58)
    at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(AbstractAutoBean.java:71)
    at com.conlect.test.shared.IUserAutoBean.<init>(IUserAutoBean.java:32)
    at com.conlect.test.shared.BeanFactoryImpl.user(BeanFactoryImpl.java:16)
    at com.conlect.test.client.TestAutoBean.onModuleLoad(TestAutoBean.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: null
    at com.google.gwt.dev.shell.CompilingClassLoader$MultiParentClassLoader.findClass(CompilingClassLoader.java:365)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(StringQuoter.java:58)
    at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(AbstractAutoBean.java:71)
    at com.conlect.test.shared.IUserAutoBean.<init>(IUserAutoBean.java:32)
    at com.conlect.test.shared.BeanFactoryImpl.user(BeanFactoryImpl.java:16)
    at com.conlect.test.client.TestAutoBean.onModuleLoad(TestAutoBean.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:193)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)

jinker jiang

unread,
Sep 13, 2011, 6:31:47 AM9/13/11
to Google Web Toolkit
I add this <inherits name="com.google.web.bindery.autobean.AutoBean"/> in my project gwt.xml

Mauro Bertapelle

unread,
Sep 13, 2011, 7:52:22 AM9/13/11
to Google Web Toolkit
add gwt-servlet-deps.jar to your classpath

jinker jiang

unread,
Sep 13, 2011, 9:27:38 AM9/13/11
to google-we...@googlegroups.com
Yeah, that's right, should add the gwt-serlet-deps.jar to class path.
Thank you very much!

2011/9/13 Mauro Bertapelle <mauro.be...@gmail.com>
Reply all
Reply to author
Forward
0 new messages