You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Albretch Mueller <lb...@gmail.com> on 2012/10/14 00:44:04 UTC
missing library ...
~
Well, I am not sure what is causing my errors. After downloading
httpcomponents- asyncclient, client and core:
~
$ ls -l *.tar.gz
-rw-r--r-- 1 knoppix knoppix 73970 Sep 27 19:35
httpcomponents-asyncclient-4.0-beta3-src.tar.gz
-rw-r--r-- 1 knoppix knoppix 1530137 Jun 29 20:52
httpcomponents-client-4.2.1-src.tar.gz
-rw-r--r-- 1 knoppix knoppix 1225967 Sep 21 16:14
httpcomponents-core-4.2.2-src.tar.gz
~
and compiling all components using:
~
$ mvn --version
Apache Maven 3.0.4 (rNON-CANONICAL_2012-10-13_11-40_knoppix;
2012-10-13 11:40:12+0000)
Maven home: /media/sdb1/inst/sw/apache-maven-3.0.4
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: /media/sdb1/inst/sw/jdk1.7.0_07/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.3.7", arch: "i386", family: "unix"
~
$ wc -l *.log
87 hc_asyncclient-4.0-beta3_mvn_antrun.log
78 hc_asyncclient-4.0-beta3_mvn_docbkx_generate.log
38 hc_asyncclient-4.0-beta3_mvn_javadoc.log
506 hc_asyncclient-4.0-beta3_mvn_package_assembly.log
247 hc_asyncclient-4.0-beta3_mvn_package.log
225 hc_asyncclient-4.0-beta3_mvn_test.log
111 hc_client-4.2.1_mvn_antrun.log
98 hc_client-4.2.1_mvn_docbkx_generate.log
62 hc_client-4.2.1_mvn_javadoc.log
999 hc_client-4.2.1_mvn_package_assembly.log
603 hc_client-4.2.1_mvn_package.log
606 hc_client-4.2.1_mvn_test.log
152 hc_core-4.2.2_mvn_antrun.log
234 hc_core-4.2.2_mvn_docbkx_generate.log
38 hc_core-4.2.2_mvn_javadoc.log
834 hc_core-4.2.2_mvn_package_assembly.log
515 hc_core-4.2.2_mvn_package.log
550 hc_core-4.2.2_mvn_test.log
5983 total
~
$ cat *.log | grep -in "\[INFO\] BUILD SUCCESS"
82:[INFO] BUILD SUCCESS
160:[INFO] BUILD SUCCESS
198:[INFO] BUILD SUCCESS
704:[INFO] BUILD SUCCESS
951:[INFO] BUILD SUCCESS
1176:[INFO] BUILD SUCCESS
1287:[INFO] BUILD SUCCESS
1385:[INFO] BUILD SUCCESS
1447:[INFO] BUILD SUCCESS
2446:[INFO] BUILD SUCCESS
3049:[INFO] BUILD SUCCESS
3655:[INFO] BUILD SUCCESS
3807:[INFO] BUILD SUCCESS
4041:[INFO] BUILD SUCCESS
4079:[INFO] BUILD SUCCESS
4913:[INFO] BUILD SUCCESS
5428:[INFO] BUILD SUCCESS
5977:[INFO] BUILD SUCCESS
~
on:
~
$ java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode)
~
setting up my classpath:
~
$ echo $CLASSPATH
/media/sdb1/inst/sw/JUtils/jars/hc/httpcore-4.2.2.jar:/media/sdb1/inst/sw/JUtils/jars/hc/httpclient-4.2.1.jar:/media/sdb1/inst/srcs/hc/httpcomponents-client-4.2.1/httpclient-osgi/target/org.apache.httpcomponents.httpclient_4.2.1.jar:/media/sdb1/inst/sw/JUtils:.
~
I am getting the following errors:
~
$ javac -encoding utf8
RedirectHttpServer00.javaRedirectHttpServer00.java:52: error: cannot
find symbol
import org.apache.http.impl.DefaultHttpParams;
^
symbol: class DefaultHttpParams
location: package org.apache.http.impl
RedirectHttpServer00.java:55: error: cannot find symbol
import org.apache.http.message.HttpGet;
^
symbol: class HttpGet
location: package org.apache.http.message
RedirectHttpServer00.java:62: error: cannot find symbol
import org.apache.http.protocol.HttpExecutionContext;
^
symbol: class HttpExecutionContext
location: package org.apache.http.protocol
RedirectHttpServer00.java:177: error: cannot find symbol
HttpParams params = new DefaultHttpParams(null);
^
symbol: class DefaultHttpParams
location: class HttpRedirectHandler
RedirectHttpServer00.java:192: error: constructor HttpRequestExecutor
in class HttpRequestExecutor cannot be applied to given types;
HttpRequestExecutor httpexecutor = new HttpRequestExecutor(httpproc);
^
required: no arguments
found: BasicHttpProcessor
reason: actual and formal argument lists differ in length
RedirectHttpServer00.java:193: error: cannot find symbol
httpexecutor.setParams(params);
^
symbol: method setParams(HttpParams)
location: variable httpexecutor of type HttpRequestExecutor
RedirectHttpServer00.java:195: error: cannot find symbol
HttpContext context = new HttpExecutionContext(null);
^
symbol: class HttpExecutionContext
location: class HttpRedirectHandler
RedirectHttpServer00.java:197: error: cannot find symbol
context.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST, host);
^
symbol: variable HttpExecutionContext
location: class HttpRedirectHandler
RedirectHttpServer00.java:207: error: cannot find symbol
HttpGet request = new HttpGet(target);
^
symbol: class HttpGet
location: class HttpRedirectHandler
RedirectHttpServer00.java:207: error: cannot find symbol
HttpGet request = new HttpGet(target);
^
symbol: class HttpGet
location: class HttpRedirectHandler
RedirectHttpServer00.java:272: error: cannot find symbol
this.params = new DefaultHttpParams(null);
^
symbol: class DefaultHttpParams
location: class RequestListenerThread
RedirectHttpServer00.java:338: error: cannot find symbol
HttpContext context = new HttpExecutionContext(null);
^
symbol: class HttpExecutionContext
location: class WorkerThread
Note: RedirectHttpServer00.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
12 errors
~
based on your quickstart
~
http://hc.apache.org/httpcomponents-client-ga/quickstart.html
~
There should be 7 jars in total (components marked with (*) include
additional features and are optional) on the classpath.
commons-logging-x.x.x.jar
commons-codec-x.x.x.jar
httpcore-x.x.x.jar
httpclient-x.x.x.jar
~
but maven didn't seem to have compiled commons-logging and commons-codec
~
$ ls -l | grep "^d"
drwxr-xr-x 7 knoppix knoppix 4096 Oct 13 16:43
httpcomponents-asyncclient-4.0-beta3
drwxr-xr-x 11 knoppix knoppix 4096 Oct 13 14:11 httpcomponents-client-4.2.1
drwxr-xr-x 10 knoppix knoppix 4096 Oct 13 16:05 httpcomponents-core-4.2.2
~
$ find . -type f -name "*.jar"
./httpcomponents-client-4.2.1/httpmime/target/httpmime-4.2.1-sources.jar
./httpcomponents-client-4.2.1/httpmime/target/httpmime-4.2.1.jar
./httpcomponents-client-4.2.1/httpclient-osgi/target/org.apache.httpcomponents.httpclient_4.2.1.jar
./httpcomponents-client-4.2.1/httpclient-osgi/target/org.apache.httpcomponents.httpclient_4.2.1-sources.jar
./httpcomponents-client-4.2.1/httpclient/target/httpclient-4.2.1.jar
./httpcomponents-client-4.2.1/httpclient/target/httpclient-4.2.1-tests.jar
./httpcomponents-client-4.2.1/httpclient/target/httpclient-4.2.1-sources.jar
./httpcomponents-client-4.2.1/httpclient-cache/target/httpclient-cache-4.2.1-sources.jar
./httpcomponents-client-4.2.1/httpclient-cache/target/httpclient-cache-4.2.1.jar
./httpcomponents-client-4.2.1/fluent-hc/target/fluent-hc-4.2.1.jar
./httpcomponents-client-4.2.1/fluent-hc/target/fluent-hc-4.2.1-sources.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient-osgi/target/org.apache.httpcomponents.httpasyncclient_4.0-beta3.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient-osgi/target/org.apache.httpcomponents.httpasyncclient_4.0-beta3-sources.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient-cache/target/httpasyncclient-cache-4.0-beta3-sources.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient-cache/target/httpasyncclient-cache-4.0-beta3.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient/target/httpasyncclient-4.0-beta3-sources.jar
./httpcomponents-asyncclient-4.0-beta3/httpasyncclient/target/httpasyncclient-4.0-beta3.jar
./httpcomponents-core-4.2.2/httpcore-ab/target/httpcore-ab-4.2.2.jar
./httpcomponents-core-4.2.2/httpcore-ab/target/httpcore-ab-4.2.2-sources.jar
./httpcomponents-core-4.2.2/httpcore-nio/target/httpcore-nio-4.2.2.jar
./httpcomponents-core-4.2.2/httpcore-nio/target/httpcore-nio-4.2.2-sources.jar
./httpcomponents-core-4.2.2/httpcore-osgi/target/org.apache.httpcomponents.httpcore_4.2.2-sources.jar
./httpcomponents-core-4.2.2/httpcore-osgi/target/org.apache.httpcomponents.httpcore_4.2.2.jar
./httpcomponents-core-4.2.2/httpcore/target/httpcore-4.2.2-sources.jar
./httpcomponents-core-4.2.2/httpcore/target/httpcore-4.2.2.jar
~
What am I missing, not doing right?
~
thanks
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Albretch Mueller <lb...@gmail.com>.
Well, I don't have much time right now to streamline the compiling
from source approach and hc devs either don't care or don't feel like
clarifying the whereabouts of it.
~
Here is a self-logging, less-than-2-minutes (seconds if you write up
a bash script) way to set up HC if you use the binary libraries they
offer at:
~
http://www.apache.org/dist/httpcomponents/httpclient/binary (<url_path>)
~
I just went about:
~
1) grabbing the latest libraries (currently <x.x.x>) and their KEYS file from:
~
$ date
$ pwd
$ wget --server-response --no-verbose
<url_path>/httpcomponents-client-<x.x.x>-bin.tar.gz
$ wget --server-response --no-verbose
<url_path>/httpcomponents-client-<x.x.x>-bin.tar.gz.asc
$ wget --server-response --no-verbose
<url_path>/httpcomponents-client-<x.x.x>-bin.tar.gz.md5
$ wget --server-response --no-verbose <url_path>/KEYS
(same with osgi library)
$ ls -l httpcomponents-client-<x.x.x>*.*
~
2) checking with md5sum and gpg
mf5sum -b httpcomponents-client-<x.x.x>-bin.tar.gz
cat httpcomponents-client-<x.x.x>-bin.tar.gz.md5
$ gpg --import KEYS
$ gpg --verify httpcomponents-client-<x.x.x>-bin.tar.gz.asc
$ gpg --verify httpcomponents-client-<x.x.x>-osgi-bin.tar.gz.asc
~
3) gunzipping the tar balls
~
tar xzvf httpcomponents-client-<x.x.x>-bin.tar.gz
tar xzvf httpcomponents-client-<x.x.x>-osgi-bin.tar.gz
~
4) setting the CLASSPATH
~
$ export HC_LIB_HOME="/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib"
$ echo $HC_LIB_HOME
/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib
$ ls -l $HC_LIB_HOME
total 1096
-rw-r--r-- 1 knoppix knoppix 232771 Apr 10 2012 commons-codec-1.6.jar
-rw-r--r-- 1 knoppix knoppix 60686 Dec 4 2011 commons-logging-1.1.1.jar
-rw-r--r-- 1 knoppix knoppix 21886 Jun 29 19:40 fluent-hc-<x.x.x>.jar
-rw-r--r-- 1 knoppix knoppix 427022 Jun 29 19:40 httpclient-<x.x.x>.jar
-rw-r--r-- 1 knoppix knoppix 115096 Jun 29 19:39 httpclient-cache-<x.x.x>.jar
-rw-r--r-- 1 knoppix knoppix 223374 Jun 10 15:13 httpcore-<x.x.x>.jar
-rw-r--r-- 1 knoppix knoppix 26598 Jun 29 19:40 httpmime-<x.x.x>.jar
$ export CLASSPATH="$HC_LIB_HOME/httpcore-<x.x.x>.jar:$HC_LIB_HOME/httpclient-<x.x.x>.jar:$HC_LIB_HOME/httpclient-cache-<x.x.x>.jar:$HC_LIB_HOME/commons-logging-1.1.1.jar:$HC_LIB_HOME/commons-codec-1.6.jar:$HC_LIB_HOME/fluent-hc-<x.x.x>.jar:$HC_LIB_HOME/httpmime-<x.x.x>.jar:."
$ echo $CLASSPATH
/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/httpcore-<x.x.x>.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/httpclient-<x.x.x>.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/httpclient-cache-<x.x.x>.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/commons-logging-1.1.1.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/commons-codec-1.6.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/fluent-hc-<x.x.x>.jar:/media/sdb1/inst/srcs/hc/bin/httpcomponents-client-<x.x.x>/lib/httpmime-<x.x.x>.jar:.
~
5) and compiling all examples
~
$ find /media/sdb1/prjx/kd/java/net/hc/examples -type f -name "*.java"
-print -exec javac {} \;
~
in order to test them
~
thanks
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Alexey Panchenko <al...@gmail.com>.
You should use instead of "javac" too.
Regards,
Alex
On Mon, Oct 15, 2012 at 9:10 AM, Albretch Mueller <lb...@gmail.com> wrote:
> > It is more common to let Maven deal with the dependency resolution
> ~
> but, as you could see, I used maven!
> ~
> lbrtchx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>
Re: missing library ...
Posted by Albretch Mueller <lb...@gmail.com>.
> It is more common to let Maven deal with the dependency resolution
~
but, as you could see, I used maven!
~
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2012-10-14 at 15:55 +0000, Albretch Mueller wrote:
> ~
> I am trying to locally (not connected to the Internet) build all
> "binary artifacts" (as you call them ;-)) necessary to run all of HC
> API's along with all their dependencies from source?
> ~
> The error I got was a little incomprehensible to me. I thought I was
> following to the letter the building instructions
The problem is clearly related to classpath setup. Some requisite
dependencies were apparently not on it. Unfortunately this is all I can
tell you, given I have never tried building every single HC dependency
from source. It is more common to let Maven deal with the dependency
resolution and let if fetch all dependencies in binary form for you.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Albretch Mueller <lb...@gmail.com>.
~
I am trying to locally (not connected to the Internet) build all
"binary artifacts" (as you call them ;-)) necessary to run all of HC
API's along with all their dependencies from source?
~
The error I got was a little incomprehensible to me. I thought I was
following to the letter the building instructions
~
thanks
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2012-10-14 at 08:52 +0000, Albretch Mueller wrote:
> or can you point me to from-source and local step-by-step intallation
> instructions?
> ~
> lbrtchx
>
Albretch
What is it exactly you are trying to do? Just build the latest SVN
snapshot of a particular module or build binary artifacts along with all
their dependencies from source?
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: missing library ...
Posted by Albretch Mueller <lb...@gmail.com>.
or can you point me to from-source and local step-by-step intallation
instructions?
~
lbrtchx
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org