I'm trying to add the javax.mail jar to my classpath but I get this error:
java.lang.NoClassDefFoundError: javax/mail/MessagingException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
at java.lang.Class.getDeclaredConstructors(Class.java:2012)
at org.springframework.beans.factory.annotation.
I've readed in other post that it could be fixed adding the dependecy to the pom.xml, so I did it:
pom.xml
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
</dependency>
But still I'm getting the error ..can someone help me with this?
Also with the 1.4.3 version there is no longer an artifact id called mail. If you want to use 1.4.3 you should use this dependency
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
<version>1.4.3</version>
</dependency>
You should add the jar to the server Tomcat.
Open launch configuration
Add external jar (look for your email jar)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With