hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nigro, Joseph" <jni...@MassMutual.com>
Subject RE: org/apache/commons/logging/LogFactory NoClassDefFoundError
Date Mon, 02 Dec 2002 13:19:34 GMT
Adam, I used log4j and it works great, Thanks for your help.

Joe

-----Original Message-----
From: Adam Jack [mailto:ajack@TrySybase.com]
Sent: Friday, November 29, 2002 1:29 PM
To: 'Commons HttpClient Project'
Subject: RE: org/apache/commons/logging/LogFactory NoClassDefFoundError


Common Logging is a logging abstraction that allow a package like HttpClient
to put out log message (errors/informational/trace/debug) irrespective of
the logging infrastructure that you have in place.

	http://jakarta.apache.org/commons/logging.html

JDK 1.4 (which you are not using) has java.util.logging -- but JDK 1.3 and
before did not have anything. Back then (and still today) folks used log4j
(much nicer than JDK 1.4 logging IMHO) or Avalon LogKit (I've not used, but
it might be appropriate for your use case) or other similar logging
packages. See:

	http://jakarta.apache.org/log4j/docs/index.html
	http://jakarta.apache.org/avalon/index.html

Again ,the purpose of commons logging was to let folks write code like
HttpClient w/o getting all caught up with what logging package the user
wanted. At start-up commons logging goes looking for JDK 1.4 logging (which
it won't find in your environment) then it goes looking for others. I am
guessing that although you have commons logging (an abstraction) you do not
have an logging implementation that it can find. [Kinda like having JDBC but
with no JDBC driver.]

Either that, or although you have commons logging in your compile classpath
it isn't in your runtime one.

Good luck.

regards,

Adam
-----Original Message-----
From: Nigro, Joseph [mailto:jnigro@MassMutual.com]
Sent: Friday, November 29, 2002 9:06 AM
To: 'commons-httpclient-dev@jakarta.apache.org'
Subject: org/apache/commons/logging/LogFactory NoClassDefFoundError




	I'm going to apologize in advance for this one,, Anyone know why I
would be getting an exception: java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory for the code below when I try to run
this servlet, what is the HttpClient's  relationship to LogFactory ?
I put commons-logging.jar( I'm not sure why) in my class path along with
commons-httpclient.jar. Compiles fine, won't run in container under
Weblogic 5.1 Solaris 5.8, JDK 1.3.1_02

Thanks

	//******Imports************************
import org.apache.commons.httpclient.HttpClient;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
//******Imports************************

public class httptimeout extends HttpServlet {

	public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
  PrintWriter out = res.getWriter();
  out.println("ugh");

				//URL url = new URL("http://www.cnn.com");
                HttpClient client1 = new HttpClient();
                //client1.startSession(url);
                //HttpState hs = new HttpState();
                //hs = client1.getState();
                //resultSet = hs.toString();
                //client1.endSession();
                //client.setTimeout(3000);
                //HttpMethod method = new GetMethod();
                //method.setFollowRedirects(false);
                //method.setStrictMode(false);
		        //client.executeMethod(method);
				//sc = method.getStatusCode();


} //end of Do Get

}  //end of Servlet

----------------------------------------------------------------------------
--
This e-mail transmission may contain information that is proprietary,
privileged and/or confidential and is intended exclusively for the person(s)
to whom it is addressed. Any use, copying, retention or disclosure by any
person other than the intended recipient or the intended recipient's
designees is strictly prohibited. If you are not the intended recipient or
their designee, please notify the sender immediately by return e-mail and
delete all copies.


============================================================================
==


--
To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>


------------------------------------------------------------------------------
This e-mail transmission may contain information that is proprietary, privileged and/or confidential
and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention
or disclosure by any person other than the intended recipient or the intended recipient's
designees is strictly prohibited. If you are not the intended recipient or their designee,
please notify the sender immediately by return e-mail and delete all copies. 


==============================================================================


Mime
View raw message