0

I'm using JavaMail API to send email with Java 11 using maven when I send an email I get the following exception:

Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules javax.mail.api and javax.mail export package javax.mail.search to module java.persistence

dependencies.

 <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <version>1.5.5</version>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.5.5</version>
        </dependency>

module-info.java

  //persistence
    requires java.persistence;
    requires java.sql;
    requires com.fasterxml.classmate;
    requires java.xml.bind;
    requires org.hibernate.orm.core;

    requires java.logging;
    requires java.json;
    requires jdk.xml.dom;
    requires net.bytebuddy;

    requires java.activation;

    //mail
    requires javax.mail;

there seems to be a conflict with the hibernation-core, does anyone have any idea how to resolve?

SrTomy
  • 1
  • 2
  • Possible duplictate of https://stackoverflow.com/questions/16807758/java-lang-noclassdeffounderror-com-sun-mail-util-maillogger-for-junit-test-case. – NiK648 Feb 10 '20 at 03:26
  • You appear to have the wrong dependency. See linked Q&As for solution. – Stephen C Feb 10 '20 at 03:41

0 Answers0