Autobeans work with interfaces, that only declare getter and setter methods. While you can create a concrete instance of that class, it has no AutoBean<MyModel>
representation, so you can't get the magic serialization, at least not easily.
This is not a magic DWIM serialization tool - it is a way to describe data that looks like Java objects, but is backed by whatever makes the most sense for your use case. Things that are possible with Java objects (like cycles in your objects, polymorphism, etc) are not possible with AutoBeans, they are simply not designed for it, and if anything they are designed to not be able to do this.
Check the result from AutoBeanUtils.getAutoBean
in your code above - it is probably returning null
, since there is no AutoBean
in your MyModel
instance.
See GWT AutoBean with POJO class instead of interface for another discussion around this question, and http://www.gwtproject.org/doc/latest/DevGuideAutoBeans.html for how to use autobeans correctly.