You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Scott Eade <se...@backstagetech.com.au> on 2003/08/26 07:30:23 UTC
Torque Security Service - still experiencing problems
I am still experiencing problems with the Torque Security
Service. When turbine attempts to build an ACL it gets:
...
Caused by: org.apache.torque.TorqueException: Malformed column name in
Criteria join: 'USER_ID' is not of the form 'table.column'
at
org.apache.torque.util.BasePeer.throwMalformedColumnNameException(BasePeer.java:2576)
...
If I track this code back, the offending criteria is built
in RollPeerManager.retrieveSet() and the 'USER_ID' itself
is coming from UserPeerManager.getIdColumn().
UserPeerManager includes this:
nameColumn = (String) userPeerClass.getField(
(String) conf.getString(USER_NAME_COLUMN_KEY,
USER_NAME_COLUMN_DEFAULT)
).get(null);
idColumn = (String) userPeerClass.getField(
(String) conf.getString(USER_ID_COLUMN_KEY,
USER_ID_COLUMN_DEFAULT)
).get(null);
I show nameColumn as well as idColumn because a debug
statement I have added in my LoginUser thus:
log.debug("UserPeerManager.getIdColumn(): "
+ UserPeerManager.getIdColumn());
log.debug("UserPeerManager.getNameColumn(): "
+ UserPeerManager.getNameColumn());
produces this:
actions.LoginUser - UserPeerManager.getIdColumn(): USER_ID
actions.LoginUser - UserPeerManager.getNameColumn():
TURBINE_USER.LOGIN_NAME
I can't see how the UserPeerManager code is coming back
with 'USER_ID' instead of 'TURBINE_USER.USER_ID' and the
fact that getNameColumn() is coming back with the table name
only serves to add confusion. The reflection code in
UserPeerManager should be retrieving the folowing fromBaseTurbineUserPeer:
USER_ID = "TURBINE_USER.USER_ID";
LOGIN_NAME = "TURBINE_USER.LOGIN_NAME";
My TR.props only defines my custom user peer thus (no other
services.SecurityService.torque.* properties are defined):
services.SecurityService.torque.userPeer.class =
com.backstagetech.cmes.om.TurbineUserPeer
Though the following SecurityService properties are defined:
services.SecurityService.user.manager =
org.apache.turbine.services.security.torque.TorqueUserManager
services.SecurityService.user.class = com.backstagetech.cmes.om.CmesUser
services.SecurityService.group.class =
org.apache.turbine.services.security.torque.TorqueGroup
services.SecurityService.role.class =
org.apache.turbine.services.security.torque.TorqueRole
services.SecurityService.permission.class =
org.apache.turbine.services.security.torque.TorquePermission
services.SecurityService.acl.class =
org.apache.turbine.util.security.TurbineAccessControlList
services.SecurityService.userPeer.class =
com.backstagetech.cmes.om.TurbineUserPeer
Can somebody spot something wrong with my configuration?
Thanks,
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
Re: Torque Security Service - still experiencing problems
Posted by Scott Eade <se...@backstagetech.com.au>.
For some reason I had my TurbineUserPeer class implement
org.apache.turbine.om.security.peer.UserPeer - not really
a good idea since it is from the old DBSecurityService
and it just happens to define:
static String USER_ID = "USER_ID";
This explains the behaviour I experienced.
After eliminating the implements UserPeer my application
now fires up successfully and my extended user code
appears to be working correctly.
I am _very_ pleased that this is now working.
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
Scott Eade wrote:
> I am still experiencing problems with the Torque Security
> Service. When turbine attempts to build an ACL it gets:
>
> ...
> Caused by: org.apache.torque.TorqueException: Malformed column name in
> Criteria join: 'USER_ID' is not of the form 'table.column'
> at
> org.apache.torque.util.BasePeer.throwMalformedColumnNameException(BasePeer.java:2576)
>
> ...
>
> If I track this code back, the offending criteria is built
> in RollPeerManager.retrieveSet() and the 'USER_ID' itself
> is coming from UserPeerManager.getIdColumn().
>
> UserPeerManager includes this:
>
> nameColumn = (String) userPeerClass.getField(
> (String) conf.getString(USER_NAME_COLUMN_KEY,
> USER_NAME_COLUMN_DEFAULT)
> ).get(null);
>
> idColumn = (String) userPeerClass.getField(
> (String) conf.getString(USER_ID_COLUMN_KEY,
> USER_ID_COLUMN_DEFAULT)
> ).get(null);
>
> I show nameColumn as well as idColumn because a debug
> statement I have added in my LoginUser thus:
>
> log.debug("UserPeerManager.getIdColumn(): "
> + UserPeerManager.getIdColumn());
> log.debug("UserPeerManager.getNameColumn(): "
> + UserPeerManager.getNameColumn());
>
> produces this:
>
> actions.LoginUser - UserPeerManager.getIdColumn(): USER_ID
> actions.LoginUser - UserPeerManager.getNameColumn():
> TURBINE_USER.LOGIN_NAME
>
> I can't see how the UserPeerManager code is coming back
> with 'USER_ID' instead of 'TURBINE_USER.USER_ID' and the
> fact that getNameColumn() is coming back with the table name
> only serves to add confusion. The reflection code in
> UserPeerManager should be retrieving the folowing
> fromBaseTurbineUserPeer:
>
> USER_ID = "TURBINE_USER.USER_ID";
> LOGIN_NAME = "TURBINE_USER.LOGIN_NAME";
>
> My TR.props only defines my custom user peer thus (no other
> services.SecurityService.torque.* properties are defined):
>
> services.SecurityService.torque.userPeer.class =
> com.backstagetech.cmes.om.TurbineUserPeer
>
> Though the following SecurityService properties are defined:
>
> services.SecurityService.user.manager =
> org.apache.turbine.services.security.torque.TorqueUserManager
> services.SecurityService.user.class =
> com.backstagetech.cmes.om.CmesUser
> services.SecurityService.group.class =
> org.apache.turbine.services.security.torque.TorqueGroup
> services.SecurityService.role.class =
> org.apache.turbine.services.security.torque.TorqueRole
> services.SecurityService.permission.class =
> org.apache.turbine.services.security.torque.TorquePermission
> services.SecurityService.acl.class =
> org.apache.turbine.util.security.TurbineAccessControlList
> services.SecurityService.userPeer.class =
> com.backstagetech.cmes.om.TurbineUserPeer
>
> Can somebody spot something wrong with my configuration?
>
> Thanks,
>
> Scott
Re: Torque Security Service - still experiencing problems
Posted by Scott Eade <se...@backstagetech.com.au>.
Any chance of a reply to my message below?
Thanks,
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
Scott Eade wrote:
> I am still experiencing problems with the Torque Security
> Service. When turbine attempts to build an ACL it gets:
>
> ...
> Caused by: org.apache.torque.TorqueException: Malformed column name in
> Criteria join: 'USER_ID' is not of the form 'table.column'
> at
> org.apache.torque.util.BasePeer.throwMalformedColumnNameException(BasePeer.java:2576)
>
> ...
>
> If I track this code back, the offending criteria is built
> in RollPeerManager.retrieveSet() and the 'USER_ID' itself
> is coming from UserPeerManager.getIdColumn().
>
> UserPeerManager includes this:
>
> nameColumn = (String) userPeerClass.getField(
> (String) conf.getString(USER_NAME_COLUMN_KEY,
> USER_NAME_COLUMN_DEFAULT)
> ).get(null);
>
> idColumn = (String) userPeerClass.getField(
> (String) conf.getString(USER_ID_COLUMN_KEY,
> USER_ID_COLUMN_DEFAULT)
> ).get(null);
>
> I show nameColumn as well as idColumn because a debug
> statement I have added in my LoginUser thus:
>
> log.debug("UserPeerManager.getIdColumn(): "
> + UserPeerManager.getIdColumn());
> log.debug("UserPeerManager.getNameColumn(): "
> + UserPeerManager.getNameColumn());
>
> produces this:
>
> actions.LoginUser - UserPeerManager.getIdColumn(): USER_ID
> actions.LoginUser - UserPeerManager.getNameColumn():
> TURBINE_USER.LOGIN_NAME
>
> I can't see how the UserPeerManager code is coming back
> with 'USER_ID' instead of 'TURBINE_USER.USER_ID' and the
> fact that getNameColumn() is coming back with the table name
> only serves to add confusion. The reflection code in
> UserPeerManager should be retrieving the folowing
> fromBaseTurbineUserPeer:
>
> USER_ID = "TURBINE_USER.USER_ID";
> LOGIN_NAME = "TURBINE_USER.LOGIN_NAME";
>
> My TR.props only defines my custom user peer thus (no other
> services.SecurityService.torque.* properties are defined):
>
> services.SecurityService.torque.userPeer.class =
> com.backstagetech.cmes.om.TurbineUserPeer
>
> Though the following SecurityService properties are defined:
>
> services.SecurityService.user.manager =
> org.apache.turbine.services.security.torque.TorqueUserManager
> services.SecurityService.user.class =
> com.backstagetech.cmes.om.CmesUser
> services.SecurityService.group.class =
> org.apache.turbine.services.security.torque.TorqueGroup
> services.SecurityService.role.class =
> org.apache.turbine.services.security.torque.TorqueRole
> services.SecurityService.permission.class =
> org.apache.turbine.services.security.torque.TorquePermission
> services.SecurityService.acl.class =
> org.apache.turbine.util.security.TurbineAccessControlList
> services.SecurityService.userPeer.class =
> com.backstagetech.cmes.om.TurbineUserPeer
>
> Can somebody spot something wrong with my configuration?
>
> Thanks,
>
> Scott