Announcement Announcement Module
Collapse
No announcement yet.
Why am I receiving an expected message: "Web controller XXX does not appear to be... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why am I receiving an expected message: "Web controller XXX does not appear to be...

    When generating a web mvc application using JSPs, and am in the portion of the script that defines selenium tests, I am receiving the message shown in the 3rd line, below:

    ~.web roo> 4488468 Created SRC_MAIN_WEBAPP\selenium\test-keyactivities.xhtml
    ef87fa8 Updated SRC_MAIN_WEBAPP\selenium\test-suite.xhtml
    ~.web roo> Web controller 'com.lyniad.web.KeyPartnershipsController' does not appear to be an automatic, scaffolded controller

    The equivalent lines from the roo.log file are:
    selenium test --controller com.lyniad.web.KeyActivitiesController
    // [failed] selenium test --controller com.lyniad.web.KeyPartnershipsController
    // [failed] script --file D:\TRAROO\TRA024MVC4.roo

    I think that this may be a spurious message, whose main consequnce is to stop execution of the remainder of the script. I have received the same message about other controllers on different roo scripts, but have not been able to determine what roo thinks is the problem.

    The lines of the roo script that are relevant include:


    /* ====== BusinessModelAspect ====== */
    entity jpa --class com.lyniad.domain.busmodel.BusinessModelAspect --inheritanceType SINGLE_TABLE --testAutomatically
    equals --class com.lyniad.domain.busmodel.BusinessModelAspect


    /* ====== KeyPartnerships ====== */
    entity jpa --class com.lyniad.domain.busmodel.KeyPartnerships --extends com.lyniad.domain.busmodel.BusinessModelAspect --testAutomatically
    equals --class com.lyniad.domain.busmodel.KeyPartnerships --appendSuper



    I am attaching the controller and its ITDs. Any suggestions would be helpful. Is this a user error, a real bug, or a harmless quirk?

  • #2
    Here are the Key PartnershipsController attachments

    KeyPartnershipsController.java:

    package com.lyniad.web;

    import com.lyniad.domain.busmodel.KeyPartnerships;
    import org.springframework.roo.addon.web.mvc.controller.j son.RooWebJson;
    import org.springframework.roo.addon.web.mvc.controller.s caffold.RooWebScaffold;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMap ping;

    @RequestMapping("/keypartnershipses")
    @Controller
    @RooWebScaffold(path = "keypartnershipses", formBackingObject = KeyPartnerships.class)
    @RooWebJson(jsonObject = KeyPartnerships.class)
    public class KeyPartnershipsController {
    }

    KeyPartnershipsController_Roo_Controller.aj:

    // WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
    // You may push code into the target .java compilation unit if you wish to edit any member(s).

    package com.lyniad.web;

    import com.lyniad.domain.busmodel.BusinessModel;
    import com.lyniad.domain.busmodel.BusinessModelAspectItem ;
    import com.lyniad.domain.busmodel.KeyPartnerships;
    import com.lyniad.web.KeyPartnershipsController;
    import java.io.UnsupportedEncodingException;
    import javax.servlet.http.HttpServletRequest;
    import javax.validation.Valid;
    import org.joda.time.format.DateTimeFormat;
    import org.springframework.context.i18n.LocaleContextHold er;
    import org.springframework.ui.Model;
    import org.springframework.validation.BindingResult;
    import org.springframework.web.bind.annotation.PathVariab le;
    import org.springframework.web.bind.annotation.RequestMap ping;
    import org.springframework.web.bind.annotation.RequestMet hod;
    import org.springframework.web.bind.annotation.RequestPar am;
    import org.springframework.web.util.UriUtils;
    import org.springframework.web.util.WebUtils;

    privileged aspect KeyPartnershipsController_Roo_Controller {

    @RequestMapping(method = RequestMethod.POST, produces = "text/html")
    public String KeyPartnershipsController.create(@Valid KeyPartnerships keyPartnerships, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
    populateEditForm(uiModel, keyPartnerships);
    return "keypartnershipses/create";
    }
    uiModel.asMap().clear();
    keyPartnerships.persist();
    return "redirect:/keypartnershipses/" + encodeUrlPathSegment(keyPartnerships.getId().toStr ing(), httpServletRequest);
    }

    @RequestMapping(params = "form", produces = "text/html")
    public String KeyPartnershipsController.createForm(Model uiModel) {
    populateEditForm(uiModel, new KeyPartnerships());
    return "keypartnershipses/create";
    }

    @RequestMapping(value = "/{id}", produces = "text/html")
    public String KeyPartnershipsController.show(@PathVariable("id") Long id, Model uiModel) {
    addDateTimeFormatPatterns(uiModel);
    uiModel.addAttribute("keypartnerships", KeyPartnerships.findKeyPartnerships(id));
    uiModel.addAttribute("itemId", id);
    return "keypartnershipses/show";
    }

    @RequestMapping(produces = "text/html")
    public String KeyPartnershipsController.list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
    if (page != null || size != null) {
    int sizeNo = size == null ? 10 : size.intValue();
    final int firstResult = page == null ? 0 : (page.intValue() - 1) * sizeNo;
    uiModel.addAttribute("keypartnershipses", KeyPartnerships.findKeyPartnershipsEntries(firstRe sult, sizeNo));
    float nrOfPages = (float) KeyPartnerships.countKeyPartnershipses() / sizeNo;
    uiModel.addAttribute("maxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages));
    } else {
    uiModel.addAttribute("keypartnershipses", KeyPartnerships.findAllKeyPartnershipses());
    }
    addDateTimeFormatPatterns(uiModel);
    return "keypartnershipses/list";
    }

    @RequestMapping(method = RequestMethod.PUT, produces = "text/html")
    public String KeyPartnershipsController.update(@Valid KeyPartnerships keyPartnerships, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
    populateEditForm(uiModel, keyPartnerships);
    return "keypartnershipses/update";
    }
    uiModel.asMap().clear();
    keyPartnerships.merge();
    return "redirect:/keypartnershipses/" + encodeUrlPathSegment(keyPartnerships.getId().toStr ing(), httpServletRequest);
    }

    @RequestMapping(value = "/{id}", params = "form", produces = "text/html")
    public String KeyPartnershipsController.updateForm(@PathVariable ("id") Long id, Model uiModel) {
    populateEditForm(uiModel, KeyPartnerships.findKeyPartnerships(id));
    return "keypartnershipses/update";
    }

    @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
    public String KeyPartnershipsController.delete(@PathVariable("id ") Long id, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
    KeyPartnerships keyPartnerships = KeyPartnerships.findKeyPartnerships(id);
    keyPartnerships.remove();
    uiModel.asMap().clear();
    uiModel.addAttribute("page", (page == null) ? "1" : page.toString());
    uiModel.addAttribute("size", (size == null) ? "10" : size.toString());
    return "redirect:/keypartnershipses";
    }

    void KeyPartnershipsController.addDateTimeFormatPattern s(Model uiModel) {
    uiModel.addAttribute("keyPartnerships_createdate_d ate_format", DateTimeFormat.patternForStyle("M-", LocaleContextHolder.getLocale()));
    uiModel.addAttribute("keyPartnerships_lastchangedd ate_date_format", DateTimeFormat.patternForStyle("M-", LocaleContextHolder.getLocale()));
    uiModel.addAttribute("keyPartnerships_deleteddate_ date_format", DateTimeFormat.patternForStyle("M-", LocaleContextHolder.getLocale()));
    }

    void KeyPartnershipsController.populateEditForm(Model uiModel, KeyPartnerships keyPartnerships) {
    uiModel.addAttribute("keyPartnerships", keyPartnerships);
    addDateTimeFormatPatterns(uiModel);
    uiModel.addAttribute("businessmodels", BusinessModel.findAllBusinessModels());
    uiModel.addAttribute("businessmodelaspectitems", BusinessModelAspectItem.findAllBusinessModelAspect Items());
    }

    String KeyPartnershipsController.encodeUrlPathSegment(Str ing pathSegment, HttpServletRequest httpServletRequest) {
    String enc = httpServletRequest.getCharacterEncoding();
    if (enc == null) {
    enc = WebUtils.DEFAULT_CHARACTER_ENCODING;
    }
    try {
    pathSegment = UriUtils.encodePathSegment(pathSegment, enc);
    } catch (UnsupportedEncodingException uee) {}
    return pathSegment;
    }

    }

    Comment


    • #3
      KeyPartnershipsController_Roo_Controller_Json.aj:

      // WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
      // You may push code into the target .java compilation unit if you wish to edit any member(s).

      package com.lyniad.web;

      import com.lyniad.domain.busmodel.KeyPartnerships;
      import com.lyniad.web.KeyPartnershipsController;
      import java.util.List;
      import org.springframework.http.HttpHeaders;
      import org.springframework.http.HttpStatus;
      import org.springframework.http.ResponseEntity;
      import org.springframework.web.bind.annotation.PathVariab le;
      import org.springframework.web.bind.annotation.RequestBod y;
      import org.springframework.web.bind.annotation.RequestMap ping;
      import org.springframework.web.bind.annotation.RequestMet hod;
      import org.springframework.web.bind.annotation.ResponseBo dy;

      privileged aspect KeyPartnershipsController_Roo_Controller_Json {

      @RequestMapping(value = "/{id}", headers = "Accept=application/json")
      @ResponseBody
      public ResponseEntity<String> KeyPartnershipsController.showJson(@PathVariable(" id") Long id) {
      KeyPartnerships keyPartnerships = KeyPartnerships.findKeyPartnerships(id);
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json; charset=utf-8");
      if (keyPartnerships == null) {
      return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
      }
      return new ResponseEntity<String>(keyPartnerships.toJson(), headers, HttpStatus.OK);
      }

      @RequestMapping(headers = "Accept=application/json")
      @ResponseBody
      public ResponseEntity<String> KeyPartnershipsController.listJson() {
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json; charset=utf-8");
      List<KeyPartnerships> result = KeyPartnerships.findAllKeyPartnershipses();
      return new ResponseEntity<String>(KeyPartnerships.toJsonArray (result), headers, HttpStatus.OK);
      }

      @RequestMapping(method = RequestMethod.POST, headers = "Accept=application/json")
      public ResponseEntity<String> KeyPartnershipsController.createFromJson(@RequestB ody String json) {
      KeyPartnerships keyPartnerships = KeyPartnerships.fromJsonToKeyPartnerships(json);
      keyPartnerships.persist();
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json");
      return new ResponseEntity<String>(headers, HttpStatus.CREATED);
      }

      @RequestMapping(value = "/jsonArray", method = RequestMethod.POST, headers = "Accept=application/json")
      public ResponseEntity<String> KeyPartnershipsController.createFromJsonArray(@Req uestBody String json) {
      for (KeyPartnerships keyPartnerships: KeyPartnerships.fromJsonArrayToKeyPartnershipses(j son)) {
      keyPartnerships.persist();
      }
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json");
      return new ResponseEntity<String>(headers, HttpStatus.CREATED);
      }

      @RequestMapping(method = RequestMethod.PUT, headers = "Accept=application/json")
      public ResponseEntity<String> KeyPartnershipsController.updateFromJson(@RequestB ody String json) {
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json");
      KeyPartnerships keyPartnerships = KeyPartnerships.fromJsonToKeyPartnerships(json);
      if (keyPartnerships.merge() == null) {
      return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
      }
      return new ResponseEntity<String>(headers, HttpStatus.OK);
      }

      @RequestMapping(value = "/jsonArray", method = RequestMethod.PUT, headers = "Accept=application/json")
      public ResponseEntity<String> KeyPartnershipsController.updateFromJsonArray(@Req uestBody String json) {
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json");
      for (KeyPartnerships keyPartnerships: KeyPartnerships.fromJsonArrayToKeyPartnershipses(j son)) {
      if (keyPartnerships.merge() == null) {
      return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
      }
      }
      return new ResponseEntity<String>(headers, HttpStatus.OK);
      }

      @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
      public ResponseEntity<String> KeyPartnershipsController.deleteFromJson(@PathVari able("id") Long id) {
      KeyPartnerships keyPartnerships = KeyPartnerships.findKeyPartnerships(id);
      HttpHeaders headers = new HttpHeaders();
      headers.add("Content-Type", "application/json");
      if (keyPartnerships == null) {
      return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
      }
      keyPartnerships.remove();
      return new ResponseEntity<String>(headers, HttpStatus.OK);
      }

      }

      Comment

      Working...
      X