You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2013/08/18 21:28:47 UTC

[jira] [Comment Edited] (HTTPCLIENT-1389) HttpClient OSGi bundle (4.2.5)'s included JavaMail API bundle will not resolve (should not depend hard on sun.* classes)

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743335#comment-13743335 ] 

Oleg Kalnichevski edited comment on HTTPCLIENT-1389 at 8/18/13 7:28 PM:
------------------------------------------------------------------------

Tried it out with a minimal Equinox 3.8.2 installation and it worked for me

---
osgi> ss
"Framework is launched."


id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.8.2.v20130124-134944
1	ACTIVE      org.eclipse.equinox.console_1.0.0.v20120522-1841
2	ACTIVE      org.apache.felix.gogo.shell_0.8.0.v201110170705
3	ACTIVE      org.apache.felix.gogo.runtime_0.8.0.v201108120515
4	ACTIVE      org.apache.felix.gogo.command_0.8.0.v201108120515
7	ACTIVE      org.apache.commons.logging_1.1.1.v201101211721
8	ACTIVE      org.apache.httpcomponents.httpcore_4.2.5
9	ACTIVE      org.apache.httpcomponents.httpclient_4.2.5
---

You can find HttpClient 4.2.5 OSGi metadata here [1]. There is no dependency on Java Mail APIs. 

Please note that one does need to have a commons-logging bundle besides HttpCore.

Oleg   

[1] https://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4.2.5/httpclient-osgi/pom.xml
                
      was (Author: olegk):
    Tried it out with a minimal Equinox 3.8.2 installation and it worked for me

---
osgi> ss
"Framework is launched."


id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.8.2.v20130124-134944
1	ACTIVE      org.eclipse.equinox.console_1.0.0.v20120522-1841
2	ACTIVE      org.apache.felix.gogo.shell_0.8.0.v201110170705
3	ACTIVE      org.apache.felix.gogo.runtime_0.8.0.v201108120515
4	ACTIVE      org.apache.felix.gogo.command_0.8.0.v201108120515
7	ACTIVE      org.apache.commons.logging_1.1.1.v201101211721
8	ACTIVE      org.apache.httpcomponents.httpcore_4.2.5
9	ACTIVE      org.apache.httpcomponents.httpclient_4.2.5
---

You can find HttpClient 4.2.5 OSGi metadata here. There is no dependency on Java Mail APIs. 

Please note that one does need to have a commons-logging bundle besides HttpCore.

Oleg   
                  
> HttpClient OSGi bundle (4.2.5)'s included JavaMail API bundle will not resolve (should not depend hard on sun.* classes)
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1389
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1389
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.2.5
>         Environment: Felix 4.2.1 command shell
>            Reporter: Morten Christensen
>
> If I add the httpclient-osgi-4.2.5.jar and httpcore-4.2.5.jar in felix console, I get various dependencies installed too like slf4j-jdk14, JavaMail API etc. The JavaMail API bundle will not start (resolve) however, as it illegally has a hard (non-optional) dependency on a sun.* internal class ("sun.security.util"). This in turn gives problems when starting subsequent plugins that depend on HttpClient which gets an exception.
> Session details here:
> obr:deploy "Apache HttpCore OSGi bundle"
> obr:deploy "Apache HttpClient OSGi bundle"
> Target resource(s):
> -------------------
>    Apache HttpClient OSGi bundle (4.2.5)
> Required resource(s):
> ---------------------
>    Commons Logging (1.1.2)
> Optional resource(s):
> ---------------------
>    JavaMail API (1.4.2)
>    Apache Felix Http Bundle (2.0.4)
>    slf4j-jdk14 (1.7.5)
>    Apache Log4j (1.2.17)
>    osgi.cmpn (4.2.0.200908310645)
>    slf4j-api (1.7.5)
>    osgi.core (5.0.0.201203141902)
> ...
> felix:lb
> START LEVEL 1
>    ID|State      |Level|Name
>     0|Active     |    0|System Bundle (4.2.1)
>     1|Active     |    1|Apache Felix Bundle Repository (1.6.6)
>     2|Active     |    1|Apache Felix Gogo Command (0.12.0)
>     3|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
>     4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
>     5|Active     |    1|Apache HttpCore OSGi bundle (4.2.4)
>     6|Resolved   |    1|Apache Felix Http Bundle (2.0.4)
>     7|Installed  |    1|JavaMail API (1.4.2)
>     8|Resolved   |    1|slf4j-jdk14 (1.7.5)
>     9|Resolved   |    1|Apache Log4j (1.2.17)
>    10|Resolved   |    1|osgi.cmpn (4.2.0.200908310645)
>    11|Active     |    1|Apache HttpClient OSGi bundle (4.2.5)
>    12|Resolved   |    1|slf4j-api (1.7.5)
>    13|Resolved   |    1|osgi.core (5.0.0.201203141902)
>    14|Resolved   |    1|Commons Logging (1.1.2)
> felix:start 7
> org.osgi.framework.BundleException: Unresolved constraint in bundle javax.mail.mail [7]: Unable to resolve 7.0: missing requirement [7.0] osgi.wiring.package; (osgi.wiring.package=sun.security.util)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org