-
Notifications
You must be signed in to change notification settings - Fork 16
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
MailcapCommandMap can not load Mime Handlers in OSGI Runtime #148
Comments
Could you try with this one?: https://mvnrepository.com/artifact/org.eclipse.angus/jakarta.mail/2.0.3 And also remove jakarta.mail-api.jar. This is included inside |
There is also: jakartaee/jaf-api#161. There is useful information there. I'm not finished with that PR but, I think Mail will have to add entries to CommandMap on set or we need to modify the streamprovider interface to generate commandmap. |
I put all 3 dependencies (2 Jakarta Activation and 1 Angus Jakarta Mail, that contains API and Impl) into same bundle in embedded mode and activated the Debug Logs for Activation and Mail:
It works as expected. I first send a mail and recieve the same Email.
On the Felix Runtime I have:
Here are the maven dependencies I used, they are the latest in the Maven as I tried:
For now I have a solution as above since embedding all 3 into another Bundle works as expected. |
We have done the same and wrapped all relevant jars via bnd / bndtools into a single OSGi bundle, so that all those bundles share the same bundle-classloader which can see all relevant classes of all jar files. For those interested here is a bnd file which does that:
Note: helpful: -includeresource and wrapping libraries |
Hello,
We are trying to move from Javax to Jakarta dependencies in OSGI but we can not find a set of runtime dependencies for the Jakarta Mail and Jakarta Activation.
I have following JARs in the OSGI Runtime:
jakarta.activation:jakarta.mail-api.jar (version 2.1.2)
org.eclipse.angus:jakarta.mail.jar (version 2.0.3)
jakarta.activation:jakarta.activation-api.jar (version 2.1.3)
org.eclipse.angus:angus-activation.jar (version 2.0.2)
We get following error as we try to send an Email in MailcapCommandMap:
Can't load DCH org.eclipse.angus.mail.handlers.multipart_mixed; Exception: java.lang.ClassNotFoundException: org.eclipse.angus.mail.handlers.multipart_mixed not found by jakarta.activation-api [39]
How should the MailcapCommandMap find the correct class Loader for the "multipart_mixed" handler?
cld = SecuritySupport.getContextClassLoader(); -> loads the application class loader and it does not contain multipart_mixed handlers.
cld = this.getClass().getClassLoader(); -> loads the bundle class loader for jakarta.activation-api als does not contain multipart_mixed handlers.
cl = Class.forName(name); -> same class loader as this.getClass().getClassLoader().
None of the above loaded the handlers correctly.
Our current idea is putting all JARs from above into a single bundle as dependencies and export everyting from the same bundle which is sharing the same class loader as a workaround solution.
How should it be working in the OSGI runtime?
The text was updated successfully, but these errors were encountered: