i want to use webwork and spring develop my web application
so,i want to use the JavaMailSenderImpl send mail to user
but i don't konw
how can i config the applicationContext.xml and xwork.xml to support the
JavaMailSenderImpl speciality
when i config the JavaMailSenderImpl in my applicationContext.xml
occour a error is
12:15:26,481 ERROR ContextLoader:114 - Context initialization failed
org.springframework.beans.factory.BeanDefinitionSt oreException: Error registerin
g bean with name 'mailSender' defined in ServletContext resource [/WEB-INF/appli
cationContext.xml]: Class that bean class [org.springframework.mail.javamail.Jav
aMailSenderImpl] depends on not found; nested exception is java.lang.NoClassDefF
oundError: javax/mail/MessagingException
java.lang.NoClassDefFoundError: javax/mail/MessagingException
how can i do???
post the code is:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/mail.properties</value>
</list>
</property>
</bean>
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">
<property name="host"><value>${mailSender.host}</value></property>
<property name="port"><value>${mailSender.port}</value></property>
<property name="username"><value>${mailSender.username}</value></property>
<property name="password"><value>${mailSender.password}</value></property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>
<bean id="mailMessage" class="org.springframework.mail.SimpleMailMessage" >
<property name="from"><value>${mailSender.username}</value></property>
</bean>
mail.properties
mailSender.host=mail.com.cn
mailSender.username=xx
mailSender.password=000000


Reply With Quote