package javax.mail.internet does not exist

Avatar

Avatar

rajs73651622

Avatar

rajs73651622

rajs73651622

12-03-2019

I have imported the below package in my sling servlet but getting below errors, please help to resolve the issue. I am using AEM 6.4

import javax.mail.internet.InternetAddress;

Error

package javax.mail.internet does not exist

class file for javax.mail.MessagingException not found

In POM.xml used the below dependency

<dependency>

    <groupId>javax.mail</groupId>

    <artifactId>mail</artifactId>

    <version>1.4.1</version>

</dependency>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Prince_Shivhare

Avatar

Prince_Shivhare

Prince_Shivhare

12-03-2019

Could you please confirm if you have added this dependency in parents pom and core pom?

in core package add a dependency in POM without version and in parent pom with version.

Parent POM:

<dependency>

    <groupId>javax.mail</groupId>

    <artifactId>mail</artifactId>

    <version>1.4.1</version>

</dependency>

Core POM:

<dependency>

    <groupId>javax.mail</groupId>

    <artifactId>mail</artifactId>

</dependency>

~ Prince

Answers (4)

Answers (4)

Avatar

Avatar

rajs73651622

Avatar

rajs73651622

rajs73651622

12-03-2019

This one is also correct answer Thanks a lot

Avatar

Avatar

rajs73651622

Avatar

rajs73651622

rajs73651622

12-03-2019

This one is also correct answer Thanks a lot

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

12-03-2019

Check this package on your depfinder - i am seeing it fine:

http://localhost:4502/system/console/depfinder

dep2.png

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

12-03-2019

This can happen when the particular dependency is not available in your felix console. You can go to http://localhost:4502/system/console/depfinder

and find the dependencies available . When I check the depfinder for javax.mail , I can find below dependency available.

1709938_pastedImage_1.png