# RESO Commander 生成 DDL 的时候提示 getSuggestedMaxLength 错误

**URL:** <https://www.isharkfly.com/t/reso-commander-ddl-getsuggestedmaxlength/14581>\
**Category:** 程序语言\
**Tags:** java\
**Created:** [August 29, 2023, 7:46pm UTC](https://www.isharkfly.com/t/reso-commander-ddl-getsuggestedmaxlength/14581 "2023-08-29T19:46:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [August 29, 2023, 7:46pm UTC](https://www.isharkfly.com/t/reso-commander-ddl-getsuggestedmaxlength/14581/1 "2023-08-29T19:46:14Z")

</div>

错误的信息为：

```auto
C:\Users\yhu\Downloads>java -jar web-api-commander.jar --generateReferenceDDL
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "org.reso.models.ReferenceStandardField.getSuggestedMaxLength()" is null

C:\Users\yhu\Downloads>

```

![2023-08-29_15-43-58](https://www.isharkfly.com/images/transparent.png)

## 问题和解决

这个问题的解决在于源代码的错误。

原因是是我们在处理的 Excel 文件中，SugMaxLength 字段没有参数。

![2023-08-29_15-45-20](https://www.isharkfly.com/images/transparent.png)

因为这个字段没有参数，所以导致了生成 DDL 的错误。

把这个问题提交了给官方：[java -jar web-api-commander.jar --generateReferenceDDL error · Issue #165 · RESOStandards/web-api-commander · GitHub](https://github.com/RESOStandards/web-api-commander/issues/165) 看有没有一些跟进和修改。
