Home > Code > Java Mail Problem

Java Mail Problem

October 10th, 2004 Tony Leave a comment Go to comments

I recently upgraded my JDK to v5.0. After upgrading I was receiving the following exception when trying to send email via Java:

Exception in thread “main” java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport at javax.activation.MailcapCommandMap.(MailcapCommandMap.java:111)

The problem is that the new JDK j2ee.jar has an incorrect version of the class MailcapCommandMap in it.

Solution : Make sure you have the latest version of JAF (activation.jar). This jar has the correct version of MailcapCommandMap. Then delete the entire activation package from your j2ee.jar.

Categories: Code Tags:
  1. pandit
    April 5th, 2006 at 08:16 | #1

    Remove the J2ee jar from class path.
    It will work

  2. Hassan
    April 20th, 2006 at 10:34 | #2

    Hii , I was having the same problem and it was solved when removed J2ee.jar from project and from classpath

  3. Deep
    September 20th, 2006 at 01:46 | #3

    Removing j2ee.jar is not a solution right? What if some one needs j2ee.jar in the classpath and sending the e-mail is just another task. I guess one needs to make sure that the mail APIs are before j2ee.jar in the classpath.

  4. Curlew
    June 21st, 2007 at 13:42 | #4

    I have the later issue the Deep mentions. I need some of the stuff in j2ee.jar, but have the email issue. If I add the activation.jar to my classpath, I get an error:
    class “com.sun.activation.registries.MailcapFile”’s signer information does not match signer information of other classes in the same package

    How would I get around this, or how would one go about removing the mail and activation classes from his or her j2ee.jar?