ajax请求不成功,总是500错误

这是AJAX代码

$.ajax({
                 url:"searchTip",
                 type:"GET",
                 data:{"word":$("#a").val()},
                 dataType:"json",
                 complete:function(){
                     alert("fuck");
                 },
                 success:function (data){
                     alert(data[0]);
                 }
             })

Servlet代码

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String keyword = req.getParameter("word");
        CatalogService catalogService=new CatalogService();
        List<Product> list=catalogService.searchProductList(keyword);
        resp.setContentType("application/json;charset=utf-8");
        PrintWriter out= resp.getWriter();
        JSONArray json=JSONArray.fromObject(list);
        out.print(json.toString());
        out.flush();
        out.close();
    }

 

500证明服务器端有问题,可以把java错误日志发出来。

 

怎么看java错误日志呢。。

是用tomat吗?