Results 1 to 4 of 4

Thread: Non-Long identifier type problem

  1. #1
    Join Date
    Dec 2008
    Posts
    4

    Default 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. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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

  3. #3
    Join Date
    Dec 2008
    Posts
    4

    Default

    Hi Stefan,

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

    Cheers,
    Sean

  4. #4
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •