jakartaee / jakartaee/mail-api

resource not found warning

Open
#430 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
285
Forks
109
Avg merge
15h 19m
Merged PRs (30d)
1

Description

**Describe the bug**
In some cases, Javamail generates a warning:
WARNING: expected resource not found: /META-INF/javamail.default.address.map
A couple of test cases showed that this occurs when Java modules are used, but not otherwise.

**To Reproduce**

The source code is in
[JavaMailTest.java.txt](https://github.com/eclipse-ee4j/mail/files/4335339/JavaMailTest.java.txt)
and the module-info file is in
[module-info.java.txt](https://github.com/eclipse-ee4j/mail/files/4335350/module-info.java.txt).
These should be set up in a standard Java source tree for a package and module both named testpkg.
A directory named BUILD should be created and this directory should contain symbolic links named javax.mail.jar and javax.activation.jar that point to the latest JAR files for each.
For all of these files, remove the ".txt" extension, as that was needed to upload the files: I could not use a zip file because of symbolic links .
The Makefile is stored in
[Makefile.txt](https://github.com/eclipse-ee4j/mail/files/4335351/Makefile.txt)
(again, remove the .txt extension).
The source file JavaMailTest.java should be edited to set several constants to test values. These are NAME (which should be set to something like "John Doe"), SENDER (which should be set to something like "jdoe@isp.com"), and TO (which should be set to something like "John Doe ",
and SERVER (which should be set to something like "smtp.isp.com").
It may also be necessary to change AUTHNAME, depending on what an SMTP server expects, plus some properties to match the server's configuration.

To compile run
make compile
Then the command
make run1
should send an email without the warning and
make run2
should send an email but will print a warning

**Expected behavior**
Sending an email with no warnings in both cases

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS] System 76's PopOS (basically ubuntu)
- Browser [e.g. chrome, safari] firefox but not applicable - no browser was used
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Mail server:**
- Protocol being used: [e.g. smtp, imap, pop3, etc.] smtp
- Vendor/product: [e.g. Microsoft Exchange]
- Mail service URL: [e.g. gmail.com] mail.sonic.net

**Additional context**
Add any other context about the problem here.
The message was sent - I presume the resource was needed for other cases. The java
documentation for java.lang.Module indicates that modules place restrictions on which resources are visible and under what circumstances. The restrictions occur when the resource is outside of the package of the class trying to load it.

I used my ISP's server rather than gmail because my ISP uses password authentication.

Contributor guide

Open the contributing guide

Research direction

Start with the attached JavaMailTest.java, module-info.java, and Makefile, removing the .txt extensions and setting up the BUILD links as described. Run make compile, then make run1 and make run2 to reproduce the warning; done means both runs send mail without the resource-not-found warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.