Solved

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

Posted on 2012-04-02
2
6,962 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

911 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

26 Experts available now in Live!

Get 1:1 Help Now