嵌套异常是org.hibernate.exception.SQLGrammarException:无法提取ResultSet - Hibernate

时间:2016-10-07 14:47:17

标签: java linux spring postgresql hibernate

在我的spring-boot应用程序中,我有一个登录jsp页面,我可以使用postgres db本地从Windows成功登录。在构建war文件并部署到linux时,我在尝试登录时从浏览器中收到此错误

There was an unexpected error (type=Internal Server Error, status=500).
could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

这是我的application.properties文件中的配置

db.driver: org.postgresql.Driver
db.url: jdbc:postgresql://localhost:5432/dbName
db.username: dbUsername
db.password: password4321
hibernate.dialect: org.hibernate.dialect.PostgreSQL9Dialect
hibernate.show_sql: true
hibernate.hbm2ddl.auto: update

点击表单的提交按钮,它会点击此控制器

@RequestMapping(value = "/login", method = RequestMethod.POST)
    public ModelAndView authenticateLogin(HttpServletRequest request,
                                   HttpServletResponse response,
                                   @RequestParam String email,
                                   @RequestParam String password) {

        if(null == request.getSession().getAttribute(data))
        {

            //fetch the list of logins
            List add =  _loginDao.getAllUsernameByEmail(email);
            //fetch the list of support password
            List passList = _loginDao.getAllUserPassword(password);

EDITTED:这是我在wwindows上使用的hql查询

public List <Login> getAllUsernameByEmail(String email)
    {

        String hql = "select a.email from Login a WHERE a.email = :email AND a.active = true";
        return _sessionFactory.getCurrentSession().createQuery(hql).setParameter("email", email).list();

    }
    public List <Login> getAllUserPassword(String password)
    {

        String hql = "select a.password from Login a WHERE a.password = :password AND a.active = true";
        return _sessionFactory.getCurrentSession().createQuery(hql).setParameter("password", password).list();

    }

请问可能出错?

0 个答案:

没有答案