Hi all,

I have one entity Device that is stored in database and Two proxies for that 
entity, one EntityProxy and one ValueProxy.

class Device {
  @Id
  private Long id;

  public Long getId();
  public Integer getVersion();

  public String getMac();
  public void setMac(String mac);
  ....
}

The entity proxy for Device entity is:

@ProxyFor(value = Device.class, locator = DeviceLocator.class)
interface DeviceProxy extends EntityProxy {
  String getMac();

  void setMac(String mac);
  ....
}

The value proxy for Device entity is:

@ProxyFor(Device.class)
public interface DeviceInfoProxy extends ValueProxy {
  String getMac();
  ....
}

I load devices from server with methods:

Request<List<DeviceProxy>> getAllDevices();
Request<DeviceInfoProxy> getDeviceWithMac(String mac);

with version GWT 2.2.0 this works just fine. 
I migrate to version GWT 2.4.0 rc1 and when I try to load devices I receive 
error:

com.google.web.bindery.requestfactory.server.UnexpectedException: Could not 
find static method with a single parameter of a key type
at 
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:216)
at 
com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.getFind(ReflectiveServiceLayer.java:253)
at 
com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.getFind(ReflectiveServiceLayer.java:271)
at 
com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.getFind(ReflectiveServiceLayer.java:271)
at 
com.google.web.bindery.requestfactory.server.ReflectiveServiceLayer.isLive(ReflectiveServiceLayer.java:200)
at 
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.isLive(ServiceLayerDecorator.java:116)
at 
com.google.web.bindery.requestfactory.server.LocatorServiceLayer.doIsLive(LocatorServiceLayer.java:186)
at 
com.google.web.bindery.requestfactory.server.LocatorServiceLayer.isLive(LocatorServiceLayer.java:85)
at 
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.isLive(ServiceLayerDecorator.java:116)
at 
com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.isLive(ServiceLayerDecorator.java:116)
at 
com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.createReturnOperations(SimpleRequestProcessor.java:270)
...............
and so on.

So from the stack trace above I understand that for some reason, 
DeviceLocator for Device entity is not used and Request Factory tries to 
find static method "findDevice" in Device object, and when that method is 
not found throw exception.

I debug and notice that in ServiceLayerCache in method getOrCache(), 
when methodMap is filled, for Device entity create Pair object with Device 
and BaseProxy, and in the map do not put any locator for Device entity.
So I add DeviceLocator to DeviceInfoProxy (that is ValueProxy).

This fixed the problem, but I do not understand what was the problem? why 
this fix the problem? and is this the right way to fix the problem?

I do not have problem with another Entity objects or proxies in my project. 
I just have this problem only for Device entity and Device entity is the 
only one entity that have Two DTO (EntityProxy/ValueProxy) objects.

Thanks,
Lazo Apostolovski

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/m4yVVnGytC0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to