Announcement Announcement Module
Collapse
No announcement yet.
Error creating bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error creating bean

    Hi,

    I am new to spring, i am getting the following error, could u plz help me on
    that.

    error::

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'businessPartnerDAOImpl' defined in ServletContext resource [/WEB-INF/BPSql.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'bussPSql' of bean class [com.ibm.pcs.dao.BusinessPartnerDAOImpl]: Bean property 'bussPSql' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    Caused by: org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'bussPSql' of bean class [com.ibm.pcs.dao.BusinessPartnerDAOImpl]: Bean property 'bussPSql' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?


    and here are the respective files.

    -------------------------------------------------------------
    BPSql.xml::
    .....

    <bean id="businessPartnerDAOImpl" class="com.ibm.pcs.dao.BusinessPartnerDAOImpl">
    <property name="bussPSql" ref="bPSql1"/>
    <property name="dataSource" ref="dataSourceDBDirect"/>
    </bean>

    <bean id="bPSql1" class="com.ibm.pcs.dao.BPSql" >
    <property name="insertBPDetailsSql">
    <value>INSERT INTO bp ( country, accid, nwusrid, passwd, email, name, telno )VALUES (?, ?, ?, ?, ?, ?, ? )</value>
    </property>
    </bean>
    ..........
    -------------------------------------------------------------
    BPSql.java::

    public class BPSql {
    private String insertBPDetailsSql=null;

    public String getInsertBPDetailsSql() {
    return insertBPDetailsSql;
    }

    public void setInsertBPDetailsSql(String insertBPDetailsSql) {
    this.insertBPDetailsSql = insertBPDetailsSql;
    }
    }
    -------------------------------------------------------------
    BusinessPartnerDAOImpl.java::
    .............
    jt.update(bussPSql.getInsertBPDetailsSql(),sqlPara meters);
    ............
    -------------------------------------------------------------

    Thanks and Regard
    satish

  • #2
    Putting code in [ code] [ /code] tags makes it easier to read. Does you BusinessPartnerDAOImpl have the correct setter?

    Code:
    public class BusinessPartnerDAOImpl
    {
        private BPSql bpsql;
    
        public void setBPSql (BPSql bpsql)
        {
            this.bpsql = bpsql;
        }
    }

    Comment


    • #3
      Hi Karldmoore,

      I have made corrections in setter, getter methods in BusinessPartnerDAOImpl and now it is working fine. thank you

      Regards
      Satish

      Comment

      Working...
      X