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