使用springmvc时报错org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]:

使用springmvc时报错

org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]:Could not instantiate property type [com.atguigu.springmvc.crud.entities.Department] to auto-grow nested property path: java.lang.InstantiationException: com.atguigu.springmvc.crud.entities.Departmentorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)

这是因为类xxx中没有无参构造方法。因为这个原因它还会报错

org.springframework.beans.NullValueInNestedPathException: Invalid property 'department' of bean class [com.atguigu.springmvc.crud.entities.Employee]: 

 

posted @ 2018-11-23 09:27  寒潭渡鹤影  阅读(2083)  评论(0编辑  收藏  举报