Announcement Announcement Module
Collapse
No announcement yet.
JavaMail - weird NoClassDefFoundError Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JavaMail - weird NoClassDefFoundError

    I'm trying to send mail from a Spring web application running under Tomcat 5.0. This works fine on my own machine (using the same war file and the same version of Tomcat) but is getting a NoClassDefFoundError when I deploy it to production. Both mail.jar and activation.jar are present in WEB-INF/lib, so I think this may not actually be a classpath issue. Sometimes I've seen these types of things caused by an error in a static initializer, but I haven't been able to track down the problem. Anyone seen this particular problem before?

    2004-11-01 03:09:39 StandardWrapperValve[intros]: Servlet.service() for servlet
    intros threw exception
    java.lang.NoClassDefFoundError: javax/activation/DataSource
    at org.springframework.mail.javamail.JavaMailSenderIm pl.createMimeMessag
    e(JavaMailSenderImpl.java:243)
    at com.xyz.email.EmailSender.createMessage(EmailSende r.java:117)
    [...]

  • #2
    Really does look like a class loader issue. Is spring.jar also under /WEB-INF/lib? You could possibly get this if it was loaded by the shared class loader or another ancestral class loader.

    Comment


    • #3
      Turns out it was a classloader issue. mail.jar was in the Tomcat shared/lib directory, and activation.jar was not. I removed the shared mail.jar and everything works fine now.

      Comment

      Working...
      X