JavaSpring中的Getter和Setter问题
所以,我有一个豆子:JavaSpring中的Getter和Setter问题,java,spring,spring-mvc,Java,Spring,Spring Mvc,所以,我有一个豆子: <bean id="toMailController" class="com.appointments.kohler.controller.ToEmailController"> <property name="templateTransformer" ref="templateTransformer"></property> </bean> 如果我从Localhost执行此项目,它运行得很好,但当我将其放入webl
<bean id="toMailController" class="com.appointments.kohler.controller.ToEmailController">
<property name="templateTransformer" ref="templateTransformer"></property>
</bean>
如果我从Localhost执行此项目,它运行得很好,但当我将其放入weblogic时,我收到以下错误:
org.springframework.beans.NotWritablePropertyException: Invalid property 'templateTransformer' of bean class [com.appointments.kohler.controller.ToEmailController]: Bean property 'templateTransformer' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
但是我不能得到它。我做错了什么?有什么想法吗?在数千小时后,我尝试使用ANT部署该项目,它成功了,之后BEA WebLogic界面不再给我错误信息
谢谢你的回答 在类变量中使用下划线没有任何作用吗?您的配置中是否有应用@Required注释所必需的下划线?我也讨厌财产名称中的下划线。@MartinV.,是的。实际上,我在这个类中使用了@Required的许多其他属性,但都是字符串。这是唯一的“TemplateTransformer”对象。@MikeB事实上我在同一个类中有其他带下划线的属性,它可以工作。
--请更新您的帖子,并包括TemplateTransformer
的bean定义。
org.springframework.beans.NotWritablePropertyException: Invalid property 'templateTransformer' of bean class [com.appointments.kohler.controller.ToEmailController]: Bean property 'templateTransformer' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?