Announcement Announcement Module
Collapse
No announcement yet.
--inheritanceType Roo GWT Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • --inheritanceType Roo GWT

    Hi

    Does Roo GWT support --inheritanceType flag?
    This works fine without using gwt setup.
    Is it planned on the road map if its not supported?


    project --topLevelPackage com.example

    persistence setup --provider HIBERNATE --database MYSQL
    database properties set --key database.password --value password
    database properties set --key database.username --value username
    database properties set --key database.url --value jdbc:mysql://localhost:3306/testinheritance


    entity --class ~.server.domain.Shape --inheritanceType TABLE_PER_CLASS
    entity --class ~.server.domain.Square --extends ~.server.domain.Shape --testAutomatically
    entity --class ~.server.domain.Circle--extends ~.server.domain.Shape --testAutomatically

    field number --fieldName area --class ~.server.domain.Shape
    field number --fieldName volumn

    gwt setup

    logging setup --level INFO

    perform eclipse



    It creates the correct domain classes with all the correct annotations
    @RooJavaBean
    @RooToString
    @RooEntity
    @Entity
    @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
    public class Shape {
    .....
    }

    When I try to save a Square, I get this exception...any help is appreciated.

    [INFO] 2010-10-19 08:09:04,656 [main] INFO org.springframework.web.servlet.handler.SimpleUrlH andlerMapping - Root mapping to handler of type [class org.springframework.web.serv
    let.mvc.ParameterizableViewController]
    [INFO] 2010-10-19 08:09:04,734 [main] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'example': initialization completed in 1047 ms
    [ERROR] Oct 19, 2010 8:12:45 AM com.google.gwt.requestfactory.server.RequestFactor yServlet doPost
    [ERROR] SEVERE: Unexpected error
    [ERROR] com.google.gwt.requestfactory.server.RequestProces singException: Unexpected exception
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.decodeAndInvokeRequest(JsonRequestProcesso r.java:242)
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.decodeAndInvokeRequest(JsonRequestProcesso r.java:62)
    [ERROR] at com.google.gwt.requestfactory.server.RequestFactor yServlet.doPost(RequestFactoryServlet.java:122)
    [ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    [ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
    [ERROR] at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487)
    [ERROR] at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1097)
    [ERROR] at org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 7)
    [ERROR] at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    [ERROR] at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1088)
    [ERROR] at org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
    [ERROR] at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    [ERROR] at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1088)
    [ERROR] at org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:113)
    [ERROR] at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    [ERROR] at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1088)
    [ERROR] at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:360)
    [ERROR] at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216)
    [ERROR] at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181)
    [ERROR] at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:729)
    [ERROR] at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:405)
    [ERROR] at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
    [ERROR] at org.mortbay.jetty.handler.RequestLogHandler.handle (RequestLogHandler.java:49)
    [ERROR] at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
    [ERROR] at org.mortbay.jetty.Server.handle(Server.java:324)
    [ERROR] at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:505)
    [ERROR] at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:843)
    [ERROR] at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:647)
    [ERROR] at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:211)
    [ERROR] at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:380)
    [ERROR] at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:395)
    [ERROR] at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:488)
    [ERROR] Caused by: java.lang.IllegalArgumentException: Unknown operation com.example.client.managed.request.SquareRequest:ersist
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.getOperation(JsonRequestProcessor.java:702 )
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.processJsonRequest(JsonRequestProcessor.ja va:844)
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.decodeAndInvokeRequest(JsonRequestProcesso r.java:232)
    [ERROR] ... 31 more



    Spring Roo supports --inheritanceType flag, but does Roo GWT or is it on the road map.

    simon

  • #2
    [ERROR] Caused by: java.lang.IllegalArgumentException: Cannot fetch unpersisted entity
    [ERROR] at com.google.gwt.requestfactory.client.impl.Abstract RequestFactory.find(AbstractRequestFactory.java:10 3)
    [ERROR] at com.example.client.managed.activity.SquareDetailsA ctivity.start(SquareDetailsActivity.java:106)
    [ERROR] at com.google.gwt.activity.shared.ActivityManager.onP laceChange(ActivityManager.java:161)
    [ERROR] at com.google.gwt.place.shared.PlaceChangeEvent.dispa tch(PlaceChangeEvent.java:57)
    [ERROR] at com.google.gwt.place.shared.PlaceChangeEvent.dispa tch(PlaceChangeEvent.java:1)
    [ERROR] at com.google.gwt.event.shared.SimpleEventBus.doFire( SimpleEventBus.java:204)
    [ERROR] at com.google.gwt.event.shared.SimpleEventBus.fireEve nt(SimpleEventBus.java:103)
    [ERROR] at com.google.gwt.place.shared.PlaceController.goTo(P laceController.java:120)
    [ERROR] at com.example.client.scaffold.place.AbstractProxyEdi tActivity.exit(AbstractProxyEditActivity.java:134)
    [ERROR] at com.example.client.scaffold.place.CreateAndEditPro xy.exit(CreateAndEditProxy.java:44)
    [ERROR] at com.example.client.scaffold.place.AbstractProxyEdi tActivity$1.onSuccess(AbstractProxyEditActivity.ja va:97)
    [ERROR] at com.example.client.scaffold.place.AbstractProxyEdi tActivity$1.onSuccess(AbstractProxyEditActivity.ja va:1)
    [ERROR] at com.google.gwt.requestfactory.client.impl.Abstract RequestContext$4.onTransportSuccess(AbstractReques tContext.java:394)
    [ERROR] at com.google.gwt.requestfactory.client.DefaultReques tTransport$1.onResponseReceived(DefaultRequestTran sport.java:140)
    [ERROR] at com.google.gwt.http.client.Request.fireOnResponseR eceived(Request.java:287)
    [ERROR] at com.google.gwt.http.client.RequestBuilder$1.onRead yStateChange(RequestBuilder.java:395)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
    [ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
    [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:157)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessagesWhileWaitingForReturn(BrowserChannelSer ver.java:326)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:207)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:126)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:562)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeO bject(ModuleSpace.java:269)
    [ERROR] at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veObject(JavaScriptHost.java:91)
    [ERROR] at com.google.gwt.core.client.impl.Impl.apply(Impl.ja va)
    [ERROR] at com.google.gwt.core.client.impl.Impl.entry0(Impl.j ava:214)
    [ERROR] at sun.reflect.GeneratedMethodAccessor51.invoke(Unkno wn Source)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(Meth odAdaptor.java:103)
    [ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(Met hodDispatch.java:71)
    [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invok e(OophmSessionHandler.java:157)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.reac tToMessages(BrowserChannelServer.java:281)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.proc essConnection(BrowserChannelServer.java:531)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run( BrowserChannelServer.java:352)
    [ERROR] at java.lang.Thread.run(Thread.java:619)
    [ERROR] Oct 19, 2010 8:25:42 AM com.google.gwt.requestfactory.server.RequestFactor yServlet doPost
    [ERROR] SEVERE: Unexpected error
    [ERROR] com.google.gwt.requestfactory.server.RequestProces singException: Unexpected exception
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.decodeAndInvokeRequest(JsonRequestProcesso r.java:238)
    [ERROR] at com.google.gwt.requestfactory.server.JsonRequestPr ocessor.decodeAndInvokeRequest(JsonRequestProcesso r.java:62)
    [ERROR] at com.google.gwt.requestfactory.server.RequestFactor yServlet.doPost(RequestFactoryServlet.java:122)
    [ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    [ERROR] at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)


    more error messages

    simon

    Comment


    • #3
      i got the same issue

      Caused by: java.lang.IllegalArgumentException: Cannot fetch unpersisted entity

      looks it is caused by inheritance of the types, but it is a very common scenario.

      Is it an known issue?

      Comment


      • #4
        It is a known GWT thing. RequestFactory doesn't currently support polymorphism.

        Comment


        • #5
          Thanks for the responses,

          Is this feature improvement on the road map current or should I open a new Roo JIRA ticket?

          simon

          Comment


          • #6
            I believe it is just a known limitation of RequestFactory and will be fixed by GWT in the release after next.

            I will see if I can find the ticket on GWT's issue tracker and post it, might be able to get some more info too.

            Comment


            • #7
              Hi Tyrrell

              I found this http://code.google.com/p/google-web-...ummary%20Stars

              It mentions 2.1 GA....do you know id "Issue 5367: Polymorphism not supported by Request Factory" made the cut for GWT 2.1 G.A?

              simon

              Comment


              • #8
                I am pretty sure it didn't make it to 2.1GA which should be released very shortly. The GWT guys will most likely get it out soon after the release.

                Entity sub-classing is an important thing, but I think it will take people a little while to digest all the changes that have landed in 2.1GA.

                Comment


                • #9
                  any workaround available

                  Is there any workaround? I think it's not acceptable to abandon OO for GWT.

                  Thanks for the reply.

                  Comment


                  • #10
                    voting up the issue

                    +1
                    I totally agree that inheritance is necessary for any practical project. I also voted up this issue:
                    http://code.google.com/p/google-web-...detail?id=5367

                    Thanks,
                    Arash

                    Comment


                    • #11
                      would love to see this fixed soon

                      simon

                      Comment

                      Working...
                      X