Results 1 to 2 of 2

Thread: Is not writable or has an invalid setter method.

  1. #1
    Join Date
    Aug 2009
    Posts
    9

    Default Is not writable or has an invalid setter method.

    If I may ask, a little help would go a long way. I have looked through this issue and googled the error message and I can't find the problem.


    I am getting this error when I try to deploy to JBoss 5.0.1:

    Code:
    Error setting property values; nested exception is 
    org.springframework.beans.NotWritablePropertyException: Invalid 
    property 'qaDataSource' of bean class 
    [com.company.division.service.qa.dao.BaseMyDao]: Bean property 'qaDataSource' is not 
    writable or has an invalid setter method. Does the parameter type of the setter match 
    the return type of the getter?
    This is what I have accomplished
    1. check the bean definition and properties match.
    2. ensure the property has a setter.

    here are my definitions:

    Code:
     
    <bean id="qaDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
             <property name="jndiName" value="java:/qaDataSource" />
    </bean>
    
    <bean id="baseMyDao" class="com.company.division.service.qa.dao.BaseMyDao">
            <property name="qaDataSource"> <ref local="qaDataSource" /></property>
    </bean>
        
      	
    <bean id="myAccessImpl" 
              class="com.comapny.division.service.qa.dao.MyAccessDaoImpl" 
              parent="baseMyDao">
    </bean>


    This is my class:

    Code:
    public class BaseMyDao implements InitializingBean {
    
    
    	protected DataSource qaDataSource;
    	
    
    	public DataSource getQaDataSource() {
    		return qaDataSource;
    	}
    
    	public void setQaDataSource(DataSource qaDataSource) {
    		this.qaDataSource = qaDataSource;
    	}
    
    ...
    }
    Thank you for taking the time to read my post. Any suggestions would be greatly appreciated.

    Thanks,

    HD

  2. #2
    Join Date
    Aug 2009
    Posts
    9

    Default

    I have found my problem. It was my constructor was missing in the subclass.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •