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 Bashiro <ba...@enter.vg> on 2005/06/21 23:10:02 UTC
RE: Where to start- HttpClient--Thanks
Thanks GUS!
I followed what you just explained. And I downloaded the logging
and added it to the class path and that's it.
I will take my time and read through the HttpClient (api and or the
documentation) very carefully in other to adopt the system sooner. Since I
am now able to run the tutorials, it will be easier for me to impliment it
in my applications.
Once again thanks a lot
bashiro
> It's not a log file, it's a logging library. It's a dependency:
> HttpClient could have reinvented the wheel and created it's own log, or
> used
> one someone else had created. They chose (wisely, IMHO) the latter.
>
> Summary: You have to download a binary distribution from
> http://jakarta.apache.org/commons/logging/ and extract the
> commons-logging.jar and add it to the classpath. You MIGHT have to do the
> same for commons-codec. I don't think it's used just for authentication,
> but rather to convert the received bytestreams into Strings.
>
> I DO wish they would provide a version for the dependencies along with
> one
> of their distributions... would have made your life easier. But I guess
> it
> doesn't work that way when you use Maven (I'm not going to get into the
> un-merits of maven).
>
> []s Gus
>
>
>
> -----Original Message-----
> From: Bashiro [mailto:bashiro@enter.vg]
> Sent: June 21, 2005 2:19 PM
> To: HttpClient User Discussion
> Subject: RE: Where to start- HttpClient
>
>
> There is no any folder called distrib under the HttpClient.
> Am I downloading the wrong file or what ?
> Secondly I thought I only need a codec when doing authentication.
> And why can't the HttpClient find it's own log or ignore when it cannot
> find any ? in other words run without a log file ?
>
> I wiull try to read through the codecs and see if that might help.
> Or I just have to wait for the next update as Oleg pointed out earliar.
>
> bashiro
>
>
>> You're missing commons-logging, not log4j. Log4j is not a dependency.
>> Check http://jakarta.apache.org/commons/logging/ if you can't find the
>> jar
>> in the HttpClient distrib. Oleg pointed that you might need
>> Commons-codec
>> as well (http://jakarta.apache.org/commons/codec/).
>>
>>
>> []s Gus
>>
>>
>> -----Original Message-----
>> From: Bashiro [mailto:bashiro@enter.vg]
>> Sent: June 21, 2005 1:39 PM
>> To: HttpClient User Discussion
>> Subject: RE: Where to start- HttpClient
>>
>>
>> I have log4j in my class path correctly.
>> And when debugged my project no any errors.
>> But when I try to run the examples I get;
>>
>> For Tutorial 1(HttpClientTutorial):
>> ======================================
>> java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>>
>> For tutorial 2. (BasicAuthenticationExample)
>> =================================================
>> java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>>
>> I run the tutorial as is; without changing any code.
>>
>> below is my class path which is correct as jbuilder doese it all:
>> ================================================================
>> D:\JBuilderX\jdk1.4\bin\javaw -classpath "C:\Documents and
>> Settings\bashiro\jbproject\Jakata_Commons\classes;C:\Documents and
>>
> Settings\bashiro\Desktop\commons-httpclient-2.0.2\commons-httpclient-2.0.2.j
>>
> ar;C:\log4j2\logging-log4j-1.2.9\dist\classes;C:\log4j2\logging-log4j-1.2.9\
>>
> dist\lib\log4j-1.2.9.jar;D:\JBuilderX\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;D
>>
> :\JBuilderX\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;D:\JBuilderX\jdk1.4\
>>
> jre\javaws\javaws.jar;D:\JBuilderX\jdk1.4\jre\lib\charsets.jar;D:\JBuilderX\
>>
> jdk1.4\jre\lib\ext\dnsns.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\ldapsec.jar;D:\
>>
> JBuilderX\jdk1.4\jre\lib\ext\localedata.jar;D:\JBuilderX\jdk1.4\jre\lib\ext\
>>
> sunjce_provider.jar;D:\JBuilderX\jdk1.4\jre\lib\im\indicim.jar;D:\JBuilderX\
>>
> jdk1.4\jre\lib\im\thaiim.jar;D:\JBuilderX\jdk1.4\jre\lib\jce.jar;D:\JBuilder
>>
> X\jdk1.4\jre\lib\jsse.jar;D:\JBuilderX\jdk1.4\jre\lib\plugin.jar;D:\JBuilder
>>
> X\jdk1.4\jre\lib\rt.jar;D:\JBuilderX\jdk1.4\jre\lib\sunrsasign.jar;D:\JBuild
>>
> erX\jdk1.4\lib\dt.jar;D:\JBuilderX\jdk1.4\lib\htmlconverter.jar;D:\JBuilderX
>> \jdk1.4\lib\tools.jar"
>> jakata_commons.BasicAuthenticationExample
>>
>>
>> Hope someone can point out something
>> Thanks to you all
>> bashiro
>>
>>
>>> Ok thanks Gus.
>>> I will look at it again and see how
>>> the outcome turns.
>>> Thanks again
>>>
>>> bashiro
>>>
>>>
>>>
>>>> I take that back, the only dependency, according to the website, is
>>>> commons-logging.
>>>>
>>>> []s Gus
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Gustavo Hexsel [mailto:ghexsel@sagebrushcorp.com]
>>>> Sent: June 20, 2005 3:53 PM
>>>> To: 'HttpClient User Discussion'
>>>> Subject: RE: Where to start- HttpClient
>>>>
>>>>
>>>> You're missing some of the dependencies. There are quite a few jars
>>>> you
>>>> have to have in your classpath. For now, I can tell it does not
>>>> contain
>>>> commons-logging*.jar or similar.
>>>>
>>>>
>>>> []s Gus
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Bashiro [mailto:bashiro@enter.vg]
>>>> Sent: June 20, 2005 3:51 PM
>>>> To: HttpClient User Discussion
>>>> Subject: RE: Where to start- HttpClient
>>>>
>>>>
>>>> Thanks for the help.
>>>> You guessed right about the log4j. I am running the basic tutorial.
>>>> I get the error below:
>>>> But in the user guide they said if you do not configure for log4j,
>>>> then the HttpClient will use it's default log.
>>>> But it does not.
>>>> Thanks again
>>>>
>>>>
>>>>
>>>> java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
>>>> at
>>>> org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:69)
>>>> at
>>>>
>>
> jakata_commons.BasicAuthenticationExample.main(BasicAuthenticationExample.ja
>>>> va:27)
>>>> Exception in thread "main"
>>>>
>>>>
>>>>> Send the output your getting. I'm guessing you're having trouble
>>>>> configuring log4j or java.logging.
>>>>>
>>>>> []s Gus
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Bashiro [mailto:bashiro@enter.vg]
>>>>> Sent: June 20, 2005 2:44 PM
>>>>> To: HttpClient User Discussion
>>>>> Subject: Where to start- HttpClient
>>>>>
>>>>>
>>>>> Hello folks,
>>>>>
>>>>> I wanted someone to point to me a good example or
>>>>> how to get into HttpClient.
>>>>>
>>>>> My problem is;
>>>>> I use HttpClient from innovation.ch , this package has limitations
>>>>> and someone advice me to use Commons httpclient.
>>>>> Now I downloaded this httpclient (commons) but cannot run the
>>>>> example.
>>>>> I
>>>>> always get errors pointing to the log. I am using Jbuilder X
>>>>> enterprise
>>>>> edition.
>>>>>
>>>>> So I will be glad if someone has a good skeleton as an example for me
>>>>> to
>>>>> get
>>>>> started. even if it's hello world as an example.
>>>>>
>>>>>
>>>>> bashiro
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>>> httpclient-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> httpclient-user-help@jakarta.apache.org
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>>>>> httpclient-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> httpclient-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> httpclient-user-help@jakarta.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> httpclient-user-help@jakarta.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> httpclient-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> httpclient-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org