Announcement Announcement Module
Collapse
No announcement yet.
Is not writable or has an invalid setter method. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    I have found my problem. It was my constructor was missing in the subclass.

    Comment

    Working...
    X