2015-10-27 130 views
0

這是我在Console中獲得的HQL查詢。我在登錄時收到「org.springframework.security.authentication.BadCredentialsException」。登錄時我使用了正確的憑據。我是HQL查詢語言的新手。需要幫助,謝謝如何將執行的HQL查詢轉換爲SQL查詢

--- HQL AST --- 
    \-[QUERY] Node: 'query' 
     +-[SELECT_FROM] Node: 'SELECT_FROM' 
     | +-[FROM] Node: 'from' 
     | | \-[RANGE] Node: 'RANGE' 
     | |  +-[DOT] Node: '.' 
     | |  | +-[DOT] Node: '.' 
     | |  | | +-[DOT] Node: '.' 
     | |  | | | +-[DOT] Node: '.' 
     | |  | | | | +-[IDENT] Node: 'com' 
     | |  | | | | \-[IDENT] Node: 'mindfiresolutions' 
     | |  | | | \-[IDENT] Node: 'springmaven' 
     | |  | | \-[IDENT] Node: 'models' 
     | |  | \-[IDENT] Node: 'Employee' 
     | |  \-[ALIAS] Node: 'generatedAlias0' 
     | \-[SELECT] Node: 'select' 
     |  \-[IDENT] Node: 'generatedAlias0' 
     \-[WHERE] Node: 'where' 
      \-[EQ] Node: '=' 
       +-[DOT] Node: '.' 
       | +-[IDENT] Node: 'generatedAlias0' 
       | \-[IDENT] Node: 'employeeUserName' 
       \-[COLON] Node: ':' 
       \-[IDENT] Node: 'param0' 
+1

和異常無關,與JPQL被調用,也不是JPA API ...只是看它的堆棧跟蹤和它的消息! –

回答

1

問題可能正是它聽起來像,你使用錯誤的憑據連接。不知道更多關於你的應用程序(你運行的是什麼類型或如何運行),很難確定,但我建議看看你的連接配置,以確保所有事情都應該如此。

來自api:BadCredentialsException是「如果認證請求因爲憑證無效而被拒絕,則拋出該異常,這意味着該帳戶既不被鎖定也不被禁用。

https://docs.spring.io/spring-security/site/docs/current/apidocs/org/springframework/security/authentication/BadCredentialsException.html