1 Reply Latest reply on Jun 7, 2013 8:30 PM by Bill Shannon-Oracle

    ClassNotFound Exception for javax.mail.Address

      I am part of a development of a Java web application. I am developing using Eclipse on Windows Vista. I am running the development site on Tomcat on localhost.

      I am trying to send an email through gmail. Another developer has got it to work but mine always fails.

      A statement as simple as:
      InternetAddress fromAddress = new InternetAddress(from);
      caused this exception when the class is created.

      Caused by: java.lang.NoClassDefFoundError: javax/mail/Address
           at com.linguaclassica.access.ForgotPasswordPage.<init>(ForgotPasswordPage.java:66) ~[ForgotPasswordPage.class:na]
           ... 40 common frames omitted
      Caused by: java.lang.ClassNotFoundException: javax.mail.Address
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) ~[catalina.jar:7.0.32]
           at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) ~[catalina.jar:7.0.32]
           ... 41 common frames omitted

      I have placed mail.jar in C:\Java\javamail-1.4.1
      I have placed activation.jar in C:\Java\jaf-1.1.1

      My environment contains
      CLASSPATH=.;JAVA_HOME\lib;C:\Java\javamail-1.4.1\mail.jar;C:\Java\jaf-1.1.1\activation.jar;C:\Program Files\Java\jre7\lib\ext\QTJava.zip

      The project's Properties | Java Build Path | Libraries contains
      activation.jar - C:\Java\jaf-1.1.1
      mail.jar - C:\Java\javamail-1.4.1

      I don't know what settings may be incorrect or whether any are missing. Suggestions? Show me.