Results 1 to 3 of 3

Thread: Newbie problem - NotWritablePropertyException

  1. #1

    Default Newbie problem - NotWritablePropertyException

    Hi,

    I'm encountering the following error when trying to set a property on a class which implements AfterReturningAdvice:

    junit.framework.AssertionFailedError: Exception in constructor: testSaveForm (org.springframework.beans.factory.BeanCreationExc eption: Error creating bean with name 'ldssTransactionAdvice' defined in class path resource [WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'serverTransactionManger' of bean class [com.lexmark.kiosk.dao.cyclone.LDSSTransactionAdvic e]: Property 'serverTransactionManger' is not writable
    org.springframework.beans.NotWritablePropertyExcep tion: Invalid property 'serverTransactionManger' of bean class [com.lexmark.kiosk.dao.cyclone.LDSSTransactionAdvic e]: Property 'serverTransactionManger' is not writable


    I have tried setting a property on another class, and it works fine - can anyone spot what I am doing wrong?

    many thanks,

    David

    application-context.xml:
    ---------------------------------------------------------------

    <bean id="ldssServerTransactionManger"
    class="com.lexmark.kiosk.dao.cyclone.LDSSTransacti onManager">
    </bean>

    <bean id="ldssTransactionAdvice"
    class="com.lexmark.kiosk.dao.cyclone.LDSSTransacti onAdvice">
    <property name="serverTransactionManger">
    <ref local="ldssServerTransactionManger"/>
    </property>
    </bean>

    <bean id="ldssTrasactionInterceptor"
    class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
    <property name="advice">
    <ref local="ldssTransactionAdvice"/>
    </property>
    <property name="patterns">
    <list>
    <value>.*</value>
    </list>
    </property>
    </bean>

    <bean id="formsetDAO"
    class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="proxyInterfaces"><value>com.lexmark.kiosk.da o.FormsetDAO</value></property>

    <!-- Use inner bean, not local reference to target -->
    <property name="target">
    <bean class="com.lexmark.kiosk.dao.cyclone.FormsetDAOImp l"/>
    </property>

    <property name="interceptorNames">
    <list>
    <value>ldssTrasactionInterceptor</value>
    </list>
    </property>
    </bean>
    ---------------------------------------------------------------

    LDSSTransactionAdvice.java
    ---------------------------------------------------------------
    package com.lexmark.kiosk.dao.cyclone;

    import java.lang.reflect.Method;

    import org.springframework.aop.AfterReturningAdvice;

    public class LDSSTransactionAdvice implements AfterReturningAdvice
    {
    //register singleton through Spring
    private LDSSTransactionManager serverTransactionManager = null;

    public void setServerTransactionManager(LDSSTransactionManager serverTransactionManager)
    {
    this.serverTransactionManager = serverTransactionManager;
    }

    public void afterReturning(Object returnValue, Method m, Object[] args, Object target) throws Throwable
    {
    System.out.println("\n\nI'm here, having returned!!");
    }

    }
    ---------------------------------------------------------------

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    serverTransactionManger should read serverTransactionManager in application-context.xml
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3

    Default

    AAAArrrrghhh!!

    I HATE those typos! Sorry for the bother.

Similar Threads

  1. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  2. Spring newbie problem
    By 3dot14 in forum Web
    Replies: 0
    Last Post: Mar 2nd, 2005, 10:55 AM
  3. Replies: 2
    Last Post: Jan 5th, 2005, 04:14 PM
  4. Replies: 1
    Last Post: Dec 20th, 2004, 04:43 AM
  5. Newbie problem
    By tomhay in forum SpringSource Tool Suite
    Replies: 2
    Last Post: Sep 21st, 2004, 03:22 PM

Posting Permissions

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