应该URL路径有问题吧
SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception
SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception
解决方案 »
- JFreechart中Marker的Label可以垂直显示吗?
- 关于servlet doFilter方法
- 各位大侠,怎么把数据库里的内容写到Label里去呢?
- Error listenerStart项目报404错误
- 设置下拉框的默认值
- spring的版本号码是什么意思?
- 求简单教学管理系统
- 用hibernate执行distinct报错!!!!
- ...,VCS,CVS,PVCS?
- 下面有段源程序,有几个概念搞混淆,请指点谢谢!
- jdbc如何使用 Insert into Table2 select ,SELECT vale1和 value2 into Table2 from Table1
- 救急!哪位有birt报表汉化包没有?
org.apache.catalina.core.StandardWrapperValve invoke
今天写代码,竟然接连遇到这个异常好几次。debug几个小时才弄明白,晕。
上网找了些拼凑下做个总结,不保证准确无误,记下来仅供参考。
以下是错误原因:
1.servlet或jsp中,重复调用response的 getOutputStream(),response.getWriter()方法
2.form表单里没有 method="post" action=""参数
3.看JDBC操纵数据库的代码,仔细看,例如调用的对象的属性为null。
Connection conn=null; 之后之就调用了conn.??的方法
我就时错在这里
仅供参考!
我猜测 Ajax请求之后, response.getWriter()获取PrintWriter 写数据之后没有关闭。。然后1w次的请求,会报10次左右的这种错,,这其实蛮正常的。。
至于蛮正常的是什么意思,是指不担心吗
public InputStream sendResultRequestGet(String requestAddress, String JSESSIONID) throws XCFH_CheckException { InputStream in = null;
try {
System.out.println("requestAddress = " + requestAddress);
URL url = new URL(requestAddress);
HttpURLConnection httpconection = (HttpURLConnection) url.openConnection();
httpconection.setDoInput(true);
httpconection.setDoOutput(true);
httpconection.setRequestMethod("GET");
httpconection.setUseCaches(false);
httpconection.setRequestProperty("User-Agent",
"Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.9) Gecko/20100827 Red Hat/3.6.9-2.el6 Firefox/3.6.9 ");
System.out.println(JSESSIONID + "; path=/");
httpconection.setRequestProperty("Cookie", "JSESSIONID=" + JSESSIONID + "; path=/");
System.out.println("in大小 = " + in.available());
in = httpconection.getInputStream();//获取发票验真返回信息
return in;
} catch (Exception e) {
// TODO: handle exception
throw new XCFH_CheckException(requestAddress, e);
}
}
向上面的打印信息就是错误原因,因为还没去请求得到响应信息就打印流大小,当然会报错,应该在接收完响应信息后再去打印流的大小就不会报错了