Results 1 to 4 of 4

Thread: how to config the webwork's JavaMailSenderImpl support

  1. #1
    Join Date
    Oct 2005
    Posts
    4

    Default how to config the webwork's JavaMailSenderImpl support

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Looks like you don't have the JavaMail classes on your classpath or maybe you have them twice.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    Dec 2006
    Posts
    150

    Default

    I have exactly the same error. I put the mail.jar and the activation.jar in my lib-path and added the two files to the build path in my eclipse. What else is to do here?

  4. #4
    Join Date
    Dec 2006
    Posts
    150

    Default

    OK, IT IS WORKING...

    After totally almost 11 hours and many many forums later i found out that the mail.jar and the activation.jar HAS TO BE in the Java - lib/ext-folder. It not even has to be in the class path or in the build path, whyever.

    for everybody who has this problem. Just copy the mail.jar and the activation.jar in the java-folder. (My folder is C:\Programme\Java\jre1.5.0\lib\ext)

    Hope that helps to save many hours for you.

Similar Threads

  1. Cannot reference my spring config files from another project
    By lorelia in forum SpringSource Tool Suite
    Replies: 4
    Last Post: Aug 30th, 2005, 01:52 AM
  2. Unexpected behaviour with multiple config files
    By rgitzel in forum Container
    Replies: 7
    Last Post: Mar 8th, 2005, 07:11 PM
  3. Config files with imports
    By p_d_austin in forum Container
    Replies: 3
    Last Post: Oct 25th, 2004, 11:33 AM
  4. Replies: 3
    Last Post: Sep 7th, 2004, 12:30 AM
  5. iBatis 2 Support - Can't locate sqlmap config file
    By roneisele in forum Container
    Replies: 5
    Last Post: Aug 29th, 2004, 10:23 AM

Posting Permissions

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