【问题标题】:InvalidPropertyException: Invalid property 'myListName[0]' of bean classInvalidPropertyException:bean 类的无效属性“myListName [0]”
【发布时间】:2017-01-23 15:47:11
【问题描述】:

在使用 Thymeleaf 运行 Spring MVC Web 应用程序并使用 Proguard 进行混淆时,我遇到了以下异常:

org.springframework.web.util.NestedServletException: 
Request processing failed; nested exception is 
org.springframework.beans.InvalidPropertyException: 
Invalid property 'listOfSomething[0]' of bean class ...

这在混淆之前运行良好,但之后会中断。

public class FormToSubmit {

    private List<MyType> listOfSomething;

    public List<MyType> getListOfSomething() {
        return listOfSomething;
    }

    public void setListOfSomething(List<MyType> listOfSomething) {
        this.listOfSomething = listOfSomething;
    }
}

在混淆过程中,我已经使用以下 proguard 行保留了所有公共属性访问器:

-keep public class com.package.name.model.** { *; }

【问题讨论】:

    标签: java spring proguard thymeleaf obfuscation


    【解决方案1】:

    原来列表的类型参数被proguard删除了。将以下行添加到 proguard 配置中解决了该问题。

    -keepattributes Signature
    

    【讨论】:

      猜你喜欢
      • 2021-12-06
      • 2019-01-26
      • 2012-01-27
      • 1970-01-01
      • 2011-04-15
      • 2011-03-02
      • 2013-12-12
      • 2015-08-10
      相关资源
      最近更新 更多