Discussion:
user id in shopcart setup page
(too old to reply)
h***@campbellhausfeld.com
2006-11-16 20:43:05 UTC
Permalink
Hi,
I'm on Commerce bus ed V5.5 and have this problem: When a user is not logged in and takes the link to the ShopcartSetupView (not using add to shopcart) the ShopcartSetup page retrieves the user id -1002 from the command context and then bombs with the error:
E com.ibm.commerce.beans.ControllerCommandInvokerDataBean populate The user does not have the authority to run this command "null".

It should retrieve the next user id for a guest user and display an empty shopcart. This used to work, but I can't find where it is cobbled up.

Any ideas would be welcome, thanks,
hrm
Helen Meines
2006-11-17 14:50:16 UTC
Permalink
Need to add more info on this. I put some system.out lines in my production log to see what it does there, where it works properly.
In the ShopcartSetup it takes user id -1002, goes to the OrderItemDisplay, where it is still using -1002, and then goes to the EmptyShopCartDisplay.
And this is when the user is not logged in and has not put anything in the shopcart yet.

So in my test environment the error situation occurs in ShopcartSetup, where user id -1002 causes the error:
com.ibm.commerce.beans.ControllerCommandInvokerDataBean populate The
user does not have the authority to run this command "null".
Post by h***@campbellhausfeld.com
Hi,
When a user is not logged in and takes the link to
o the ShopcartSetupView (not using add to shopcart)
the ShopcartSetup page retrieves the user id -1002
from the command context and then bombs with the
E
com.ibm.commerce.beans.ControllerCommandInvokerDataBea
n populate The user does not have the authority to
run this command "null".
It should retrieve the next user id for a guest user
and display an empty shopcart. This used to work,
but I can't find where it is cobbled up.
Any ideas would be welcome, thanks,
hrm
m***@ca.ibm.com
2006-11-20 17:38:23 UTC
Permalink
sent a note to the developers.
Robert Brown
2006-11-23 08:18:42 UTC
Permalink
Hi Helen!

So the JSPs are getting the -1002 user as far as the
EmptyShopCartDisplay.jsp? If so, then I would remove all of the include
files pulled in by the EmptyShopCartDisplay.jsp to eliminate them as the
culprit. When removed, the empty cart page should display without error.

Also, the ControllerCommandInvokerDataBean is typically used in the
sample store code to invoke the OrderCalculate and OrderItemMove
commands to calculate order costs and merge multiple carts. Perhaps
this is a user type error with their order or orders (try running a test
with another user account) or you might be running the test with the
wrong storeId (no access control for that store #). A few ideas to try...

R
Post by Helen Meines
Need to add more info on this. I put some system.out lines in my production log to see what it does there, where it works properly.
In the ShopcartSetup it takes user id -1002, goes to the OrderItemDisplay, where it is still using -1002, and then goes to the EmptyShopCartDisplay.
And this is when the user is not logged in and has not put anything in the shopcart yet.
com.ibm.commerce.beans.ControllerCommandInvokerDataBean populate The
user does not have the authority to run this command "null".
Post by h***@campbellhausfeld.com
Hi,
When a user is not logged in and takes the link to
o the ShopcartSetupView (not using add to shopcart)
the ShopcartSetup page retrieves the user id -1002
from the command context and then bombs with the
E
com.ibm.commerce.beans.ControllerCommandInvokerDataBea
n populate The user does not have the authority to
run this command "null".
It should retrieve the next user id for a guest user
and display an empty shopcart. This used to work,
but I can't find where it is cobbled up.
Any ideas would be welcome, thanks,
hrm
p***@yahoo.com
2006-11-20 21:56:11 UTC
Permalink
As per my understanding this databean

com.ibm.commerce.beans.ControllerCommandInvokerDataBean is not allowed to populate by userid -1002 because -1002 is a generic user or guest user . You can try checking the same issue by registered user .

Thanks
pravar
m***@ca.ibm.com
2006-11-21 18:41:12 UTC
Permalink
from developer:

Is there some trace file? Please enable WC_ORDER, WC_ACCESSCONTROL trace, then reproduce the problem and send trace to me. And please let customer describe the problem more detail. Thanks.
Helen Meines
2006-11-27 16:32:21 UTC
Permalink
Hi,
I turned on the tracing and the log is attached.

In this case the customer is me. I have a problem in my test environment that does not happen in my live website environment, the page code is the same in both cases, having been copied from test to the live, where it has been working properly since we got the website going.

The situation is: I access the website and, without logging on or putting anything in the shopping cart, click the link that goes to the shopping cart, and I should get the EmptyShopCartDisplay.

When I do this on the live website I see that users_id -1002 is used by the ShopcartSetup page which calls the OrderItemDisplay which then displays the EmptyShopCartDisplay. And I get the correct display.

When I do this in the test environment I see that users_id -1002 is used by the ShopcartSetup page and it has trouble on this code

//execute OrderCalculate
commandCalculateDB = new ControllerCommandInvokerDataBean();
commandCalculateDB.setCommandName("OrderCalculate");
commandCalculateDB.setRequestProperties(iProperties);
// process the current order id
DataBeanManager.activate(commandCalculateDB, request);

and I get a blank page and the error.

If you need more details I will be glad to provide.
Thanks,
Helen
Robert Brown
2006-11-28 05:05:34 UTC
Permalink
Do you have cookies disabled on your test environment's browser? What
do you have to do to see the empty shopping cart? Go to another link?
Add and remove an item?

Are the definitions in both instances VIEWREG table the same for the
OrderItemDisplay URL?

R
Post by Helen Meines
Hi,
I turned on the tracing and the log is attached.
In this case the customer is me. I have a problem in my test environment that does not happen in my live website environment, the page code is the same in both cases, having been copied from test to the live, where it has been working properly since we got the website going.
The situation is: I access the website and, without logging on or putting anything in the shopping cart, click the link that goes to the shopping cart, and I should get the EmptyShopCartDisplay.
When I do this on the live website I see that users_id -1002 is used by the ShopcartSetup page which calls the OrderItemDisplay which then displays the EmptyShopCartDisplay. And I get the correct display.
When I do this in the test environment I see that users_id -1002 is used by the ShopcartSetup page and it has trouble on this code
//execute OrderCalculate
commandCalculateDB = new ControllerCommandInvokerDataBean();
commandCalculateDB.setCommandName("OrderCalculate");
commandCalculateDB.setRequestProperties(iProperties);
// process the current order id
DataBeanManager.activate(commandCalculateDB, request);
and I get a blank page and the error.
If you need more details I will be glad to provide.
Thanks,
Helen
Helen Meines
2006-11-28 23:35:15 UTC
Permalink
Hi Robert,

Thanks for your suggestions, I'm getting farther down the path.

In regard to the browser, the same browser on the same PC (any PC) will work correctly on the live website and get the error on the test website.

When you click the shopcart link it depends on what users_id is current, and what is in the shopcart, as to whether you get the OrderItemDisplay or the EmptyShopCartDisplay page. No other action is needed.

On the test website if something is put in the shopcart then it will assign a guest users_id and the OrderItemDisplay page displays, if that item is removed, then the EmptyShopCartDisplay page displays correctly because it still has the guest users_id.

There are differences in the viewreg tables.
On the live website:
when I select * from viewreg where properties like '%OrderItemDisplay%' for the correct store id
I get these 4 viewnames
InvalidInputErrorView
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp
ResolveFulfillmentCenterErrorView
when I select * from acaction where action like '%OrderItemDisplay%'
I get these 3 actions
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp
On the test website:
when I select * from viewreg where properties like '%OrderItemDisplay%' for the correct store id
I get a different list of 4 viewnames
AccessGroupDynamicListView
InvalidInputErrorView
OrderItemDisplayViewShiptoDsp
ResolveFulfillmentCenterErrorView
when I select * from acaction where action like '%OrderItemDisplay%'
I get the same 3 actions
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp

I have no idea how these came to be different. As far as I know these shopcart JSPs came with the store as published. It would seem reasonable to assume the viewreg entries would have been put there by the publishing process, wouldn't it? I myself have only added entries to viewreg for new pages we've created.

At the time we went live (12/2006) this was working correctly in the test environment. After that we updated test to Commerce BE 5.5.0.6 and the WAS to 5.0.2.11. The WAS part was an ugly update. Don't know if this could have broken something.

Does this really tell me that the viewreg entries are the problem?

Thanks for your help,
Helen
Post by Robert Brown
Do you have cookies disabled on your test
environment's browser? What
do you have to do to see the empty shopping cart? Go
to another link?
Add and remove an item?
Are the definitions in both instances VIEWREG table
the same for the
OrderItemDisplay URL?
R
Post by Helen Meines
Hi,
I turned on the tracing and the log is attached.
In this case the customer is me. I have a problem
in my test environment that does not happen in my
live website environment, the page code is the same
in both cases, having been copied from test to the
live, where it has been working properly since we got
the website going.
Post by Helen Meines
The situation is: I access the website and, without
logging on or putting anything in the shopping cart,
click the link that goes to the shopping cart, and I
should get the EmptyShopCartDisplay.
Post by Helen Meines
When I do this on the live website I see that
users_id -1002 is used by the ShopcartSetup page
which calls the OrderItemDisplay which then displays
the EmptyShopCartDisplay. And I get the correct
display.
Post by Helen Meines
When I do this in the test environment I see that
users_id -1002 is used by the ShopcartSetup page and
it has trouble on this code
Post by Helen Meines
//execute OrderCalculate
commandCalculateDB = new
ControllerCommandInvokerDataBean();
commandCalculateDB.setCommandName("OrderCalculate");
commandCalculateDB.setRequestProperties(iProperties);
Post by Helen Meines
// process the current order id
DataBeanManager.activate(commandCalculateDB,
request);
Post by Helen Meines
and I get a blank page and the error.
If you need more details I will be glad to provide.
Thanks,
Helen
Robert Brown
2006-11-29 03:39:30 UTC
Permalink
In production, I see a command view of ShopcartSetupView in the header.

Therefore, your queries should be

select * from viewreg where viewname = 'ShopcartSetupView'

and

select * from acaction where action = 'ShopcartSetupView'

I see no reason to query for %OrderItemDisplay% jsp by name in the
properties column since we know the ShopcartSetup.jsp is the entry JSP
and ShopcartSetupView is the view command. I would add another query to
compare access policies with OrderCalculate, the specific command you
say errors when invoked by the ControllerCommandInvokerDataBean in
ShopcartSetup.jsp.

select * from acaction where action = 'OrderCalculate'

Pay close attention to the storeId values in VIEWREG. The storeId will
help you determine differences with the viewname across stores. You may
have intentionally left that out when referencing those JSP names. If
both databases reflect storeent_id = 0 for the view, then we are covered
since all stores in the instance can execute it.

With regard to your comment on the development environment migration of
the data assets, I would expect OrderItemDisplayViewShiptoAssoc to be
there. I do not know whether it was missing (and did not get migrated)
or was always there in the v5.5 development database and just wasn't
migrated across. If you have an old db backup you could restore and
find out.

I went back and examined the access error you reported. Are we sure the
access error is the OrderCalculate command or do you think that a
resource violation occurred with a task command that OrderCalculate
calls? Has OrderCalculate or any of its task commands been customized?

R
Post by Helen Meines
Hi Robert,
Thanks for your suggestions, I'm getting farther down the path.
In regard to the browser, the same browser on the same PC (any PC) will work correctly on the live website and get the error on the test website.
When you click the shopcart link it depends on what users_id is current, and what is in the shopcart, as to whether you get the OrderItemDisplay or the EmptyShopCartDisplay page. No other action is needed.
On the test website if something is put in the shopcart then it will assign a guest users_id and the OrderItemDisplay page displays, if that item is removed, then the EmptyShopCartDisplay page displays correctly because it still has the guest users_id.
There are differences in the viewreg tables.
when I select * from viewreg where properties like '%OrderItemDisplay%' for the correct store id
I get these 4 viewnames
InvalidInputErrorView
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp
ResolveFulfillmentCenterErrorView
when I select * from acaction where action like '%OrderItemDisplay%'
I get these 3 actions
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp
when I select * from viewreg where properties like '%OrderItemDisplay%' for the correct store id
I get a different list of 4 viewnames
AccessGroupDynamicListView
InvalidInputErrorView
OrderItemDisplayViewShiptoDsp
ResolveFulfillmentCenterErrorView
when I select * from acaction where action like '%OrderItemDisplay%'
I get the same 3 actions
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd
OrderItemDisplayViewShiptoAssoc
OrderItemDisplayViewShiptoDsp
I have no idea how these came to be different. As far as I know these shopcart JSPs came with the store as published. It would seem reasonable to assume the viewreg entries would have been put there by the publishing process, wouldn't it? I myself have only added entries to viewreg for new pages we've created.
At the time we went live (12/2006) this was working correctly in the test environment. After that we updated test to Commerce BE 5.5.0.6 and the WAS to 5.0.2.11. The WAS part was an ugly update. Don't know if this could have broken something.
Does this really tell me that the viewreg entries are the problem?
Thanks for your help,
Helen
Post by Robert Brown
Do you have cookies disabled on your test
environment's browser? What
do you have to do to see the empty shopping cart? Go
to another link?
Add and remove an item?
Are the definitions in both instances VIEWREG table
the same for the
OrderItemDisplay URL?
R
Post by Helen Meines
Hi,
I turned on the tracing and the log is attached.
In this case the customer is me. I have a problem
in my test environment that does not happen in my
live website environment, the page code is the same
in both cases, having been copied from test to the
live, where it has been working properly since we got
the website going.
Post by Helen Meines
The situation is: I access the website and, without
logging on or putting anything in the shopping cart,
click the link that goes to the shopping cart, and I
should get the EmptyShopCartDisplay.
Post by Helen Meines
When I do this on the live website I see that
users_id -1002 is used by the ShopcartSetup page
which calls the OrderItemDisplay which then displays
the EmptyShopCartDisplay. And I get the correct
display.
Post by Helen Meines
When I do this in the test environment I see that
users_id -1002 is used by the ShopcartSetup page and
it has trouble on this code
Post by Helen Meines
//execute OrderCalculate
commandCalculateDB = new
ControllerCommandInvokerDataBean();
commandCalculateDB.setCommandName("OrderCalculate");
commandCalculateDB.setRequestProperties(iProperties);
Post by Helen Meines
// process the current order id
DataBeanManager.activate(commandCalculateDB,
request);
Post by Helen Meines
and I get a blank page and the error.
If you need more details I will be glad to provide.
Thanks,
Helen
Helen Meines
2006-12-01 00:54:13 UTC
Permalink
Hi Robert,

Changing my search to 'ShopcartSetupView' and 'OrderCalculate' I find:
-------------------
On live website:

select * from viewreg where viewname = 'ShopcartSetupView'
finds just the one entry: ShopcartSetupView for ShopcartSetup.jsp and store = 10051, the correct store.

select * from acaction where action = 'ShopcartSetupView'
finds just one entry: ShopcartSetupView, for acaction_id = 11902
and this leads to action group FashionAllUsersViews and member_id -2001

select * from acaction where action like '%OrderCalculate%'
finds just one entry: com.ibm.commerce.order.commands.OrderCalculateCmd, for acaction_id = 11512
and this leads to action group OrderPrepareCommands and member_id -2001

On test website:

select * from viewreg where viewname like '%ShopcartSetupView%'
finds just the one entry: ShopcartSetupView for ShopcartSetup.jsp and store = 10001, the correct store.

select * from acaction where action = 'ShopcartSetupView'
finds just one entry: ShopcartSetupView, for acaction_id = 11902
and this leads to action group FashionAllUsersViews and member_id -2001

select * from acaction where action like '%OrderCalculate%'
finds just one entry: com.ibm.commerce.order.commands.OrderCalculateCmd, for acaction_id = 11512
and this leads to action group OrderPrepareCommands and member_id -2001

So there is no difference between the two databases for 'ShopcartSetupView' or 'OrderCalculate'.
There are no entries for storeent_id = 0 for these views in either database.
There were some entries for storeent_id = 0 for the previous 'OrderItemDisplay' search, but I was comparing the entries for the correct stores in what I reported.
Also upon checking, there is no entry for member_id = -1002 in any of the access control tables in either environment. They look the same, without checking every detail.
-------------------
Regarding "migration" from test to live environment. There was none. Commerce was installed and the store published entirely separate in the two environments. The live data was loaded from scratch, so was the test data. The pages, properties files, etc, and three jars were copied from test to live. That was how it was deployed.
-------------------
Has OrderCalculate or any of its task commands been customized?
In the docs I found the OrderCalculateCmdImpl and it calls 3 task commands, and no one has told me that we modified any of those, and I can't find their sources. They are:
OrderItemAddCmd, which is in acaction table and leads to member_id -2001, identical in both databases
ResolveOrdersCmd, which is not in acaction table, identical in both databases
ResolveFulfillmentCenterCmd, which is not in acaction table, identical in both databases
-------------------
I was looking at the trace log. I see several "isAllowed PASSED? =true" but none that = false.
-------------------

I'm ready to give up, just take my chances on making a few pages changes live without messing up the live environment. I won't be changing the ShopcartSetup.jsp so maybe I'll get lucky.

Thanks everyone for your suggestions.
Helen
Robert Brown
2006-12-06 03:08:50 UTC
Permalink
I did read this ... and yes, I am about ready to give up on remote
troubleshooting as well. If the database is similar then we should be
able to rule that component out of the equation.

My next idea is to have you focus on any differences to the instance.xml
file for both production and test to pick up on any differences there
(other than the obvious path differences, etc.) since this behavior is
not part of a WebSphere Application Server configuration option.

I'm sorry I wasn't able to help resolve this...maybe someone else here
has a better idea.

R
Post by Helen Meines
Hi Robert,
-------------------
select * from viewreg where viewname = 'ShopcartSetupView'
finds just the one entry: ShopcartSetupView for ShopcartSetup.jsp and store = 10051, the correct store.
select * from acaction where action = 'ShopcartSetupView'
finds just one entry: ShopcartSetupView, for acaction_id = 11902
and this leads to action group FashionAllUsersViews and member_id -2001
select * from acaction where action like '%OrderCalculate%'
finds just one entry: com.ibm.commerce.order.commands.OrderCalculateCmd, for acaction_id = 11512
and this leads to action group OrderPrepareCommands and member_id -2001
select * from viewreg where viewname like '%ShopcartSetupView%'
finds just the one entry: ShopcartSetupView for ShopcartSetup.jsp and store = 10001, the correct store.
select * from acaction where action = 'ShopcartSetupView'
finds just one entry: ShopcartSetupView, for acaction_id = 11902
and this leads to action group FashionAllUsersViews and member_id -2001
select * from acaction where action like '%OrderCalculate%'
finds just one entry: com.ibm.commerce.order.commands.OrderCalculateCmd, for acaction_id = 11512
and this leads to action group OrderPrepareCommands and member_id -2001
So there is no difference between the two databases for 'ShopcartSetupView' or 'OrderCalculate'.
There are no entries for storeent_id = 0 for these views in either database.
There were some entries for storeent_id = 0 for the previous 'OrderItemDisplay' search, but I was comparing the entries for the correct stores in what I reported.
Also upon checking, there is no entry for member_id = -1002 in any of the access control tables in either environment. They look the same, without checking every detail.
-------------------
Regarding "migration" from test to live environment. There was none. Commerce was installed and the store published entirely separate in the two environments. The live data was loaded from scratch, so was the test data. The pages, properties files, etc, and three jars were copied from test to live. That was how it was deployed.
-------------------
Has OrderCalculate or any of its task commands been customized?
OrderItemAddCmd, which is in acaction table and leads to member_id -2001, identical in both databases
ResolveOrdersCmd, which is not in acaction table, identical in both databases
ResolveFulfillmentCenterCmd, which is not in acaction table, identical in both databases
-------------------
I was looking at the trace log. I see several "isAllowed PASSED? =true" but none that = false.
-------------------
I'm ready to give up, just take my chances on making a few pages changes live without messing up the live environment. I won't be changing the ShopcartSetup.jsp so maybe I'll get lucky.
Thanks everyone for your suggestions.
Helen
Helen Meines
2006-12-06 21:53:38 UTC
Permalink
Okay, I have compared the instance.xml files, live to test. There is something turned on in test that was not in live, EWG messaging. But scanning for "auth" and "secur" didn't find any real differences. So I found the previous test xml file, back when I know it was working. The only differences look like those added by the update from version 5.5.0.4 to 5.5.0.6, which I also found in the live xml.

I did make a page change to the live environment that included a link to the shopcart page. That link does still work okay in live when it wouldn't in test. So I guess I have experienced some luck, I'll keep my fingers crossed. And hope that we get this test server migrated to 6.0 before it has a bad disaster.

Thanks Robert and everyone.
Helen
Post by Robert Brown
I did read this ... and yes, I am about ready to give
up on remote
troubleshooting as well. If the database is similar
then we should be
able to rule that component out of the equation.
My next idea is to have you focus on any differences
to the instance.xml
file for both production and test to pick up on any
differences there
(other than the obvious path differences, etc.) since
this behavior is
not part of a WebSphere Application Server
configuration option.
I'm sorry I wasn't able to help resolve this...maybe
someone else here
has a better idea.
R
Loading...