|
Dave,
Can you send a copy of the webrequest.router.uniform.UniformWebRequestRouter class?
Thanks,
Abraham Fathman
Thanks, that got me over one hurdle, but now I'm getting the same
exception on a property that is not capitalized:
org.springframework.beans.NotWritablePropertyException:
Invalid property 'uniformMessageSender' of bean class
[webrequest.router.uniform.UniformWebRequestRouter]: Bean property
'uniformMessageSender' is not writable or has an invalid setter method: Does the
parameter type of the setter match the return type of the
getter?
<bean id="myRouter"
class="webrequest.router.uniform.UniformWebRequestRouter">
<property
name="uniformMessageSender">
<ref bean="myMessageSender"
/>
</property>
</bean>
<bean id="myMessageSender"
class="webrequest.router.uniform.UniformMessageSender">
<property
name="defaultUniformMessage">
<ref bean="defaultMessage" />
</property>
<property name="javaMailSender">
<ref bean="javaSender" />
</property>
</bean>
<bean id="defaultMessage"
class="webrequest.router.uniform.UniformMessage">
<property name="messageTemplate">
<value>/etc/mail/uniformMessage.vm</value>
</property>
<property name="velocityEngine">
<ref bean="velocityEngine"
/>
</property> </bean>
Abraham Fathman wrote:
Dave,
I might be mistaken, but I think the property you
are trying to set should be 'messageTemplate' instead of 'MessageTemplate'
(note the lowercase m).
Sorry if it's not that, and I have overlooked
something...
Abraham Fathman 513-708-5701
I'm
having trouble wiring up a bean with Spring 1.1.4. Has anyone run into a
similar problem where you are unable to set a property because the property is
"not writable?" I here's the exception:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'defaultMessage' defined in ServletContext
resource [/WEB-INF/UniformDispatcher-servlet.xml]: Error setting property
values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'MessageTemplate' of bean class [webrequest.router.uniform.UniformMessage]:
Bean property 'MessageTemplate' is not writable or has an invalid setter
method: Does the parameter type of the setter match the return type of the
getter? at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:771)
Here
is the relevant snippet of my UniformDispatcher-servlet.xml (note: if I
comment out the defaultMessage bean, the javaSender bean sets up
OK):
<bean id="defaultMessage"
class="webrequest.router.uniform.UniformMessage">
<property
name="MessageTemplate">
<value>/etc/mail/uniformMessage.vm</value>
</property>
<property name="VelocityEngine">
<ref bean="velocityEngine"
/>
</property> </bean>
<bean id="javaSender"
class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host">
<value>mail.somewhere.com</value>
</property>
</bean>
<bean id="velocityEngine"
class="org.apache.velocity.app.VelocityEngine"
init-method="init">
</bean>
Finally, here is the code.
public class
UniformMessage {
protected String messageTemplate
= "";
public UniformMessage()
{ }
...
public String
getMessageTemplate() { return
messageTemplate; } public void
setMessageTemplate(String messageTemplate)
{ this.messageTemplate =
messageTemplate; }
}
Your help
would be appreciated! Dave
|
|