Failed to load resource: the server responded with a status of 500 ()

我在eclipse中写了一个javaweb项目,运行没有问题。传到了阿里云上之后,在其tomcat下运行,

img

登录时发现出现以下错误:
Failed to load resource: the server responded with a status of 500 ()

img

然后打开错误代码(jquery.min.js里的):
错的是这句:a.send(n.hasContent && n.data || null),

img

我的登录ajax:

$("#submitBtn").click(function(){
            var data = $("#form").serialize();
            $.ajax({
                type: "post",
                url: "LoginServlet?method=Login",
                data: data, 
                dataType: "text", //返回数据类型
                success: function(msg){
                    if("vcodeError" == msg){
                        $.messager.alert("消息提醒", "验证码错误!", "warning");
                        $("#vcodeImg").click();//切换验证码
                        $("input[name='vcode']").val("");//清空验证码输入框
                    } else if("loginError" == msg){
                        $.messager.alert("消息提醒", "用户名或密码错误!", "warning");
                        $("#vcodeImg").click();//切换验证码
                        $("input[name='vcode']").val("");//清空验证码输入框
                    } else if("loginSuccess" == msg){
                        window.location.href = "SystemServlet?method=toAdminView";
                    } else{
                        alert(msg);
                    } 
                }
                
            });
        });

项目在本地运行没有问题,项目是打包war然后加到服务器Tomcat里面去了,在服务器运行就这样了,DL们有没有什么好的解决办法。。

我在网上翻过相关资料,说是调用日期时日期分秒字段为空,我也没有调用日期啊 😭

500是服务后台报错了。你要看下日志。

(AdminDao.java:18)

public Admin login(String name ,String password){
        String sql = "select * from s_admin where name = '" + name + "' and password = '" + password + "'";
        ResultSet resultSet = query(sql);
        try {
            if(resultSet.next()){
                Admin admin = new Admin();
                admin.setId(resultSet.getInt("id"));
                admin.setName(resultSet.getString("name"));
                admin.setPassword(resultSet.getString("password"));
                admin.setStatus(resultSet.getInt("status"));
                return admin;
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }