Technote

(troubleshooting)
java.lang.NumberFormatException For input string OrgAndAncestorOrgs thrown after modifying an Access Role
Problem(Abstract)
You see the following exception in the SystemOut.log after you modify an access role:

CommerceSrvr E com.ibm.commerce.command.ECCommandTarget executeCommand CMN0420E: The following command exception has occurred during processing: "java.lang.NumberFormatException: For input string: "OrgAndAncestorOrgs"".java.lang.NumberFormatException: For input string: "OrgAndAncestorOrgs"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:63)
at java.lang.Long.parseLong(Long.java:408)
at java.lang.Long.<init>(Long.java:644)
at com.ibm.commerce.membergroup.commands.CheckUserInMemberGroupCmdImpl.evaluateRoleCondition(CheckUserInMemberGroupCmdImpl.java:1434)
at com.ibm.commerce.membergroup.commands.CheckUserInMemberGroupCmdImpl.evaluate(CheckUserInMemberGroupCmdImpl.java:527)
at com.ibm.commerce.membergroup.commands.CheckCurrentUserInMemberGroupCmdImpl.evaluate(CheckCurrentUserInMemberGroupCmdImpl.java:328)
at com.ibm.commerce.condition.SimpleCondition.evaluate(SimpleCondition.java:213)
at com.ibm.commerce.condition.OrListCondition.evaluate(OrListCondition.java:87)
at com.ibm.commerce.condition.AndListCondition.evaluate(AndListCondition.java:89)
at com.ibm.commerce.membergroup.commands.CheckCurrentUserInMemberGroupCmdImpl.evaluateSegment(CheckCurrentUserInMemberGroupCmdImpl.java:281)
at com.ibm.commerce.membergroup.commands.CheckCurrentUserInMemberGroupCmdImpl.performExecute(CheckCurrentUserInMemberGroupCmdImpl.java:225)
at com.ibm.commerce.command.ECCommandTarget.executeCommand(ECCommandTarget.java:161)
at com.ibm.ws.cache.command.CommandCache.executeCommand(CommandCache.java:335)
at com.ibm.websphere.command.CacheableCommandImpl.execute(CacheableCommandImpl.java:168)
at com.ibm.commerce.command.AbstractECTargetableCommand.execute(AbstractECTargetableCommand.java:180)
at com.ibm.commerce.accesscontrol.policymanager.PolicyManagerImpl.checkUserInUserGroup(PolicyManagerImpl.java:120)
at com.ibm.commerce.accesscontrol.policymanager.PolicyManagerImpl.isTemplatePolicyApplicableForAnyParent(PolicyManagerImpl.java:1551)
at com.ibm.commerce.accesscontrol.policymanager.PolicyManagerImpl.evaluatePolicy(PolicyManagerImpl.java:416)
at com.ibm.commerce.accesscontrol.policymanager.PolicyManagerImpl.isExecutionAllowed(PolicyManagerImpl.java:1457)
at com.ibm.commerce.accesscontrol.policymanager.PolicyManagerImpl.isAllowed(PolicyManagerImpl.java:1202)
at com.ibm.commerce.accesscontrol.AccManager.isAllowed(AccManager.java:576)
at com.ibm.commerce.accesscontrol.AccManager.isActionAllowed(AccManager.java:477)
..
Cause A membergroup condition contains a nested condition. Diagnosing the problem

  1. Enable WC_ACCESSCONTROL traces to identify the Policy which causes the error.

  2. Once the error is reproduced, locate the exception in the trace.log file.

  3. Search upward from the error in the log to find the Policy which was being evaluated that caused the error.
    For example, the text you may see in the traces will be:
    Evaluating PolicyName: B2CCSAViewUsersForOrgExecuteB2CCSAViewActionsOnStoreEntityResource

  4. Once the policy name is identified, review the implicit conditions defined for this membrgroup
    The following SQL can be used to gather this data from the database:
    select conditions from mbrgrpcond, acpolicy where policyname='<policy_name>' and acpolicy.mbrgrp_id=mbrgrpcond.mbrgrp_id

Resolving the problem Update the condition so that it does not include a nested list. Also, apply WebSphere Commerce 6.0.0.4 (or newer) to prevent this type of structure from being created using the Organization Administration Console. Fix Pack 6.0.0.4 (or newer) can be obtained from the WebSphere Commerce Fixes by version page.


Additional information
When evaluating the access control policies to grant access to a particular action and resource, WebSphere Commerce will also evaluate the applicable membergroup (access group) to see if the user belongs to this group. The evaluation of these groups is done by the Policy Manager. The Policy Manager does not support a nested list (orListCondition inside andListCondition) structure when defining the member group.

For example, the following membergroup condition will cause this error, as the nested condition is not supported.

<profile>
<andListCondition>
<simpleCondition>
<variable name=""registrationStatus""/>
<operator name=""=""/>
<value data=""R""/>
</simpleCondition>
<orListCondition>
<simpleCondition>
<variable name=""role""/>
<operator name=""=""/>
<value data=""Buyer (sell-side)""/>
<qualifier name=""org"" data=""OrgAndAncestorOrgs""/>
</simpleCondition>
<simpleCondition>
<variable name=""role""/>
<operator name=""=""/>
<value data=""Category Manager""/>
<qualifier name=""org"" data=""OrgAndAncestorOrgs""/>
</simpleCondition>
</orListCondition>
</andListCondition>
</profile>

The condition must be modified to remove one of these conditions. For instance, the registrationStatus condition above is redundant, as be registered to have a role, thus this condition can be modified to remove the andListCondition. When modifying the Access Group using the Organization Administration Console, it is possible to define this type of condition seen above, causing this problem.
Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce Enterprise Implementation / Usage AIX, i5/OS, Linux, Solaris, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce - Express Implementation / Usage i5/OS, Linux, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Professional Edition Implementation / Usage AIX, i5/OS, Linux, Solaris, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4 Professional Edition
Commerce WebSphere Commerce Developer Enterprise Implementation / Usage Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Professional Edition Implementation / Usage Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4 Developer Professional Edition
Commerce WebSphere Commerce Developer Express Implementation / Usage Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4 Developer Express
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21287706