No type for token | oerten25 | 12/11/11 5:08 PM | When i try to use a proxy class which extends ValueProxy in an rf request, i encounter UnexpectedException: No type for token ecB9B47$c3vaX2Yv_$wIVBNodOw= . The stack trace is as following : SEVERE: Unexpected error Does anyone have an idea why this exception could occur? |
Re: No type for token | Marco Asteriti | 2/18/12 11:54 AM | I have the same exact issue while expanding my test project to incorporate simple @Embedded value type. I have a simple Person entity with a few property fields (name, phone) I set up and got it to do all basic crud operations without any problems. I added an Address POJO as an additional property field embedded in my person entity. Everything works as expected up to and through firing of my RequestContext firing. Here's the Code: PersonRequest req = requestFactory.personRequest(); PersonProxy person = req.create(PersonProxy.class); AddressProxy address = req.create(AddressProxy.class); address.setStreet("Elm St.") person.setName("Joe"); person.setAddress(address); req.save(person).fire(); Once it fires, I get the error above with the same stack as shown by the original post. Apparently it doesn't like AddressProxy.class at all. If I comment out the person.setAddress() line in my code, but leave AddressProxy address = req.create(AddressProxy.class) above it, I still get the same error. Following it on the debugger the problem is here in the ResolverServiceLayer class: @Override public Class<? extends BaseProxy> resolveClass(String typeToken) { String deobfuscated = deobfuscator.getTypeFromToken(typeToken); if (deobfuscated == null) { die(null, "No type for token %s", typeToken); } What am I missing?? |
Re: No type for token | Brandon Donnelson | 2/19/12 8:30 PM | I've had that too, but I can't remember what I did. Try cleaning your project. Is the valueproxy object referenced in request context. like: http://code.google.com/p/gwt-examples/source/browse/trunk_2012/DemoGwtEditor/src/com/gonevertical/client/app/requestfactory/PeopleDataRequest.java (or for more info and demo http://c.gwt-examples.com/home/ui/places) Brandon Donnelson |
Re: No type for token | Marco Asteriti | 2/20/12 5:59 AM | Thanks Brandon, I tied cleaning and GWT compile just in case (it did work for getting request factory validation to work, once) but it didn't have the desired effect. My request context is very similar to the one you linked, the difference is I used only Request<T> for all my method invocations, not the InstanceRequest<T, T>. Here's the code bit: @ServiceName(value = "com.masteriti.manager.server.access.PersonDao", locator = "com.masteriti.manager.server.locator.DaoServiceLocator") public interface PersonRequest extends RequestContext { Request<List<PersonProxy>> listAll(); Request<Void> save(PersonProxy person); Request<PersonProxy> saveAndReturn(PersonProxy person); Request<Void> delete(PersonProxy person); } The other thing I noticed looking around demo source code is that hardly anyone uses @Embedded objects in their entities. Even the DynaTableRF source doesn't use the @Embedded notation as shown in Google's RequestFactory Tutorial, instead it simply has private Address address = new Address(); I'll try that today and see if it works, but any other suggestions would be welcome! Marco |
Re: No type for token | Thomas Broyer | 2/20/12 6:29 AM | Several things:
|
Re: No type for token | Marco Asteriti | 2/20/12 7:37 AM | On Monday, February 20, 2012 9:29:54 AM UTC-5, Thomas Broyer wrote: Several things: Thanks for the reply, Thomas. This item did the trick. Following your procedure to refresh the project took care of the "No type for token..." error. The code now runs without errors although its still not saving addresses, but at least I'll have an opportunity to debug it in my code. I've never used maven, and have been resistant to adding more new stuff on my plate, but I may have to at this point. Thanks |