Spring Roo
  1. Spring Roo
  2. ROO-1027

Custom finder for many fields cause file name too long

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 1.1.0.M2
    • Component/s: DYNAMIC FINDERS
    • Labels:
      None
    • Environment:
      Windows XP, jdk 1.6 / Debian Lenny, sun jdk 1.6

      Description

      After using the command:

      roo> finder add --finderName findTerceroesByDocumentoIdentificacionLikeAndApellido1LikeAndApellido2LikeAndNombreLikeAndTipoPersona(And...)

      for creating a custom finder with MANY fields, all seems ok, but the jspx name generated is too long and causes internal error.

      1. error.log
        27 kB
        Domingo Gómez García
      2. log.roo
        2 kB
        Domingo Gómez García
      3. terceros.roo
        2 kB
        Domingo Gómez García

        Activity

        Hide
        Domingo Gómez García added a comment -

        Here is the exact code:

        finder add --finderName findTerceroesByAnagramaLikeAndApellido1LikeAndApellido2LikeAndDocumentoIdentificacionLikeAndDomiciliosAndEmail1LikeAndEmail2LikeAndFaxLikeAndFechaNacimientoBetweenAndNacionalidadLikeAndNombreLikeAndOtroDocumentoLikeAndTelefono1LikeAndTelefono2LikeAndTipoPersona
        Managed SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero.java
        Managed SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero_Roo_Finder.aj
        Managed SRC_MAIN_JAVA/com/everis/terceros/web/TerceroController_Roo_Controller.aj
        Undo manage SRC_MAIN_JAVA/com/everis/terceros/web/TerceroController_Roo_Controller.aj
        Undo manage SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero_Roo_Finder.aj
        Undo manage SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero.java
        File name too long

        This error is under Linux, i don't remember if under windows was given any error.

        Show
        Domingo Gómez García added a comment - Here is the exact code: finder add --finderName findTerceroesByAnagramaLikeAndApellido1LikeAndApellido2LikeAndDocumentoIdentificacionLikeAndDomiciliosAndEmail1LikeAndEmail2LikeAndFaxLikeAndFechaNacimientoBetweenAndNacionalidadLikeAndNombreLikeAndOtroDocumentoLikeAndTelefono1LikeAndTelefono2LikeAndTipoPersona Managed SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero.java Managed SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero_Roo_Finder.aj Managed SRC_MAIN_JAVA/com/everis/terceros/web/TerceroController_Roo_Controller.aj Undo manage SRC_MAIN_JAVA/com/everis/terceros/web/TerceroController_Roo_Controller.aj Undo manage SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero_Roo_Finder.aj Undo manage SRC_MAIN_JAVA/com/everis/terceros/domain/Tercero.java File name too long This error is under Linux, i don't remember if under windows was given any error.
        Hide
        Stefan Schmidt added a comment -

        Domingo,

        Can you please share the complete script? It will be vary hard to replicate your problem without a complete picture. Also, before running the finder add ... command can you enable development mode (by using the 'development mode' command? This should give you a stack trace which you can post here for our review.

        Also, I wonder if in your case you might be better off creating this specific query manually using the new typesafe JPA2 Query API. Roo has moved to JPA2 with the 1.1.0.M1 release which means you can now easily use that new API. Here is an article which describes this: http://www.ibm.com/developerworks/java/library/j-typesafejpa/.

        -Stefan

        Show
        Stefan Schmidt added a comment - Domingo, Can you please share the complete script? It will be vary hard to replicate your problem without a complete picture. Also, before running the finder add ... command can you enable development mode (by using the 'development mode' command? This should give you a stack trace which you can post here for our review. Also, I wonder if in your case you might be better off creating this specific query manually using the new typesafe JPA2 Query API. Roo has moved to JPA2 with the 1.1.0.M1 release which means you can now easily use that new API. Here is an article which describes this: http://www.ibm.com/developerworks/java/library/j-typesafejpa/ . -Stefan
        Hide
        Domingo Gómez García added a comment -

        script

        Show
        Domingo Gómez García added a comment - script
        Hide
        Domingo Gómez García added a comment -

        the error trace

        Show
        Domingo Gómez García added a comment - the error trace
        Hide
        Stefan Schmidt added a comment -

        Hi Domingo,

        Thanks for providing these detailed scripts and logs. Roo's MVC scaffolding will now skip the generation of JSP views for dynamic finders which have a longer name than the maximum file name length imposed by the underlying filesystem. In this case Windows XP's maximum length is 244 characters (including folder names). See http://en.wikipedia.org/wiki/Comparison_of_file_systems for more details.

        I have also documented this in the Roo documentation.

        In your case we would strongly recommend to take advantage of the new JPA2 typesafe query builder API which is better suited for your case. Another option for you is to take a look at the new Roo Solr addon which provides much more sophisticated search integration (which is probably better suited for your use case anyway). However, both approaches do not currently offer automatic view scaffolding (Solr view scaffolding is planned though).

        Show
        Stefan Schmidt added a comment - Hi Domingo, Thanks for providing these detailed scripts and logs. Roo's MVC scaffolding will now skip the generation of JSP views for dynamic finders which have a longer name than the maximum file name length imposed by the underlying filesystem. In this case Windows XP's maximum length is 244 characters (including folder names). See http://en.wikipedia.org/wiki/Comparison_of_file_systems for more details. I have also documented this in the Roo documentation. In your case we would strongly recommend to take advantage of the new JPA2 typesafe query builder API which is better suited for your case. Another option for you is to take a look at the new Roo Solr addon which provides much more sophisticated search integration (which is probably better suited for your use case anyway). However, both approaches do not currently offer automatic view scaffolding (Solr view scaffolding is planned though).
        Hide
        Stefan Schmidt added a comment -

        Fix available with commit 4bf5b065851b9549c77494e9f8febad05f3729a3.

        Show
        Stefan Schmidt added a comment - Fix available with commit 4bf5b065851b9549c77494e9f8febad05f3729a3.
        Hide
        Domingo Gómez García added a comment -

        Thanks Stefan, I finally took a fast workaround: I made 2 finders with half fields each and manually merged into one, using a shorter name for the jspx.

        Show
        Domingo Gómez García added a comment - Thanks Stefan, I finally took a fast workaround: I made 2 finders with half fields each and manually merged into one, using a shorter name for the jspx.

          People

          • Assignee:
            Stefan Schmidt
            Reporter:
            Domingo Gómez García
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.25d
              0.25d
              Remaining:
              Remaining Estimate - 0.25d
              0.25d
              Logged:
              Time Spent - Not Specified
              Not Specified