应该URL路径有问题吧
SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception

解决方案 »

  1.   

    response 响应无效,把servlet代码贴出来看看,,最好自己手动调试,找原因、、、
      

  2.   


    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次左右的这种错,,这其实蛮正常的。。
      

  3.   

    确实应该是第一种,验证码我自己写的,重复调用response的 getOutputStream(),response.getWriter()方法
    至于蛮正常的是什么意思,是指不担心吗
      

  4.   

    可能是你还没去请求得到响应信息就会出现这种原因
    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);
    }
    }
    向上面的打印信息就是错误原因,因为还没去请求得到响应信息就打印流大小,当然会报错,应该在接收完响应信息后再去打印流的大小就不会报错了