Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B9DC11A39 for ; Tue, 15 Apr 2014 13:44:21 +0000 (UTC) Received: (qmail 82798 invoked by uid 500); 15 Apr 2014 13:44:20 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 81828 invoked by uid 500); 15 Apr 2014 13:44:17 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 81802 invoked by uid 99); 15 Apr 2014 13:44:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2014 13:44:15 +0000 Date: Tue, 15 Apr 2014 13:44:15 +0000 (UTC) From: "Mike Hummel (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KARAF-2913) JAAS JDBCBackingEngine has the wrong condition to iterate results, no users are returned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Mike Hummel created KARAF-2913: ---------------------------------- Summary: JAAS JDBCBackingEngine has the wrong condition to iterate results, no users are returned Key: KARAF-2913 URL: https://issues.apache.org/jira/browse/KARAF-2913 Project: Karaf Issue Type: Bug Components: karaf-security Affects Versions: 3.0.0 Reporter: Mike Hummel In the library org.apache.karaf.jaas.modules in JDBCBackingEngine in line 195 is the following code: while (!usersResultSet.next()) { this should be while (usersResultSet.next()) { to iterate the results of the query. An empty USERS table causes the following error - as estimated: java.sql.SQLException: Illegal operation on empty result set. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:841) at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5650) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5570) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5610) at org.apache.karaf.jaas.modules.jdbc.JDBCBackingEngine.listUsers(JDBCBackingEngine.java:196) at org.apache.karaf.jaas.command.ListUsersCommand.doExecute(ListUsersCommand.java:59) at org.apache.karaf.jaas.command.ListUsersCommand.doExecute(ListUsersCommand.java:54) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33) ... You have the same issue in line 245: while (!rolesResultSet.next()) { -- This message was sent by Atlassian JIRA (v6.2#6252)