Announcement Announcement Module
Collapse
No announcement yet.
Roo 1.2.Release Lexical error at line ... Encountered: "\r" (13) .... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo 1.2.Release Lexical error at line ... Encountered: "\r" (13) ....

    Roo 1.2.Release seam can't to handle utf-8 coded source file with asian language String . In particular end with \u..13
    But there is no problem with Roo 1.1.5
    Code:
        ____  ____  ____
       / __ \/ __ \/ __ \ 
      / /_/ / / / / / / /
     / _, _/ /_/ / /_/ /
    /_/ |_|\____/\____/    1.2.0.RELEASE [rev 39eb957]
    
    
    Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
    Lexical error at line 67, column 34.  Encountered: "\r" (13), after : "\"\u9422\u3126\u57db\u7f01?;"
    roo>
    Below the red line will cause roo error and don't work.how can i fix it.

    Code:
    //@Service
    public class IdentityService {
    
        @Autowired
        IdentityStore istore;
    
        @Transactional
        public void preConfig() {
            System.out.println("----------------------------------------------------");
            //初始化标识类型
            if (!IdentityType.exist(IdentityType.USER)) {
                IdentityType idType = new IdentityType(IdentityType.USER, true, "用户");
                idType.persist();
                //可选属性
                new IdentityAttributeMeta(idType, "nickName", "java.lang.String", false, true, false, null, "昵称", "", "").persist();
                new IdentityAttributeMeta(idType, "serialNumber", "java.lang.String", false, true, false, null, "编号(工号、卡号、客户ID)", "", "").persist();
    //            new IdentityAttributeMeta(idType, "certificateType", "java.lang.String", false, true, false, "身份证", "证件类型", "", "").persist();
                new IdentityAttributeMeta(idType, "certificateNo", "java.lang.String", false, true, false, "", "证件号码", "", "").persist();
                new IdentityAttributeMeta(idType, "certificateAddr", "java.lang.String", false, true, false, "", "证件地址", "", "").persist();
                new IdentityAttributeMeta(idType, "organization", "java.lang.String", false, true, false, null, "机构名称", "", "").persist();
    
                //强制属性--扩展
                new IdentityAttributeMeta(idType, "surname", "java.lang.String", true, true, false, null, "姓氏", "", "").persist();
                new IdentityAttributeMeta(idType, "trueName", "java.lang.String", true, true, false, null, "名称", "", "").persist();
                new IdentityAttributeMeta(idType, "phone", "java.lang.String", true, true, false, null, "联系电话", "****-********(****)", "").persist();
                new IdentityAttributeMeta(idType, "address", "java.lang.String", true, true, false, null, "通讯地址", "", "").persist();
                new IdentityAttributeMeta(idType, "email", "java.lang.String", true, true, false, null, "邮箱", "*@*.*", "").persist();
    
                //强制属性--只读
    //            new IdentityAttributeMeta(idType, "audited", "java.lang.Boolean", true, true, true, null, "注册已审核", "true|false", "").persist();
                new IdentityAttributeMeta(idType, "creator", "java.lang.Long", true, true, true, null, "创建人ID", "", "").persist();
                new IdentityAttributeMeta(idType, "auditor", "java.lang.Long", true, true, true, null, "审核人ID", "", "").persist();
    Last edited by bencmai; Dec 21st, 2011, 04:21 AM.

  • #2
    aha, I got same problem

    I got the same problem when I assign value with Chinese character.
    I don't know why Roo Shell care about none Roo Java files.
    Roo shell told me that there is something wrong with my personal util class even the util class has nothing to do with Roo.
    The workaround I used is translating those Chinese character to UTF8 code while assigning value.

    Code:
    String chineseText = "中文";
    -->
    Code:
    String chineseText = "\u4E2D\u6587";
    Last edited by ybak; Dec 22nd, 2011, 12:06 AM.

    Comment

    Working...
    X