Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gets warning logs when connecting to gmail #1136

Closed
shafreenAnfar opened this issue Mar 23, 2021 · 0 comments · Fixed by ballerina-platform/module-ballerina-email#165
Closed
Assignees
Labels
module/email Team/PCM Protocol connector packages related issues Type/Bug Version/SLAlpha3 Issues reported on SwanLake Alpha3 release, mostly reported from the usability hackathon

Comments

@shafreenAnfar
Copy link
Contributor

Description:
I get warning logs when connecting to gmail.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.mail.util.SocketFetcher (file:/Library/Ballerina/distributions/ballerina-slalpha3/repo/bala/ballerina/email/1.1.0-alpha5/java11/platform/java11/javax.mail-1.6.2.jar) to method sun.security.util.HostnameChecker.getInstance(byte)
WARNING: Please consider reporting this to the maintainers of com.sun.mail.util.SocketFetcher
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Sample code

import ballerina/email;
import ballerina/io;

listener email:ImapListener emailListener = new ({
  host: "imap.gmail.com",
  username: "<email>",
  password: "<password>"
});

service "emailObserver" on emailListener {

    remote function onMessage(email:Message emailMessage) {
        io:println("POP Listener received an email.");
        io:println("Email Subject: ", emailMessage.subject);
        io:println("Email Body: ", emailMessage?.body);
    }

    remote function onError(email:Error emailError) {
        io:println("Error while polling for the emails: "
            + emailError.message());
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/email Team/PCM Protocol connector packages related issues Type/Bug Version/SLAlpha3 Issues reported on SwanLake Alpha3 release, mostly reported from the usability hackathon
Projects
None yet
3 participants