-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Loader constraint violation when using sendMail action with attachment #838
Comments
I can confirm the issue. It happens since #834 as Karaf 4.2.2 contained this change in order to fix https://issues.apache.org/jira/browse/KARAF-5989. I am not fully sure for whom this fix actually helped and for whom it broke the feature. We belong to the latter group :-(.
but I assume that Equinox resolves against the JRE as we use If I put the line I am not sure how we should best solve this issue. Customising @wborn Any good suggestion? |
Maybe @ffang has some suggestions for fixing it? |
Yes, this problem comes from that javax/activation/DataHandler are loaded by different classloaders, and with Karaf 4.2.2, we now expect this class get loaded from the org.apache.servicemix.specs.activation-api bundle. The osgi.compatibility.bootdelegation property from equinox will use OSGi normal classloader delegation way first, if can't find the required class, it will use the one from boot classloader as fallback. So I believe even with osgi.compatibility.bootdelegation=true, other bundles which require javax/activation/DataHandler should still try to load it from org.apache.servicemix.specs.activation-api bundle. So we should firstly check why javax/activation/DataHandler from jre is loaded by some bundles. Could you please check the header of bundles(bundle contains org/apache/commons/mail/MultiPartEmail and bundle contains javax/mail/Part) in question to see if it can reveal more? |
@ffang The manifest of the bundle can be found here: https://github.com/openhab/openhab1-addons/blob/master/bundles/action/org.openhab.action.mail/META-INF/MANIFEST.MF It currently indeed does not have an import-package statement for I agree with you that the boot delegation is supposed to be a last resort only and that resolution should happen against OSGi bundles first - so I am not quite sure, why it still wasn't working with such an import... |
I've created openhab/openhab1-addons#5767 in any case as this should be there. Maybe my tests weren't correct and this will fix it after all - let's try a distro after this has been merged. |
Argh, stupid me. I should have read my earlier comment, where I already said that this bundle correctly resolves the dependency against the org.apache.servicemix.specs.activation-api bundle - so adding the import definitely won't fix anything... The problem is probably rather somewhere in the rule engine, which does not know about that package and still needs to resolve some classes in order to execute the action. Not sure where to look for this, though... |
Do you still need |
From what I remember: YES, very much so! At least as long as we have openHAB 1 compatibility as those add-ons have many issues and many of them broke without the boot delegation. |
@kaikreuzer I just retested this on build 1502. Your change here seems to have fixed the issue for me. |
@mhilbush I assume this means i can install the lastest version and it's fixed? |
@yveshanoulle Yes, it is working again for me after installing the latest snapshot. |
Indeed, for me as well! |
Also on my side this works. |
I'm seeing this error when calling the sendMail action with an attachment. The error doesn't occur when calling the sendMail action without an attachment.
I'm seeing this on snapshot build 1484 (also 1489). I'm seeing the error on two separate systems. When I restore an earlier build (in this case 1458), the error doesn't occur.
The sendMail call in my rule is this
or this
It didn't look like anything had changed with the sendMail action in the openhab1 repo (hence the reason for not opening the issue in that repo).
The text was updated successfully, but these errors were encountered: