HTTPClient 4.0.1 compile problems

View: New views
3 Messages — Rating Filter:   Alert me  

HTTPClient 4.0.1 compile problems

by Drizzt321 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In my project (I'm using NetBeans btw) I was using a beta release of the HTTPClient4, and recently I was going through and upgrading the libraries as needed, and downloaded the HTTPClient 4.0. When I do a clean recompile now, I get compilation errors on the line where I create my DefaultHttpClient object. I have all of the jar files from the lib directory from the release.

apache-mime4j-0.6.jar
commons-codec-1.3.jar
commons-logging-1.1.1.jar
httpclient-4.0.jar
httpmime-4.0.jar
httpcore-40.0.1.jar


Compile errors:
C:\Documents and Settings\...\HttpGetFeed.java:314: cannot access net.jcip.annotations.GuardedBy
file net\jcip\annotations\GuardedBy.class not found
        DefaultHttpClient client = new DefaultHttpClient();
C:\Documents and Settings\...\HttpGetFeed.java:321: cannot find symbol
symbol  : method getCredentialsProvider()
location: class org.apache.http.impl.client.DefaultHttpClient
            client.getCredentialsProvider().setCredentials(new AuthScope(specs.getHost(), specs.getPort()), new UsernamePasswordCredentials(specs.getHttpAuthUsername(), specs.getHttpAuthPassword() ) );

Re: HTTPClient 4.0.1 compile problems

by Drizzt321 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks like I had to simply download the Jar file from http://www.javaconcurrencyinpractice.com/   This is not listed in the README.txt file which does list a set of dependencies which are also included in the lib directory.

Drizzt321 wrote:
In my project (I'm using NetBeans btw) I was using a beta release of the HTTPClient4, and recently I was going through and upgrading the libraries as needed, and downloaded the HTTPClient 4.0. When I do a clean recompile now, I get compilation errors on the line where I create my DefaultHttpClient object. I have all of the jar files from the lib directory from the release.

apache-mime4j-0.6.jar
commons-codec-1.3.jar
commons-logging-1.1.1.jar
httpclient-4.0.jar
httpmime-4.0.jar
httpcore-40.0.1.jar


Compile errors:
C:\Documents and Settings\...\HttpGetFeed.java:314: cannot access net.jcip.annotations.GuardedBy
file net\jcip\annotations\GuardedBy.class not found
        DefaultHttpClient client = new DefaultHttpClient();
C:\Documents and Settings\...\HttpGetFeed.java:321: cannot find symbol
symbol  : method getCredentialsProvider()
location: class org.apache.http.impl.client.DefaultHttpClient
            client.getCredentialsProvider().setCredentials(new AuthScope(specs.getHost(), specs.getPort()), new UsernamePasswordCredentials(specs.getHttpAuthUsername(), specs.getHttpAuthPassword() ) );

Re: HTTPClient 4.0.1 compile problems

by sebb-2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, this is a known (and fixed) bug - see:

http://issues.apache.org/jira/browse/HTTPCLIENT-866


On 30/09/2009, Drizzt321 <drizzt321@...> wrote:

>
>  Looks like I had to simply download the Jar file from
>  http://www.javaconcurrencyinpractice.com/   This is not listed in the
>  README.txt file which does list a set of dependencies which are also
>  included in the lib directory.
>
>
>
>  Drizzt321 wrote:
>  >
>  > In my project (I'm using NetBeans btw) I was using a beta release of the
>  > HTTPClient4, and recently I was going through and upgrading the libraries
>  > as needed, and downloaded the HTTPClient 4.0. When I do a clean recompile
>  > now, I get compilation errors on the line where I create my
>  > DefaultHttpClient object. I have all of the jar files from the lib
>  > directory from the release.
>  >
>  > apache-mime4j-0.6.jar
>  > commons-codec-1.3.jar
>  > commons-logging-1.1.1.jar
>  > httpclient-4.0.jar
>  > httpmime-4.0.jar
>  > httpcore-40.0.1.jar
>  >
>  >
>  > Compile errors:
>  > C:\Documents and Settings\...\HttpGetFeed.java:314: cannot access
>  > net.jcip.annotations.GuardedBy
>  > file net\jcip\annotations\GuardedBy.class not found
>  >         DefaultHttpClient client = new DefaultHttpClient();
>  > C:\Documents and Settings\...\HttpGetFeed.java:321: cannot find symbol
>  > symbol  : method getCredentialsProvider()
>  > location: class org.apache.http.impl.client.DefaultHttpClient
>  >             client.getCredentialsProvider().setCredentials(new
>  > AuthScope(specs.getHost(), specs.getPort()), new
>  > UsernamePasswordCredentials(specs.getHttpAuthUsername(),
>  > specs.getHttpAuthPassword() ) );
>  >
>  >
>
>  --
>
> View this message in context: http://www.nabble.com/HTTPClient-4.0.1-compile-problems-tp25672463p25672591.html
>
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: httpclient-users-unsubscribe@...
>  For additional commands, e-mail: httpclient-users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@...
For additional commands, e-mail: httpclient-users-help@...