You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by "Florent ANDRE (Created) (JIRA)" <ji...@apache.org> on 2011/11/16 17:48:03 UTC

[jira] [Created] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Correct handling of javax.mail and javax.activation in OSGI environnement
-------------------------------------------------------------------------

                 Key: CLEREZZA-656
                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
             Project: Clerezza
          Issue Type: Bug
            Reporter: Florent ANDRE


In OSGI environnement, mail sending [1] or parsing [2] don't work well.
This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])


[1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
[2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
[3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Reto Bachmann-Gmür (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169499#comment-13169499 ] 

Reto Bachmann-Gmür commented on CLEREZZA-656:
---------------------------------------------

I agree, but it might be better to remove havax.actiovation from the packages exported by default from the system bundle. Both Stanbol and Sling don't export activation. It seems good practice to be restrictive in what the system bundle exports and to add needed system ressources via extension bundles.
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: export-activation-for-datahandler.patch, ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169363#comment-13169363 ] 

Florent ANDRE commented on CLEREZZA-656:
----------------------------------------

As I read, javax.activation in j2se is the same as the one in the bundle.

Two bundles exporting the same lib at different version number could normally no cause problems in OSGI.

The point is : in order to correctly handle incoming mail / multipart things, javax.activation and javax.mail need to share the same classloader. If not, javax.activation don't detect the correct class type.

++

                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: export-activation-for-datahandler.patch, ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent ANDRE updated CLEREZZA-656:
-----------------------------------

    Attachment: export-activation-for-datahandler.patch

export-activation-for-datahandler.patch
permit now good javax.activation --> javax.mail link
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: export-activation-for-datahandler.patch, ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Reto Bachmann-Gmür (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151322#comment-13151322 ] 

Reto Bachmann-Gmür commented on CLEREZZA-656:
---------------------------------------------

Salut Florent! The articles seem wuite generic, did you have any issue with the way mails are sent by clerezza?
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Reopened] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent ANDRE reopened CLEREZZA-656:
------------------------------------


Thanks for applied first patch and sorry for missing it : 
- javax.activation also need to be export by the bundle in order to correct handling of javax.activation.* (datahandler for example).


                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent ANDRE updated CLEREZZA-656:
-----------------------------------

    Attachment: ext-javax-mail-osgi.patch

Solve this and provide usable javax.mail with version number (javax.mail lib version upgrade to 1.4.4)
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>         Attachments: ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151325#comment-13151325 ] 

Florent ANDRE commented on CLEREZZA-656:
----------------------------------------

also, exported javax.mail.* class don't have version number in final bundle.
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Daniel Spicar (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151344#comment-13151344 ] 

Daniel Spicar commented on CLEREZZA-656:
----------------------------------------

Maybe a bit late, but I can confirm this issue. I had it when working with a custom application using clerezza's mail bundle. I even solved it somehow but I don't remember how. I may check it out if there is still interest. However as Florent already seems to have fixed it it may be unnecessary to check.
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>         Attachments: ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Reto Bachmann-Gmür (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152780#comment-13152780 ] 

Reto Bachmann-Gmür commented on CLEREZZA-656:
---------------------------------------------

javax.activation is currently exported by the system bundle, it is required by several bundles:

zz>val sbs = for (b <- bs; if {val ep = b.getHeaders.get("Import-Package"); (ep != null) && ep.toString.contains("javax.activation")}) yield b 
sbs: Array[org.osgi.framework.Bundle] = Array(org.apache.clerezza.triaxrs [4], org.apache.clerezza.platform.mail [68], org.apache.clerezza.platform.xhtml2html [89], org.wymiwyg.wrhapi [131], org.wymiwyg.commons-core [132])

I'm not sure if its a good idea to have two bundles exporting javax.activation. Is the version that comes with javax.mail newer than the one that is part of j2se?
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: export-activation-for-datahandler.patch, ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Reto Bachmann-Gmür (Resolved JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reto Bachmann-Gmür resolved CLEREZZA-656.
-----------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2-incubating

applied patch Florent
                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>             Fix For: 0.2-incubating
>
>         Attachments: ext-javax-mail-osgi.patch
>
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CLEREZZA-656) Correct handling of javax.mail and javax.activation in OSGI environnement

Posted by "Florent ANDRE (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CLEREZZA-656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151330#comment-13151330 ] 

Florent ANDRE commented on CLEREZZA-656:
----------------------------------------

Reto ! 

Not directly in Clerezza, but I actually develop a "mail fetcher" for Stanbol, and this is where I see the problem of MimeMultipart transform in SharedByteArrayInputStream in OSGI environment.

And as Clerezza already have a bundle for javax.mail I think more useable to share this bug fix into.



                
> Correct handling of javax.mail and javax.activation in OSGI environnement
> -------------------------------------------------------------------------
>
>                 Key: CLEREZZA-656
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-656
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Florent ANDRE
>              Labels: ext-javax-mail
>
> In OSGI environnement, mail sending [1] or parsing [2] don't work well.
> This problems are due to Classloader issue in javax.activation (that try to get resources in javax.mail with ClassLoader.getRessource ([3])
> [1] : http://thecarlhall.wordpress.com/2009/10/27/javamail-in-osgi/
> [2] : http://old.nabble.com/JavaMail-and-Felix-td32000484.html, http://nostacktrace.com/dev/2010/6/24/sending-multipart-mail-in-an-osgi-container.html
> [3] : http://kenai.com/projects/javamail/forums/forum/topics/13123-multipart-alternative#p27947

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira