Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-866

HttpClient depends on jcip-annotations.jar

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 4.0 Final
    • 4.1 Alpha1
    • None
    • None
    • javac 1.5.0_19

    Description

      When using Java 5 to compile code that uses HttpClient, jcip-annotations.jar must be in the classpath or else you get a compiler error:

      [javac] /path/to/src/SomeFile.java:129: cannot access net.jcip.annotations.GuardedBy
      [javac] file net/jcip/annotations/GuardedBy.class not found
      [javac] DefaultHttpClient httpclient = new DefaultHttpClient();
      [javac] ^

      With Java 6, you get a bunch of warnings instead.
      [javac] org/apache/http/impl/client/AbstractHttpClient.class(org/apache/http/impl/client:AbstractHttpClient.class): warning: Cannot find annotation method 'value()' in type 'net.jcip.annotations.GuardedBy': class file for net.jcip.annotations.GuardedBy not found

      This requirement doesn't seem to be documented anywhere, and jcip-annotations.jar is not included in the "httpcomponents-client-4.0-bin-with-dependencies" package.

      Attachments

        1. HTTPCLIENT-866.patch
          106 kB
          Oleg Kalnichevski

        Activity

          People

            Unassigned Unassigned
            dnault_laszlo David Nault
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: