The following error occurred when executing Maven install:
Find the error in the code:
PropertyDescriptor pd = null;
try {
pd = new PropertyDescriptor(fields[j].getName(),entity.getClass());
}catch (IntrospectionException e1) {
e1.printStackTrace();
}
Method getMethod = pd.getReadMethod();
It turns out that we are creating a propertydescriptor This is to get the get method of the entity class to read the value in the object. We find the construction method of this class
Previously, we encountered that the com.sun jar could not be loaded. For example, the previous Base64 was also under com.sun, and it could not be loaded every time it was started
How to solve: introduce this class:
import org.springframework.beans.BeanUtils;
PropertyDescriptor pd = null;
/*
* try {
* pd = new PropertyDescriptor(fields[j].getName(),entity.getClass());
* }catch (IntrospectionException e1) {
* e1.printStackTrace();
* }
*/
pd=BeanUtils.getPropertyDescriptor(entity.getClass(),fields[j].getName());
Method getMethod = pd.getReadMethod();
Hope to help you
div>