When using Web Services, if you need to update base catalog entry fields such as the 'buyable' flag, manufacturerName, custom fields like field1, field2, etc. the XPath in the service request should be /CatalogEntry.
<Oagis9:ActionExpression actionCode="Change" expressionLanguage="_wcf:XPath">/CatalogEntry</Oagis9:ActionExpression>
For a complete list of the available editable properties, see the catalog wc-business-object-mediator.xml file in:
When attempting to login to Management Center, you notice the following error in the SystemOut.log:
[2/5/14 16:57:15:613 EST] 00000028 LocalExceptio E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "getPerson" on bean "BeanId(WC_lmweb_s#Member-Server.jar#Member, null)". Exception data: java.lang.RuntimeException: javax.transaction.RollbackException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
If you are using LDAP to authenticate:
Double-check your AuthenticationMode setting in the wc-server.xml file (MemberSubSystem element)
Try deleting the row for your user in the WMMMAP table such that the user record gets synchronized again.
See Step 2 here for more details:
WebSphere Commerce database table: WMMMAP
Check out the new WebSphere Commerce SEO Cookbook blog!
We will be adding posts here for tips, tricks, recommended fixes and enhancements to serve as a resource for your SEO implementation.
Modified by JohnRawls
Within the WebSphere Commerce Data cache, the TransactionCachedMap objects can cache data for the duration of a transaction. This may be useful in cases where multiple requests to the database are made within the context of the same end-user request. One instance where this can be helpful is with the CalculationCodeListDataBean. Many customers leverage this bean to display short/long descriptions of applicable promotions on their product or category pages. To enhance performance of this bean, consider the following configuration modifications:
Enable the WebSphere Commerce Data cache.
By default, the CalculationCodeListDataBean makes use of the following data cache "logical caches"
NOTE: I had to add line breaks in the object cache names here to allow them to fit within the post.
DistributedMap Object Cache
Make sure the above caches are properly enabled in your cacheinstances.properties file.
There are three TransactionCachedMaps defined in this class but only one is enabled by default. You can modify the default settings and include the tags below in the <InstanceProperties> section of the wc-server.xml file to enable the additional two:
NOTE: I had to add line breaks in the class names here to allow them to fit within the post.
CalculationCodeListDataBean.1 enabled="true" maxSize="1000" />
CalculationCodeListDataBean.2 enabled="true" maxSize="100" />
CalculationCodeListDataBean.3 enabled="true" maxSize="1000" />
These transaction caches cache intermediate results used in determining the category parent-child relationships. They are kept in memory only until the current database transaction ends. Each cache represents a level. The first level cache is a map of catentry Ids to categories. On a cache miss, the second level cache containing intermediate results is checked, and on a second level miss, the third level cache is checked for low level caching of each of the child to parent category relationships.
If you wanted to validate content was getting into the caches you can enable the com.ibm.websphere.commerce.WC_CACHE=all trace.
[8/30/13 9:05:48:241 EDT] 00000264 WC_CACHE 3 -a269c6d:140cbc6bf62:-7ffa com.ibm.commerce.datatype.TransactionCachedMap.clear com.ibm.commerce.fulfillment.beans.CalculationCodeListDataBean.3 clears 35 transaction cache entries.
[8/30/13 9:05:48:241 EDT] 00000264 WC_CACHE 3 -a269c6d:140cbc6bf62:-7ffa com.ibm.commerce.datatype.TransactionCachedMap.clear com.ibm.commerce.fulfillment.beans.CalculationCodeListDataBean.2 clears 21 transaction cache entries.
[8/30/13 9:05:48:241 EDT] 00000264 WC_CACHE 3 -a269c6d:140cbc6bf62:-7ffa com.ibm.commerce.datatype.TransactionCachedMap.clear package com.ibm.commerce.catalog.facade.server.helpers.1 clears 2 transaction cache entries.
[8/30/13 9:05:48:241 EDT] 00000264 WC_CACHE 3 -a269c6d:140cbc6bf62:-7ffa com.ibm.commerce.datatype.TransactionCachedMap.clear com.ibm.commerce.fulfillment.beans.CalculationCodeListDataBean.1 clears 12 transaction cache entries.
For additional performance improvements, consider installing and implementing APAR JR42205 (included in WebSphere Commerce Fix Pack 6). With this APAR, parameters are added to the CalculationCodeListDataBean to disable certain checks to improve performance.
If even further performance improvement is needed, considering implementing caching at the servlet level for your pages (or fragments) which leverage the CalculationCodeListDataBean. To keep the number of servlet cache entries used at a minimum, review the list of cache entry parameters. For instance, the following parameter prevents duplicates for GET/POST requests:
Consider the following scenario:
You create a Product level Promotion and an Order level Promotion. Both are for 10% off. The Order level Promotion is applied with a coupon code whereas the Product level Promotion is not. You notice that when the promotions are applied together, they are not stacked, i.e. the Product level Promotion takes 10% off the item offer price, then the Order level Promotion takes 10% off the order total before the first adjustment is applied.
In this scenario, you want the Order level Promotion to take an additional 10% off after the Product level Promotion has already been applied. However, this does not occur.
The DefaultSequenceBuilder gives precedence to coupons. By default, promotions are evaluated in the following sequence:
2. Promotion code
3. Promotion group (product level, then order level, lastly shipping level)
To change the behavior, you can replace the DefaultSequenceBuilder configuration with the StaticSequenceBuilder which does not prioritize promotions based on Coupon or Promotion code. Here is a document which outlines that configuration:
Configuring the promotion engine for a custom sequence builder
There should not be any performance impact associated with this change, however there is the following APAR to address a known issue:
IV04764: CMVC 211967 - IMPROVE THE SORTING ALGORITHM FOR DETERMINING PROMOTION EVALUATION SEQUENCE
This APAR is included in Fix Pack 5 for WebSphere Commerce.
Modified by JohnRawls
When configuring Web Services over JMS, you may need to set the reply queue to send response messages to your back-end system, for example ConfirmBOD for the Sync Order service.
Create the queue connection factory for replies. Ensure it has JNDI name jms/WebServicesReplyQCF. Steps on how to create this can be found in the WebSphere 6 Web Services Handbook. (see Appendix C)
In the header of your JMS messages, specify the reply queue in header property JMSReplyTo. For instance, if sending from a Java application you can use a call similar to:
Head on over to the IBM Industry Solutions Client Success Essentials Community! There's a special section in this Community for everything Smarter Commerce. You can find a nice collection of tips and tricks in the blog there to help you fine-tune your Commerce implementation even more.
The community brings together users of IBM Industry Solutions software to share, collaborate and connect with each other virtually. In this community, you'll find training videos, upcoming events, blogs, important web links and more. Sign in with your IBM ID and register for the site.
In this customization, we want to be able to update an organization's status using a SyncOrganization Web Service call to WebSphere Commerce. By default, the 'status' field is read-only. Since this is in the java code (this is an SOI-based service), to customize this we would customize OrgEntityUpdateCmd or PostOrgEntityUpdateCmd to read the field and update the organization entry.
We would then need to un-comment the following read-only section from <WC_eardir>/xml/messaging/component-services/OrganizationBODMapping.xmlf and assign a value to the 'Field' attribute of which our command will read from.
<!-- READ ONLY
<Tag XPath="DataArea/Organization@status" Field=""/>
Here is an sample of the Web Service call:
<oa:ActionExpression actionCode="Update" expressionLanguage="_wcf:XPath">/Organization</oa:ActionExpression>
<_mbr:Organization type="Organization" status="Locked">
Also note that if you're trying to create a new OrgEntity (OrgEntityAddCmd), the status will automatically be set to approved-- this is the default behavior.
Also see the following tutorial on extending SOI services:
Customizing the client library and component facade
In WebSphere Commerce v6, users were permitted to enter multiple e-mail addresses, comma separated, at user registration. Additional validation was added in v7 which may not permit this anymore. Previously existing users with comma-separated e-mail addresses already populated in the ADDRESS table may still receive e-mails, but the e-mails are sent out individually (bcc field) rather than a single e-mail containing all recipients visible. To enable the previous v6 functionality in v7 perform the following steps:
Obtain APAR JR47640 from support. This APAR updates the AddressDO.isEmailAddressValid(String strEmail) method to make it protected instead of private.
Customize and/or deploy the two extended classes. Sample code can be obtained here. Note: This is sample code only and is not represented as an official IBM asset. The ExtSelfAddressDO.java class returns true for the isEmailAddressValid() method. You can add your own validation logic here as you see fit. The EXTLDAPIntegrationCmdImpl.java class imports that new class and invokes it.
Update your CMDREG database entry to point the interface to the new class name:
update cmdreg set classname='com.ibm.commerce.member.syncbeans.commands.EXTLDAPIntegrationCmdImpl' where classname='com.ibm.commerce.member.syncbeans.commands.LDAPIntegrationCmdImpl';
To allow all recipients to show up in the "To" field for the e-mail, you can add the 'showAllMemberGroupRecipients' property in the wc-server.xml (instance.xml). Set this property to 'true' (default is false). Here is an example:
<OutboundConnector default="true" enabled="true" id="1"
Modified by JohnRawls
When deploying a new EJB, for instance a PayPal payment plug-in in this case, the following error may appear during initialization.
[10/11/13 10:29:43:672 GMT-08:00] 00000023 EJSOAImpl W WSVR0056W: Tie class of com.mycompany.payment.plugin.EJSRemoteStatelessPayPalPluginHome_0a63a86d can not be found.
[10/11/13 10:29:43:706 GMT-08:00] 00000023 WC_PPC W PluginFactory setup() Failed to initialize the payment plug-in PayPal. The reported exception is: java.lang.ClassCastException: cannot cast class org.omg.stub.javax.ejb._EJBObject_Stub to interface com.mycompany.payment.plugin.PayPalPluginHome.
This indicates the corresponding Tie classes for the EJB are missing from the JAR. The setting in WCBD which controls this is "ejbdeploy.codegen" in build.properties. If this is set to 'true' Tie classes are not automatically generated. Change the setting to 'false' to allow RMIC generation of the Tie classes in your WCBD build.
Rest calls go through channel different from your typical desktop/browser storefront where the normal Login Timeout does not necessarily apply. In the case that your Rest calls originate from a mobile device (phone, iPad, etc.) this channelId is typically -6. To specify a session timeout for this channel, add -6 to the ExpiryManagement element of the BusinessContextService in the <instance>.xml. The block would look like this after the change:
<ExpiryManagement ExpiryMgmtChannelId="-4, -6"
InactivityTimeout="15" Threshold="15" enable="true"/>
Otherwise, the channel ID will default to -1 by the underlying logic. In this case you can add -1 to this element:
<ExpiryManagement ExpiryMgmtChannelId="-4, -1"
InactivityTimeout="15" Threshold="15" enable="true"/>
The lease time of the session in minutes. The session remains active within this time. In the sample configuration, for example, the lease time is 15 minutes.
The allowable time in minutes to renew the lease. If a request comes in within this threshold time and after the lease time, the lease on the activity is renewed. In the sample configuration, for example, the threshold time is 15 minutes. Therefore, the activity remains active for 30 (15 + 15) minutes.
For more information see:
Changing web services session timeout
Mapping device-specific requests to a JSP file template
Modified by JohnRawls
There are a number of different configuration settings you can tweak to help ensure e-mails are being sent out from WebSphere Commerce successfully and efficiently. This is not a troubleshooting walkthrough per se, but if you are encountering problems with sending e-mails, try going through the following steps to make sure you have the application configured correctly:
Designate a single node in your cluster of which to send out e-mails from using the SendTransactedMsg scheduled job. Running this job from multiple nodes simultaneously may inadvertently cause concurrency problems at the database. See the following document for information on how to configure this:
Configuring the scheduler to run a job on an instance or cluster member
When scheduling the SendTransactedMsg job in the Commerce Administration Console, set your interval to allow adequate time for the job to complete (the default is five minutes-- this is a safe choice in most cases, but may be shortened depending on your traffic). Currently, there is no mechanism within WebSphere Commerce to prevent a subsequent instance of the job from running in parallel, however this type of behavior can be achieved by implementing this customization.
UPDATE: In Fix Pack 8, a feature has been added to the scheduler to prevent multiple instances of the same job from running concurrently. To configure this, set the parameter maxThreads in the job parameters field (ex. maxThreads=1). Note that if this is configured and another job attempts to run concurrently, the second job will essentially be marked as "Failed" in the Scheduler.
If you are running WebSphere Commerce 22.214.171.124 or higher, ensure you have configured the connection pool settings for the JCAEmailConnector to match that of your SMTP server. If you are encountering runtime errors where the connector is unable to acquire a connection to the SMTP server, you most likely need to adjust these. See the following document:
SMTP Email connections behave differently between V7.0 and V6.0
If you see SMTP timeout errors, your firewall may be blocking No Operation (NOOP) messages. You can configure WebSphere Commerce to use RSET messages instead which may mitigate this problem. See the following documents:
Switch from NOOP to RSET to avoid SMTP communication hanging
Configuring validation for No Operation (NOOP) messages
If you are sending HTML e-mails but they are showing up as plaintext, ensure you have the Content-Type setting for the message type set to 'text/html' (without the quotes) in the WebSphere Commerce Administration Console.
Remember: Message types can be configured at both the Site and Store levels. The Store level settings will take precedence.
Configuring outbound email notification messages
For character encoding issues, be sure to go through the settings mentioned in my technote here:
Troubleshooting special character encoding issues in WebSphere Commerce
For additional SMTP settings (timeout, etc). try adjusting the JavaMail parameters in the <WAS_installdir>/lib/JCAEmailConnectionRequestInfo.properties. file. See the following document for more information:
Adding JavaMail parameters to the WebSphere Commerce Environment
This query may come in handy when debugging custom access control policies. It will show you all of the action-resource mappings associated with a given policy. To use, just pass in the policy name.
Note: Remember BecomeUser policies are unique in that they tend to not have explicit becomeUser action-resource mappings. This query is more useful for finding action mappings such as Execute.
select a.acaction_id, b.action, a.acrescgry_id, c.resclassname from ACRESACT a, ACACTION b, ACRESCGRY c
and a.acrescgry_id in
(select acrescgry_id from ACRESGPRES where acresgrp_id in
(select acresgrp_id from ACPOLICY where policyname='<policyname>'))
and a.acaction_id in
(select acaction_id from ACACTACTGP where acactgrp_id in
(select acactgrp_id from ACPOLICY where policyname='<policyname>'))