I have not gotten TurbineSecurity.getAuthenticatedUser() to work.

Robert Lee <[email protected]> Thu, 04 Apr 2013 16:04:19 -0400
Newsgroups gmane.comp.jakarta.turbine.user
Message-ID <[email protected]>
--------------050301070708070608020200
Content-Type: multipart/alternative;
 boundary="------------030102030807010709030500"


--------------030102030807010709030500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Using Turbine-4 M1, Torque 3.3, and MySQL connector 5.1.21 running in 
Tomcat 7.0.39

I get an Exception, Failed to retrieve users, thrown from line 238 in 
TorqueUserManager.retrieveList()
when executing TurbineSecurity.getAuthenticatedUser("user");

When I try
criteria.clear();
         criteria.addSelectColumn("TURBINE_USER.LOGIN_NAME");
         List userList = TurbineUserPeer.doSelect(criteria);
  I get
com.workingdogs.village.DataSetException: Bad conversion: 
java.lang.NumberFormatException: For input string: "admin"
from the line
336    obj.setUserId(row.getValue(offset + 0).asInt());
in 329 public static void populateObject(Record row, int Offset, 
TurbineUser obj)
which is called from
296 public static TurbineUser row2Object(Record row,  int offset, Class cls)

TURBINE_USER is defined as
+----------------+-------------+------+-----+---------------------+-----------------------------+
| Field          | Type        | Null | Key | Default             | 
Extra                       |
+----------------+-------------+------+-----+---------------------+-----------------------------+
| USER_ID        | int(11)     | NO   | PRI | NULL                
|                             |
| LOGIN_NAME     | varchar(64) | NO   | UNI | NULL                
|                             |
| PASSWORD_VALUE | varchar(16) | NO   |     | NULL                
|                             |
| FIRST_NAME     | varchar(64) | NO   |     | NULL                
|                             |
| LAST_NAME      | varchar(64) | NO   |     | NULL                
|                             |
| EMAIL          | varchar(64) | YES  |     | NULL                
|                             |
| CONFIRM_VALUE  | varchar(16) | YES  |     | NULL                
|                             |
| MODIFIED       | timestamp   | NO   |     | CURRENT_TIMESTAMP   | on 
update CURRENT_TIMESTAMP |
| CREATED        | timestamp   | NO   |     | 0000-00-00 00:00:00 
|                             |
| LAST_LOGIN     | timestamp   | NO   |     | 0000-00-00 00:00:00 
|                             |
| OBJECTDATA     | mediumblob  | YES  |     | NULL                
|                             |
+----------------+-------------+------+-----+---------------------+-----------------------------+
11 rows in set (1.16 sec)b
and contains
+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+
| USER_ID | LOGIN_NAME   | PASSWORD_VALUE | FIRST_NAME | LAST_NAME | 
EMAIL | CONFIRM_VALUE | MODIFIED            | CREATED             | 
LAST_LOGIN          | OBJECTDATA |
+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+
|       1 | admin        | password       | Turbine    | Admin     | 
NULL  | NULL          | 2013-04-01 09:26:38 | 0000-00-00 00:00:00 | 
0000-00-00 00:00:00 | NULL       |
|       2 | user         | password       | Turbine    | User      | 
NULL  | NULL          | 2013-04-01 09:26:38 | 0000-00-00 00:00:00 | 
0000-00-00 00:00:00 | NULL       |
|       3 | TurbineUser1 | password       | Turbine    | Usera     | 
NULL  | NULL          | 2013-04-01 09:26:38 | 0000-00-00 00:00:00 | 
0000-00-00 00:00:00 | NULL       |
|       4 | TurbineUser2 | password       | Turbine    | Userb     | 
NULL  | NULL          | 2013-04-01 09:26:38 | 0000-00-00 00:00:00 | 
0000-00-00 00:00:00 | NULL       |
+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+
4 rows in set (0.01 sec)

I surmise that the row is being read incorrectly and that the first row 
(at least) did not include the USER_ID column. But it does convince me 
that I should be able to get to the database.  The problem I really want 
to solve is getAuthenticatedUser("user")

TR.props contains
services.SecurityService.classname=org.apache.turbine.services.security.torque.TorqueSecurityService
services.SecurityService.user.manager = 
org.apache.turbine.services.security.torque.TorqueUserManager



#services.SecurityService.user.class = 
org.apache.turbine.services.security.torque.TorqueUser
#services.SecurityService.group.class = 
org.apache.turbine.services.security.torque.TorqueGroup
#services.SecurityService.permission.class = 
org.apache.turbine.services.security.torque.TorquePermission
#services.SecurityService.role.class = 
org.apache.turbine.services.security.torque.TorqueRole

services.SecurityService.userPeer.class=org.apache.turbine.om.security.peer.TurbineUserPeer

Can some give me an some ideas on debugging this?



--------------030102030807010709030500
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Using Turbine-4 M1, Torque 3.3, and MySQL connector 5.1.21 running
    in Tomcat 7.0.39<br>
    <br>
    I get an Exception, Failed to retrieve users, thrown from line 238&nbsp;
    in TorqueUserManager.retrieveList()<br>
    when executing TurbineSecurity.getAuthenticatedUser("user");<br>
    <br>
    When I try<br>
    criteria.clear();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; criteria.addSelectColumn("TURBINE_USER.LOGIN_NAME");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; List userList = TurbineUserPeer.doSelect(criteria);<br>
    &nbsp;I get <br>
    com.workingdogs.village.DataSetException: Bad conversion:
    java.lang.NumberFormatException: For input string: "admin"<br>
    from the line<br>
    336&nbsp;&nbsp;&nbsp; obj.setUserId(row.getValue(offset + 0).asInt());<br>
    in 329 public static void populateObject(Record row, int Offset,
    TurbineUser obj)<br>
    which is called from <br>
    296 public static TurbineUser row2Object(Record row,&nbsp; int offset,&nbsp;
    Class cls)<br>
    <br>
    TURBINE_USER is defined as<br>
    <small><tt>+----------------+-------------+------+-----+---------------------+-----------------------------+</tt><tt><br>
      </tt><tt>| Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Null | Key |
        Default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Extra&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>+----------------+-------------+------+-----+---------------------+-----------------------------+</tt><tt><br>
      </tt><tt>| USER_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | int(11)&nbsp;&nbsp;&nbsp;&nbsp; | NO&nbsp;&nbsp; | PRI |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| LOGIN_NAME&nbsp;&nbsp;&nbsp;&nbsp; | varchar(64) | NO&nbsp;&nbsp; | UNI |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| PASSWORD_VALUE | varchar(16) | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| FIRST_NAME&nbsp;&nbsp;&nbsp;&nbsp; | varchar(64) | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| LAST_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | varchar(64) | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| EMAIL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | varchar(64) | YES&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| CONFIRM_VALUE&nbsp; | varchar(16) | YES&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| MODIFIED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | timestamp&nbsp;&nbsp; | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        CURRENT_TIMESTAMP&nbsp;&nbsp; | on update CURRENT_TIMESTAMP |</tt><tt><br>
      </tt><tt>| CREATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | timestamp&nbsp;&nbsp; | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; | 0000-00-00
        00:00:00 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| LAST_LOGIN&nbsp;&nbsp;&nbsp;&nbsp; | timestamp&nbsp;&nbsp; | NO&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; | 0000-00-00
        00:00:00 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>| OBJECTDATA&nbsp;&nbsp;&nbsp;&nbsp; | mediumblob&nbsp; | YES&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; |
        NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>+----------------+-------------+------+-----+---------------------+-----------------------------+</tt><tt><br>
      </tt><tt>11 rows in set (1.16 sec)</tt>b<br>
      <big>and contains</big><br>
      <tt>+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+</tt><tt><br>
      </tt><tt>| USER_ID | LOGIN_NAME&nbsp;&nbsp; | PASSWORD_VALUE | FIRST_NAME |
        LAST_NAME | EMAIL | CONFIRM_VALUE | MODIFIED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
        CREATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | LAST_LOGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | OBJECTDATA |</tt><tt><br>
      </tt><tt>+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+</tt><tt><br>
      </tt><tt>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 | admin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Turbine&nbsp;&nbsp;&nbsp; |
        Admin&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2013-04-01 09:26:38 |
        0000-00-00 00:00:00 | 0000-00-00 00:00:00 | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 | user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Turbine&nbsp;&nbsp;&nbsp; |
        User&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2013-04-01 09:26:38 |
        0000-00-00 00:00:00 | 0000-00-00 00:00:00 | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 | TurbineUser1 | password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Turbine&nbsp;&nbsp;&nbsp; |
        Usera&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2013-04-01 09:26:38 |
        0000-00-00 00:00:00 | 0000-00-00 00:00:00 | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 | TurbineUser2 | password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Turbine&nbsp;&nbsp;&nbsp; |
        Userb&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2013-04-01 09:26:38 |
        0000-00-00 00:00:00 | 0000-00-00 00:00:00 | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</tt><tt><br>
      </tt><tt>+---------+--------------+----------------+------------+-----------+-------+---------------+---------------------+---------------------+---------------------+------------+</tt><tt><br>
      </tt><tt>4 rows in set (0.01 sec)<br>
        <br>
        <big>I surmise that the row is being read incorrectly and that
          the first row (at least) did not include the USER_ID column.
          But it does convince me that I should be able to get to the
          database.&nbsp; The problem I really want to solve is
          getAuthenticatedUser("user")<br>
          <br>
          TR.props contains<br>
          <small>services.SecurityService.classname=org.apache.turbine.services.security.torque.TorqueSecurityService<br>
            services.SecurityService.user.manager =
            org.apache.turbine.services.security.torque.TorqueUserManager<br>
            <br>
            <br>
            <br>
            #services.SecurityService.user.class =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            org.apache.turbine.services.security.torque.TorqueUser<br>
            #services.SecurityService.group.class =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            org.apache.turbine.services.security.torque.TorqueGroup<br>
            #services.SecurityService.permission.class =
            org.apache.turbine.services.security.torque.TorquePermission<br>
            #services.SecurityService.role.class =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            org.apache.turbine.services.security.torque.TorqueRole<br>
            <br>
services.SecurityService.userPeer.class=org.apache.turbine.om.security.peer.TurbineUserPeer<br>
          </small><br>
          Can some give me an some ideas on debugging this?<br>
          <br>
          <br>
        </big></tt></small>
  </body>
</html>

--------------030102030807010709030500--


--------------050301070708070608020200
Content-Type: text/plain; charset=us-ascii


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--------------050301070708070608020200--