Solved

JavaMail..java.lang.NoClassDefFoundError: com/sun/mail/util/MessageRemovedIOException

Posted on 2012-04-02
2
6,797 Views
Last Modified: 2012-04-03
Hi,
I am trying to write a program that sends email using javaMail.
I am using maven to get the jars but I am getting the following exception and could not proceed forward.Can anybody help me get the right jars via maven ?
                            the one I have are the following in the maven POM file:

                                  <dependency>
                  <groupId>javax.mail</groupId>
                  <artifactId>javax.mail-api</artifactId>
                  <version>1.4.5</version>
            </dependency>
            <dependency>
                  <groupId>javax.activation</groupId>
                  <artifactId>activation</artifactId>
                  <version>1.1.1</version>
            </dependency>


Thanks
0
Comment
Question by:addisuc
2 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 500 total points
ID: 37799669
I think you need to add additional dependency
<dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <version>1.4.5</version>
</dependency>

you had only API dependency and not implementation
0
 

Author Comment

by:addisuc
ID: 37801883
Thanks replacing "javax.mail-api"  with "mail" resolves the issue.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now