org.apache.catalina.core.StandardWrapperValve invoke 求解?

发布于 2022-09-05 02:13:03 字数 3969 浏览 17 评论 0

在使用IDEA 采用spring Hibernate springMVC 小web。实现登录功能的时候出现如下报错

六月 20, 2017 4:23:27 下午 org.apache.catalina.core.StandardWrapperValve invoke
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

相关代码如下:
jsp登陆表单

<form id="login-form" action="<%=path%>/user/login"  method="post" onsubmit="return checkLoginForm()">
        <div class="key">
            <input id="userName" name="userName" type="text" placeholder="请输入帐号">
        </div>
        <div class="key">
            <input id="password" name="password" type="password" placeholder="请输入密码">
        </div>
        <div class="Sign_up" ><a href="<%=path%>/user/signUp" style="color: #be2924">注册</a></div>
        <div class="signin">
            <input type="submit" value="login" id="submit">
        </div>
    </form>

loginController

@RequestMapping(value = "login",method = RequestMethod.POST)
    public String login(@RequestParam("userName") String userName,@RequestParam("password") String password, HttpSession session, RedirectAttributes attributes, WordDefined defined, CommonDate date, LogUtil logUtil, NetUtil netUtil, HttpServletRequest request){
        user = userService.selectUserByUserName(userName);
        if (user == null){
            attributes.addFlashAttribute("error",defined.LOGIN_USERID_ERROR);
            return "redirect:/login";
        }else {
            userInfo = userInfoService.getUserInfoByUserId(user.getUserid());
            if (!user.getPassword().equals(password)){
                attributes.addFlashAttribute("error",defined.LOGIN_PASSWORD_ERROR);
                return "redirect:/login";
            }else {
                if (!user.isStatus()){
                    attributes.addFlashAttribute("error",defined.LOGIN_USERID_DISABLED);
                    return "redirect:/login";
                }else {
                    logService.save(logUtil.setLog(user.getId(),userName,date.getTime24(),defined.LOG_TYPE_LOGIN,defined.LOG_DETAIL_USER_LOGIN,netUtil.getIpAddress(request)));
                    session.setAttribute("userid",user.getUserid());
                    session.setAttribute("username",userName);
                    session.setAttribute("login_status",true);
                    userInfo.setLastlogintime(date.getTime24());
                    userService.update(user);
                    attributes.addFlashAttribute("message",defined.LOGIN_SUCCESS);
                    return "redirect:/chat";
                }
            }
        }
    }

userIfoDAOImpl

    @Override
    public UserInfo getUserInfoByUserId(int userId) {
        String hql = "from UserInfo where UserInfo.userid= ?";
        return (UserInfo) this.getHibernateTemplate().find(hql, userId);
    }

userDAOImpl与userInfoDAOImpl类似

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文