Announcement Announcement Module
Collapse
No announcement yet.
Non-Long identifier type problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Non-Long identifier type problem

    Hi,

    I've been playing around with Roo and ran into a problem when using non-Long type identifiers.

    Here is the roo script for creating the entities:

    Code:
    entity --class ~.domain.Users --identifierField username --identifierType java.lang.String
    field string --class ~.domain.Users --fieldName password --sizeMax 50 --sizeMin 6 --notNull 
    field boolean --class ~.domain.Users --fieldName enabled
    
    entity --class ~.domain.Authorities
    field reference --class ~.domain.Authorities --fieldName username --type ~.domain.Users 
    
    controller all --package ~.web

    The Users entity has a string identifier type rather than the default Long.

    When trying to create an Authority entry using the roo-generated web interface I get the following error:

    Code:
    IO Error executing tag: JSPException including path '/WEB-INF/views/authorities/create.jspx'.
    org.apache.tiles.util.TilesIOException: JSPException including path '/WEB-INF/views/authorities/create.jspx'.
    	at org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:232)
    	at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:105)
    	at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
    	at org.apache.tiles.renderer.impl.UntypedAttributeRenderer.write(UntypedAttributeRenderer.java:61)
    	at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669)
    	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:337)
    	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:234)
    	at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:211)
    	at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220)
    	at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspx_meth_tiles_005finsertAttribute_005f1(default_jspx.java:490)
    	at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspService(default_jspx.java:145)
    I managed to get it to work by editing the create.jspx file in the authorities directory and changing:

    Code:
    <form:options itemValue="id" items="${userses}"/>
    to

    Code:
    <form:options itemValue="username" items="${userses}"/>
    Obviously Roo changes this back when ever the Users.java file is changed.

    As far as I can tell the problem only occurs when using a different identifier type. I tried only it using a different identifier column name which works fine.

    Is this a known problem or am I missing something?

    Sean

  • #2
    Hi Sean,

    Which version of roo are you using? The Roo RC4 release inlcudes fixes for this issue. Can you please try out the new version and let me know if that works for you?

    Cheers,
    Stefan

    Comment


    • #3
      Hi Stefan,

      I am running Roo RC4 - 1.0.0.RC4 [rev 526].

      Cheers,
      Sean

      Comment


      • #4
        Sean,

        You were correct. I knew I fixed this bug but was not aware that it was the first bug I fixed after the release of RC4 (see here http://jira.springframework.org/browse/ROO-467). The fix will be included in the upcoming release of Roo 1.0 GA. In the meantime you can test it from Roo trunk.

        Cheers,
        Stefan

        Comment

        Working...
        X