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

Invalid signature file digest for Manifest main attributes #631

Closed
hencomb opened this issue Jun 22, 2020 · 4 comments
Closed

Invalid signature file digest for Manifest main attributes #631

hencomb opened this issue Jun 22, 2020 · 4 comments
Labels
type: question question directed at the library

Comments

@hencomb
Copy link

hencomb commented Jun 22, 2020

Java version: 8

Greetings,

We're trying out sendgrid/java for a corporate environment.

Message from one of our developers who is experiencing issues:

I’m not sure if the JAR is a problem, but since importing it into our application in order to send emails, we’re met with the following error:

java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

I have downloaded the jar from this location:
https://github.com/sendgrid/sendgrid-java

And this is the code we’re trying to execute:

private static final String FROM = "noreply-ppppapp@pppppgroup.com";
private static final String SENDGRID_API_KEY = "API_KEY";

private void sendMessage(String toAddress, String subject, String text) {
    Content content = new Content("text/plain", text);
    Email from = new Email(FROM);
    Email to = new Email(toAddress);
    Mail mail = new Mail(from, subject, to, content);

    SendGrid sg = new SendGrid(SENDGRID_API_KEY);
    Request request = new Request();
    try {
        request.setMethod(Method.POST);
        request.setEndpoint("mail/send");
        request.setBody(mail.build());
        Response response = sg.api(request);
        System.out.println(response.getStatusCode());
        System.out.println(response.getBody());
        System.out.println(response.getHeaders());
    } catch (Exception ex) {
        log.error(ex.getMessage());
        ex.printStackTrace();
    }
}

It looks like when we get to the first line of the function:
Content content = new Content(“text/plain”, text)

Any pointers would be appreciated.

@thinkingserious thinkingserious added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jun 22, 2020
@thinkingserious
Copy link
Contributor

Hello @henrylcombrinck,

It looks like you may be experiencing this signed JAR issue. Could you please take a look and let me know if this applies to your situation?

Here are some other potential things to try:

Thank you!

With best regards,

Elmer

@hencomb
Copy link
Author

hencomb commented Jun 24, 2020 via email

@thinkingserious
Copy link
Contributor

Hello @henrylcombrinck,

Just checking in to find out of you found success. Thanks!

@hencomb
Copy link
Author

hencomb commented Jun 26, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants