配置ssh常见异常
<!--********* DAO和Service 层的 spring 文件 *********--> <context-param> <param-name>contextConfigLocation</param-name> <param-value> <!--此处记得加逗号--> /WEB-INF/spring/oa/email-cfg.xml, /WEB-INF/spring/oa/dataelement-cfg.xml </param-value> </context-param>
?3、异常:org.springframework.beans.NotWritablePropertyException: Invalid property 'dataElementDao' of bean class [com.kinth.oa.dataelement.service.impl.DataElementServiceImpl]: Bean property 'dataElementDao' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
原因是没有写setDataElementDao方法。
4、异常:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named
原因可能是(1)service没注入。(2)注入是写在某个xml中,但没有配置到web.xml中。