问题描述:
项目(使用jdk1.8)中有个方法用到了
PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz);
但是编译
mvn clean install -Dmaven.test.skip=true
总是失败,报错信息如下:
cannot access com.sun.beans.introspect. PropertyInfo [ERROR] class file for com.sun.beans.introspect.PropertyInfo not found
百思不得解。
解法:
PropertyDescriptor pd = new PropertyDescriptor((String)field.getName(), clazz);
解法链接为:https://github.com/vaadin/framework/issues/10737
为什么?--留给以后的自己解答,现在水平不够。卒
猜测:1,可能是jdk1.8的问题,升级到1.9就ok? 2,可能是null 和 (String)null的区别??