简体   繁体   English

Java Spring中的Getter和Setter问题

[英]Getter and Setter problems in Java Spring

So, i have this bean: 所以,我有这个豆:

<bean id="toMailController" class="com.appointments.kohler.controller.ToEmailController">
    <property name="templateTransformer" ref="templateTransformer"></property>
</bean>

and in my ToEmailController.java i have this (just the important lines): 在我的ToEmailController.java中,我有这个(只是重要的行):

public ToEmailController extends AbstractController {

public TemplateTransformer _templateTransformer;

@Required
public void setTemplateTransformer(TemplateTransformer templateTransformer) 
{
    this._templateTransformer = templateTransformer;
}

public TemplateTransformer getTemplateTransformer()
{
    return this._templateTransformer;
}

}

If i execute this project from Localhost, it runs just fine, but when i put him in weblogic i receive the following error: 如果我从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?

But i can't get it. 但是我不明白。 What am i doing wrong? 我究竟做错了什么? Any ideas? 有任何想法吗?

After thousands of hours, i've tried deploy the project using ANT and it works, after that the BEA WebLogic interface do not gave me the error anymore. 数千小时后,我尝试使用ANT部署项目,并且该项目可以正常运行,之后BEA WebLogic界面不再给我错误。

Thanks for every answer! 谢谢您的回答!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM