Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExc
2017-11-15 22:11
851 查看
运行Javaweb项目的时候出现这个问题
problem:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginMapper' defined in file [G:\2017课程设计\cherry\project_manager\out\artifacts\project_manager_war_exploded\WEB-INF\classes\spring\spring-mybatis.xml]:
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperInterface ' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperInterface ' is not writable or
has an invalid setter method. Did you mean 'mapperInterface'?
我检查了很久,添加了之前有人说的default-autowire="byName",没用,也检查了数据库的链接,发现和数据库暂时没有关系,
但是我注意到了 not writable or has an invalid setter method,我又重新检查了我的配置文件发现
不知道大家有没有发现,在mapperInterface的后面多了一个空格,之后我把那个空格去掉就可以了,希望能给大家帮助。同时也提醒大家认真检查
problem:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginMapper' defined in file [G:\2017课程设计\cherry\project_manager\out\artifacts\project_manager_war_exploded\WEB-INF\classes\spring\spring-mybatis.xml]:
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mapperInterface ' of bean class [org.mybatis.spring.mapper.MapperFactoryBean]: Bean property 'mapperInterface ' is not writable or
has an invalid setter method. Did you mean 'mapperInterface'?
我检查了很久,添加了之前有人说的default-autowire="byName",没用,也检查了数据库的链接,发现和数据库暂时没有关系,
但是我注意到了 not writable or has an invalid setter method,我又重新检查了我的配置文件发现
<bean id="loginMapper" class="org.mybatis.spring.mapper.MapperFactoryBean"> <property name="mapperInterface " value="com.electric.mappers.LoginMapper"></property> <property name="sqlSessionFactory" ref="sqlSessionFactory"></property> </bean>
不知道大家有没有发现,在mapperInterface的后面多了一个空格,之后我把那个空格去掉就可以了,希望能给大家帮助。同时也提醒大家认真检查
相关文章推荐
- Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExce
- Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExce
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- nested exception is java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add
- nested exception is org.springframework.beans.NotWritablePropertyException:
- nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1': Can
- Error creating bean with name 'userService': Injection of resource methods failed; nested exception is org.springframework.beans
- Error creating bean with name 'userService': Injection of resource methods failed; nested exception is org.springframework.beans
- nested exception is org.springframework.beans.ConversionNotSupportedException的解决方法
- org.springframework.beans.NotWritablePropertyException: Invalid property 'userDao' of bean class [co
- Caused by: org.springframework.beans.NullValueInNestedPathException: Invalid property 'xxxx'
- ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: An attempt by a client to chec
- Initialization of bean failed; nested exception is org.springframework.beans.factory.: 错误分析
- org.springframework.beans.NotWritablePropertyException: Invalid property
- Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException:
- org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.
- Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.Be
- ?--Porg.springframework.beans.MethodInvocationException: Property 'username' threw exception; nested exception is java.lang.NullPointerException
- Spring 编程式事务管理xml文件配置问题org.springframework.beans.NotWritablePropertyException: Invalid property
- HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.BeanInsta