GWT RequestFactory throws java.lang.UnsupportedOperationException: <Proxy interface class> from ValueCodex.getTypeOrDie -


in our application need share domain code between gwt client , server. because of using common interfaces gwt proxies , server-side entities. approach once described @thomas-broyer here: https://stackoverflow.com/a/15852887/187241

exception stacktrace:

    error com.google.web.bindery.requestfactory.server.simplerequestprocessor - error while processing request      java.lang.unsupportedoperationexception: se.homework.hwbs.domain.shared.model.iappointment         @ com.google.web.bindery.autobean.shared.valuecodex.gettypeordie(valuecodex.java:388)         @ com.google.web.bindery.autobean.shared.valuecodex.decode(valuecodex.java:312)         @ com.google.web.bindery.requestfactory.shared.impl.entitycodex.decode(entitycodex.java:107)         @ com.google.web.bindery.requestfactory.server.simplerequestprocessor$3.visitreferenceproperty(simplerequestprocessor.java:633)         @ com.google.web.bindery.autobean.vm.impl.proxyautobean.traverseproperties(proxyautobean.java:370)         @ com.google.web.bindery.autobean.shared.impl.abstractautobean.traverse(abstractautobean.java:162)         @ com.google.web.bindery.autobean.shared.impl.abstractautobean.accept(abstractautobean.java:97)         @ com.google.web.bindery.requestfactory.server.simplerequestprocessor.processoperationmessages(simplerequestprocessor.java:623) 

shared code:

    public interface iappointment {         iplace getplace();     }      public interface appointmentproxy extends entityproxy, iappointment {         @override         placeproxy getplace();     }      public interface placeproxy extends entityproxy, iplace {         @override         long getid();     }      public interface iplace extends idatabaseentity {         @override         long getid();     }      public interface idatabaseentity {         public long getid();     } 

if understtod gwt code correctly, reason of problem comes proxyautobean:

    (method method : beantype.getmethods()) {         if (beanmethod.get.matches(method)) {             toreturn.getters.add(method); 

where beantype appointmentproxy.class. java reflection returns 2 methods such interface (happens in super dev mode...):

    public **abstract** placeproxy appointmentproxy.getplace()     public **default** iplace appointmentproxy.getplace() 

the first 1 expected , accepted gwt requestfactory code, second 1 not... , causes java.lang.unsupportedoperationexception: iappointment exception. weird fact have issue in compiled gwt application. when launch application ide using super dev mode, second default ... method not listed , application working without errors.

environment:

  • gwt 2.6.1
  • java version 1.8.0_66

do have ideas how fix or workaround issue?

this https://github.com/gwtproject/gwt/issues/5925 has been fixed in 2.7.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -