does lazy loading OneToMany Relationship fails RequestFactory proxies?

212 views
Skip to first unread message

Elhanan

unread,
Dec 31, 2011, 3:08:50 PM12/31/11
to google-we...@googlegroups.com
hi..
i'm trying use an entity employee which has JobHistory entities related to it..i should add that although jobHistory is considered an entity, it has an embeddedId which is a dervied from manytoOne relationships. 

anyway i tried using eager loading, but it still doesn't work. i get this:
com.google.web.bindery.requestfactory.server.UnexpectedException: The domain type com.hr.model.impl.JobHistory cannot be sent to the client
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:216)
at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveClientType(ResolverServiceLayer.java:91)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveClientType(ServiceLayerDecorator.java:142)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveClientType(ServiceLayerDecorator.java:142)
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveClientType(ServiceLayerDecorator.java:142)
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.web.bindery.requestfactory.server.ServiceLayerCache.getOrCache(ServiceLayerCache.java:233)
at com.google.web.bindery.requestfactory.server.ServiceLayerCache.resolveClientType(ServiceLayerCache.java:163)
at com.google.web.bindery.requestfactory.server.Resolver.resolveClientValue(Resolver.java:586)
at com.google.web.bindery.requestfactory.server.Resolver.resolveClientValue(Resolver.java:618)
at com.google.web.bindery.requestfactory.server.Resolver.access$400(Resolver.java:50)
at com.google.web.bindery.requestfactory.server.Resolver$PropertyResolver.visitReferenceProperty(Resolver.java:139)
at com.google.web.bindery.autobean.shared.AutoBeanVisitor.visitCollectionProperty(AutoBeanVisitor.java:229)
at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.traverseProperties(ProxyAutoBean.java:300)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.traverse(AbstractAutoBean.java:166)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.accept(AbstractAutoBean.java:101)
at com.google.web.bindery.requestfactory.server.Resolver.resolveClientValue(Resolver.java:395)
at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.processInvocationMessages(SimpleRequestProcessor.java:483)
at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:225)
at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:127)
at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

Thomas Broyer

unread,
Dec 31, 2011, 6:56:16 PM12/31/11
to google-we...@googlegroups.com


On Saturday, December 31, 2011 9:08:50 PM UTC+1, Elhanan wrote:
hi..
i'm trying use an entity employee which has JobHistory entities related to it..i should add that although jobHistory is considered an entity, it has an embeddedId which is a dervied from manytoOne relationships. 

anyway i tried using eager loading, but it still doesn't work. i get this:
com.google.web.bindery.requestfactory.server.UnexpectedException: The domain type com.hr.model.impl.JobHistory cannot be sent to the client
at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:216)
at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveClientType(ResolverServiceLayer.java:91)

Nothing to do with lazy-loading here: RF cannot find a proxy type for the domain class JobHistory (that matches the one declared as the employee proxy getter return type). It can be an issue with the ValidationTool, or with your code (mismatch between ProxyFor and your proxies and domain classes).

Elhanan Maayan

unread,
Jan 1, 2012, 12:56:40 AM1/1/12
to google-we...@googlegroups.com
ok, they really REALLY need to fix that thing, i changed the directory of .apt_generated to .apt_gen and got an exception on the serve side (some stupid bug in eclipse link which doesn't make it compatible with jpa), i dunno if this was the original problem, but after fixing it still get the original error.

--
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/-/1x-CiiWd-TEJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Elhanan Maayan

unread,
Jan 1, 2012, 12:59:29 AM1/1/12
to google-we...@googlegroups.com
check that, actually i a slightly different error only difference is instead of JobHistory, i get JobHistoryPk can't be sent to the client.
Reply all
Reply to author
Forward
0 new messages