Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-153

Delete object using openJPA

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0.0.M1, 1.0.0.M2
    • Fix Version/s: 1.0.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      Following error occurs when deleting any item from list.jsp

      Internal error

      org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public java.lang.String com.nxp.web.PrefixController.delete(java.lang.Long)]; nested exception is java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:154) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:354) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:342) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:763) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:709) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:613) at org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:558) at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:68) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:847) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:361) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?) at com.nxp.key.Prefix_Roo_Entity.ajc$interMethod$com_nxp_key_Prefix_Roo_Entity$com_nxp_key_Prefix$remove(Prefix_Roo_Entity.aj:41) at com.nxp.key.Prefix.remove(Prefix.java:1) at com.nxp.key.Prefix_Roo_Entity.ajc$interMethodDispatch1$com_nxp_key_Prefix_Roo_Entity$com_nxp_key_Prefix$remove(Prefix_Roo_Entity.aj) at com.nxp.web.PrefixController_Roo_Controller.ajc$interMethod$com_nxp_web_PrefixController_Roo_Controller$com_nxp_web_PrefixController$delete(PrefixController_Roo_Controller.aj:62) at com.nxp.web.PrefixController.delete(PrefixController.java:1) 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:585) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:626) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:150) ... 41 more Cookies: JSESSIONID=[F714DDD9FAC5F3D79A3BA7EE0C890928]

      used script:

      install jpa -database HYPERSONIC_PERSISTENT -provider OPENJPA

      add dependency -groupId javax.annotation -artifactId jsr250-api -version 1.0

      new persistent class jpa -name ~.key.Prefix -testAutomatically
      new persistent class jpa -name ~.key.Postfix -testAutomatically
      new persistent class jpa -name ~.key.ProductGroup -testAutomatically
      new persistent class jpa -name ~.key.Product -testAutomatically

      add field string -class ~.key.Prefix -fieldName code -notNull -sizeMax 3
      add field string -class ~.key.Postfix -fieldName code -notNull -sizeMax 3

      add field string -class ~.key.ProductGroup -fieldName name -notNull -sizeMax 30
      add field number -type integer -class ~.key.ProductGroup -fieldName index

      add field string -class ~.key.Product -fieldName name -notNull -sizeMax 30
      add field string -class ~.key.Product -fieldName prefix -notNull -sizeMax 3
      add field string -class ~.key.Product -fieldName postfix -notNull -sizeMax 3

      add field reference jpa -class ~.key.Prefix -fieldName productGroup -type ~.key.ProductGroup
      add field reference jpa -class ~.key.Postfix -fieldName productGroup -type ~.key.ProductGroup

      add field set jpa -class ~.key.ProductGroup -fieldName prefixes -element ~.key.Prefix -mappedBy productGroup -notNull
      add field set jpa -class ~.key.ProductGroup -fieldName postfixes -element ~.key.Postfix -mappedBy productGroup -notNull

      add field reference jpa -class ~.key.Product -fieldName productgroup -type ~.key.ProductGroup

      new integration test

      new controller automatic -name ~.web.PrefixController -formBackingObject ~.key.Prefix
      new controller automatic -name ~.web.PostfixController -formBackingObject ~.key.Postfix
      new controller automatic -name ~.web.ProductGroupController -formBackingObject ~.key.ProductGroup
      new controller automatic -name ~.web.ProductController -formBackingObject ~.key.Product

      new selenium test -controller ~.web.PrefixController
      new selenium test -controller ~.web.PostfixController
      new selenium test -controller ~.web.ProductGroupController
      new selenium test -controller ~.web.ProductController

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              balex Ben Alex
              Reporter:
              rooftop Ronald Vermeire
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: