hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <http-as...@dubioso.net>
Subject Re: commons logging in httpclient
Date Tue, 23 May 2006 16:53:58 GMT
Hello Jon,

> is there an easy way in httpclient to get rid of commons logging
> dependencies?

No. Unless you want to modify all source code and compile your own
version of HttpClient, that is.

> i'd ideally like to include a stub jar or something since i'm using
> httpclient in an applet.

In that JAR, you should put:
- all commons logging classes
- your custom implementation of the o.a.c.l.Log class
- a properties file named commons-logging.properties
  that configures your implementation of ...Log

http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#Configuration

(alternatively, don't use your own ...Log class but
 configure the SimpleLog in the properties file)

> even with this:
> 
>         System.setProperty("org.apache.commons.logging.Log",
>                "org.apache.commons.logging.impl.SimpleLog");

Don't set system properties if you don't have to. Are you sure
that the applet is allowed to do that in the first place? Are
you sure that your code is executed before HttpClient classes
are referenced? It's a static configuration you want, so use a
static properties file.

> i get requests to the server for a number of class files that do not exist
> from the
> applet classloader

Try the above. If you still get these requests, please post a
list of class names so we have a clue about what's happening.
Right now, I suspect that your code does not set the system
property in time. The default mechanism of commons logging
will then check for the presence of a few classes to select a
default implementation.

> i thought i would ask the
> httpclient experts
> first.

Actually, you might have asked the commons logging experts first.
>From our logging guide, first section:

http://jakarta.apache.org/commons/httpclient/logging.html
> If it fails to select the expected one, you must configure
> Commons Logging by hand. Please refer to the Commons Logging
> documentation for more information.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message