Bean property 'feedId' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

删除回忆录丶 提交于 2019-12-11 03:59:52

问题


Below is code Batch snippet: XML : </beans:property> -->

<beans:bean id="RDFieldSetMapper" class="in.gov.tds.batch.mapper.RDFieldSetMapper"
    autowire="byName" scope="step">
    <!-- <beans:property name="feedId" value="429717"></beans:property> -->
    <beans:property name="feedId" value="#{jobParameters[feedId]}"></beans:property>
</beans:bean>

setter method in Java Class:

recordDetail.setFeedId(new Long(feedId));

Please provide the resolution as I am getting Invalid setter method.

More Mapper detail: public class RDFieldSetMapper implements FieldSetMapper {

private Long feedId;
private int batchCounter;

@Override
public RecordDetail mapFieldSet(FieldSet fieldSet) throws BindException {
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("Record Detail Mapper:-- " + " " + fieldSet);

    RecordDetail recordDetail = new RecordDetail();

    // feedId = FeedReader.feedId;
    recordDetail.setFeedId(new Long(feedId));
    }

}


回答1:


solved the problem. Issue : setter and getter methods are not present in the mapper class.

public Long getFeedId() {
    return feedId;
}

public void setFeedId(Long feedId) {
    this.feedId = feedId;
}


来源:https://stackoverflow.com/questions/33611372/bean-property-feedid-is-not-writable-or-has-an-invalid-setter-method-does-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!