-
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
java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found #85
Comments
Could you run the next and copy-paste the output?:
|
Hi @jbescos: Some how dependency tree is not working for this module alone.
|
In Session.java there is call for StreamProvider, and that is creating an issue in my case.
|
That error means that it cannot find the implementation of jakarta.mail.util.StreamProvider, that is supposed to exist in angus-mail. It seems to me that angus-mail dependency is not available in runtime. We would need to get the classpath/modulepath of your java process. Try to remove any mail/angus-mail dependency you have in the pom, and just add this one (it will bring any required dependency transitively):
If this does not work, then remove it and add this other (that contains mail and angus-mail within the same jar):
If none of previous solutions work, are you able to provide the classpath/modulepath of the java process?. |
Hi @jbescos,
But we would like to use angus-mail as the source code is available in Github and that is needed for compliance activities. I do not see jakarta.mail source code in Github. Do you know where the source code for jakarta.mail has been hosted? How to bind the jakarta.mail-api and angus-mail? Some how it is not finding the implementation. |
jakarta.mail sources are here: https://github.com/jakartaee/mail-api You don't have to do anything to bind jakarta.mail-api with angus-mail. They must exist in the modulepath/classpath and thats all. If it is not working, it could be related to some issue with the classloaders, or simply angus-mail is not in the modulepath/classpath. Is your app an standalone application, or is it deployed in a web container like Weblogic, Websphere?. What is the JRE that you are using?. |
Hi @jbescos, https://github.com/jakartaee/mail-api this link has source code for just the api. Not the implementation. |
The implementation is already in this project where you are creating this issue: org.eclipse.angus:jakarta.mail comes from this module of here. It creates a jar file containing the implementation (of angus-mail) and the jakarta.mail-api. Could you check that angus-mail is in the classpath/modulepath of your application when it is executed?. It seems it is not there. |
Thanks @jbescos. I am checking that. I will update you. |
Hi @jbescos, Thanks a lot for your help. I feel I can use the below mentioned dependencies in my application as suggested by you. It works fine.
|
Closing this with no changes required to the code base. Shouldn't have to note this in the changes.txt because no commits were issued. |
Possible reason for the mentioned issue can also be when calling the send mail method in an asynchrone thread |
Sorry for commenting closed issue. |
Hi, I was getting the “java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found”. The code worked before jakarta/angus update and also works in the IDE but not in the system (ant task + zulu 17). I assumed there were classpath issues so I checked everything I could think off, checked several versions, major class versions (52), everything on a single jar (maven shade plugin). The class was there (org.eclipse.angus.mail.util.MailStreamProvider), opened the jar and checked. So this is what I saw. I verified that I could add the name of the stream provider to the system properties and change the FactoryFinder strategy to a newInstance, but this also didn’t work. System.setProperty("jakarta.mail.util.StreamProvider", "org.eclipse.angus.mail.util.MailStreamProvider"); Both Service based location (factoryFromServiceLoader) and newInstance are not working on FactoryFinder find method. I add code to test the problem and output below this lines where it seems that the class is there but the ServiceBasedLocation and instance is failing. For me, after what I saw, I can download a copy of the jar and force regular old style forName + newInstance on FactoryFinder newInstance. At the end it may probably be a simple classloading problem, a typpo or similar. I couldn’t find it. Hope that this is helpful somehow. Kind Regards. LOG Testing Code
|
com.sun.mail jakarta.mail 2.0.1 com.sun.activation jakarta.activation 2.0.1 |
Describe the bug
I am updating my project dependencies from com.sun.mail:jakarta.mail (2.0.1) to jakarta.mail-api and angus-mail.
But after doing changes in pom.xml. I get the below error.
The text was updated successfully, but these errors were encountered: