简体   繁体   English

在 class Spring 中找不到设置器属性

[英]NO setter property found in class Spring

I have a spring application and deploying in external tomcat (version-8.0.0).Using STS ide for development.我有一个 spring 应用程序并部署在外部tomcat (版本 8.0.0)中。使用STS ide 进行开发。

applicationContext.xml applicationContext.xml

  <bean id="Manager" class="com.data.managers.Manager" p:hostName="${hostName}"
             p:userName="${username}"  p:pWord="${password}">
   </bean>
    

Manager Class经理 Class

public class Manager {

    private String pWord;
    

    public void setpWord(String pWord) {
        this.pWord = pWord;
    }
}

When i build the application, applicationContext file showing error当我构建应用程序时, applicationContext文件显示错误

No setter found for property 'pWord' in class com.data.managers.Manager

what was wrong here.这里出了什么问题。

Help me to solve this issue帮我解决这个问题

thanks in advance提前致谢

Getter and Setter for pWord should be getPWord() and setPWord() . pWord的 Getter 和 Setter 应该是getPWord()setPWord() The first letter after set and get should be uppercase. setget之后的第一个字母应该是大写的。

Better change the property to password and getter setter to getPassword and setPassword最好将属性更改为password并将 getter setter 更改为getPasswordsetPassword

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

相关问题 在类*中找不到属性*的二传手 - No setter found for property * in class * Spring MVC在类“ xxxx”中找不到属性“ xxxx”的设置器 - Spring MVC no setter found for property 'xxxx' in class 'xxxx' 带有Spring 3.2的eclipse kepler中的错误消息“找不到属性的设置器” - Errorneous Message “No setter found for property” in eclipse kepler with Spring 3.2 Spring XML架构出错“找不到属性&#39;oAuth2RequestValidator&#39;的setter” - Error in Spring XML schema “No setter found for property 'oAuth2RequestValidator'” spring @Autowire 属性与 setter - spring @Autowire property vs setter 用于Map异常的Spring属性设置器 - Spring property setter for Map exception 在课程的所有二传手中使用Spring @Autowired - Spring @Autowired on all setter in a class 在类&#39;org.springframework.security.provisioning.JdbcUserDetailsManager&#39;中找不到属性&#39;dataSource&#39;的设置器 - No setter found for property 'dataSource' in class 'org.springframework.security.provisioning.JdbcUserDetailsManager' 在类&#39;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&#39;中找不到属性&#39;location&#39;的设置器 - No setter found for property 'location' in class 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer' 春季:将@Autowired应用于属性以消除二传手 - Spring: apply @Autowired to property to eliminate setter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM