log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.HttpClient).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.上面是报错信息,请问我该怎么办?
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.上面是报错信息,请问我该怎么办?
解决方案 »
- swing 鼠标滑过 显示提示信息
- 在linux环境下关于java获取进程PID的问题
- ACER待机问题!!!!!!
- 在学Timer,一个简单问题,请告诉小弟,谢谢
- 请大家看一下这个日历/备忘录文件怎么写?
- 有人写过优秀毕业生的材料吗
- 四级证对找工作影响有多大?
- a easy question about applet!3x!
- 为什么安装完JBuilder4.0后, ie 无法看见Applet生成的控件?
- 找不到合适的构造器
- 请教如何将上传的图片压缩为高清的缩略图?
- 求助!JSP用<%@ page import="oracle.jdbc.driver.OracleTypes" %>语句出现问题
是否调用了log4j.perproties?
public static void main(String[] args) throws IOException
{
HttpClient client = new HttpClient();
client.getHostConfiguration().setHost("www.imobile.com.cn", 80, "http");
HttpMethod method = getPostMethod();//使用POST方式提交数据
client.executeMethod(method);
//打印服务器返回的状态
System.out.println(method.getStatusLine());
//打印结果页面
String response = new String(method.getResponseBodyAsString().getBytes("8859_1"));
//打印返回的信息
System.out.println(response);
method.releaseConnection();
}
/**
* 使用GET方式提交数据
* @return
*/
private static HttpMethod getGetMethod(){
return new GetMethod("/simcard.php?simcard=1330227");
}
/**
* 使用POST方式提交数据
* @return
*/
private static HttpMethod getPostMethod(){
PostMethod post = new PostMethod("/simcard.php");
NameValuePair simcard = new NameValuePair("simcard","1330227");
post.setRequestBody(new NameValuePair[] { simcard});
return post;
}
}
应该就是这个,在src下面放log4j.properties,自己写一个或者网上copy一个