package javax.mail.internet does not exist | Community
Skip to main content
Level 3
Mar 12, 2019 8:26 AM UTC
Solved

package javax.mail.internet does not exist

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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Prince_Shivhare
Prince_ShivhareAccepted solution
New Participant
Mar 12, 2019 12:18 PM UTC

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

5 replies

Level 3
Mar 12, 2019 2:45 PM UTC

This one is also correct answer Thanks a lot

Translate
Level 3
Mar 12, 2019 2:44 PM UTC

This one is also correct answer Thanks a lot

Translate
smacdonald2008
Level 10
Mar 12, 2019 1:47 PM UTC

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

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

Translate
Prince_Shivhare
Prince_ShivhareAccepted solution
New Participant
Mar 12, 2019 12:18 PM UTC

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

Translate
VeenaVikraman
New Participant
Mar 12, 2019 10:42 AM UTC

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.

Translate