Contract error - Catalog entry is not valid

Technote (troubleshooting)


Problem(Abstract)

Catalog entry is not valid for the current contract.

Symptom

You repeatedly find errors reported in the log similar to this:

[9/20/12 13:04:04:099 EEST] 00000e5b CommerceSrvr A com.ibm.commerce.order.commands.PreProcessOrderCmdImpl validateContract The catalog entry number "1098765" and part number "1223456" is not valid for the current contract.

... and particular items can not be added to the cart or sometimes it just stops orders from being submitted.


Cause

It seems that a language id taken from the globalization context can sometimes be incorrect and this results in the wrong index being queried.

Diagnosing the problem

Enable Solr tracing (see Information Center article: Enabling tracing and logging for WebSphere Commerce search). You will see the following lines in the trace which show the language id chosen:

[9/20/12 20:58:00:774 EEST] 00001004 solr 1 com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator invoke(SelectionCriteria) Core name (from expression): null
[9/20/12 20:58:00:774 EEST] 00001004 solr 1 com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator invoke(SelectionCriteria) Index name (from profile): CatalogEntry
[9/20/12 20:58:00:774 EEST] 00001004 solr 1 com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator invoke(SelectionCriteria) Store Id: 10001
[9/20/12 20:58:00:774 EEST] 00001004 solr 1 com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator invoke(SelectionCriteria) Language Id: -1
[9/20/12 20:58:00:774 EEST] 00001004 solr 1 com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchIndexNameValidator invoke(SelectionCriteria) Core name: MC_10001_CatalogEntry_en_US

Resolving the problem

There may be several reasons why the wrong language is in the context. Further debugging into when the language is set in session will reveal where the problem lies.

A workaround is to hard code the language either in PreProcessOrderCmdImpl or in the wc-search.xml.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Commerce Enterprise
Orders

Software version:

7.0.0.3, 7.0.0.4, 7.0.0.5, 7.0.0.6

Operating system(s):

AIX, IBM i, Linux, Solaris, Windows, i5/OS

Reference #:

1613725

Modified date:

2012-12-10

Translate my page

Machine Translation

Content navigation