Announcement Announcement Module
Collapse
No announcement yet.
ITD not being generated by Roo for Controllers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ITD not being generated by Roo for Controllers

    I have the following controller for my Customer entity

    package com.acps.app.payments.core.web.ccti;

    import com.acps.app.payments.core.domain.customer.Custome r;
    import org.springframework.roo.addon.web.mvc.controller.R ooWebScaffold;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMap ping;

    @RequestMapping("/customers")
    @Controller
    @RooWebScaffold(path = "customers", formBackingObject = Customer.class)
    public class CustomerController {
    }

    For some reason Roo is not generating the ITD for this controller, I have attached an image of my STS since I have "Hide generated Spring Roo ITDs" unchecked in my package explorer

    It gives me an error Resource not found http://localhost:8090/core/customers?page=1&size=10 for this URL since the ITD that will handle the CRUD for customer views is missing

    I'm using Spring Snapshot build Roo 1.2.0.BUILD-SNAPSHOT [rev 280149c] due to another defect ROO-2947

    Is there a way to force the ITD to be created?
    I tried removing and re adding the annotation on CustomerController
    @RooWebScaffold(path = "customers", formBackingObject = Customer.class)

    but that did not help either, my Customer entity is annotated @RooJpaEntity
    My project backup is larger than the allowed size limit for this forum, hence I cannot attach it on here, any directions as to how to get my controller working will be very helpful, thanks for any advise you can offer

  • #2
    @RooJpaEntity alone will not create the CRUD methods required for the web controller to have its necessary methods generated. @RooJpaEntity will only create the id and version fields and the @Entity annotation

    You will need to add a Spring Data JPA repository with the 'repository jpa' command or just use @RooJpaActiveRecord instead.
    Alan

    Comment


    • #3
      I think the problem is with the Snapshot build it is missing some stuff, I created a sample project with a single entity class of 2 fields and I see weird roo behavior in STS wherein it deletes the repository as soon as the shell loads (you can see that in the attached image)

      and there are a lot of errors during the maven build
      12/8/11 9:27:06 PM EST: [ERROR] The import org.springframework.roo.addon.web.mvc.controller.s caffold cannot be resolved
      12/8/11 9:27:06 PM EST: [ERROR] RooWebScaffold cannot be resolved to a type
      12/8/11 9:27:06 PM EST: [ERROR] The import org.springframework.roo.addon.layers.repository.jp a.RooJpaRepository cannot be resolved
      12/8/11 9:27:06 PM EST: [ERROR] RooJpaRepository cannot be resolved to a type
      12/8/11 9:27:06 PM EST: [ERROR] The import org.springframework.roo.addon.web.mvc.controller.c onverter cannot be resolved
      12/8/11 9:27:06 PM EST: [ERROR] RooConversionService cannot be resolved to a type
      12/8/11 9:27:06 PM EST: [ERROR] The import org.springframework.roo.addon.jpa cannot be resolved
      12/8/11 9:27:06 PM EST: [ERROR] RooJpaEntity cannot be resolved to a type
      12/8/11 9:27:06 PM EST: [WARN] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTr anslatorAspect has not been applied [Xlint:adviceDidNotMatch]
      12/8/11 9:27:06 PM EST: [WARN] advice defined in org.springframework.scheduling.aspectj.AbstractAsy ncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
      12/8/11 9:27:06 PM EST: [WARN] advice defined in org.springframework.mock.staticmock.AnnotationDriv enStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
      12/8/11 9:27:06 PM EST: [WARN] advice defined in org.springframework.mock.staticmock.AbstractMethod MockingControl has not been applied [Xlint:adviceDidNotMatch]
      12/8/11 9:27:06 PM EST: [WARN] advice defined in org.springframework.mock.staticmock.AbstractMethod MockingControl has not been applied [Xlint:adviceDidNotMatch]
      12/8/11 9:27:07 PM EST: Build errors for sample; org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project sample: Compiler errors :
      error at return cashAccountRepository.count();

      Since I have to use the DOD fix for my project that was done for ROO-2947 What are my options to use a stable version of Roo for my project?

      I'm running out of time with evaluation of Roo and have to determine my next steps very soon so any help in this matter is greatly appreciated

      Thanks
      Ritesh

      Comment


      • #4
        The latest snapshots from http://static.springsource.org/downl...hp?project=ROO work fine.

        Comment


        • #5
          Thanks Alan,

          I will try with ROO/spring-roo-1.2.0.BUILD-SNAPSHOT_20111208.052611-ce40916.zip

          Comment


          • #6
            One Question, Do I need to install any Addon for the JPA, WEB mvc standard roo project with this snapshot build?

            Comment


            • #7
              I'm using sts-2.7.1.RELEASE on windows 7, not sure if that matters for the roo snapshot build, Do I need to move to a higher version of STS?

              Comment

              Working...
              X