Troubleshooting Tools



image Found this "introductory level" article on WebSphere Developer works. It summarizes several tools that are useful in troubleshooting problems with your WebSphere installations.

Here is a list of the tools summarized in this Developer Works Article:

Read the rest of this entry »

Using Change Flow



ChangeFlow WebSphere Commerce Change Flow setup helps in handling store specific features. For example, as shown in the commerce change flow tutorial, thumb nail images may be enabled for a certain store but not other stores. Change flow condition may be evaluated using WebSphere Commerce Flow custom JSP tags. Here is an example:

<flow:ifEnabled feature="showThumbs">
showThumbs related code fragment
</flow:ifEnabled>

Read the rest of this entry »

Using DB2 Event Monitor



DB2Monitor DB2 Event Monitor helps with taking a deeper look at the database activity while commerce is in use. It comes very handy in debugging commerce issues - especially when you  suspect the problem is related to the database. It also exposes you to some interesting details on what database tables are accessed/used when you load/run commerce pages such as user registration and shopping cart. After all there are over 600 database tables and they all must be used in some form or the other! Be careful in using this in production environments, this is very resource intensive.

Read the rest of this entry »

JSTL Functions Tag Library



This post is brought to you by Robert Brown, Senior WebSphere Commerce Consultant, www.redbaritone.com 

WebSphere Commerce v6 uses the Java Server Tag Library (JSTL) language for most all starter store JSP code.  The starter store JSPs typically include the four core tag libraries as indicated below at the top of each file

Read the rest of this entry »

DBClean Utility for WC Toolkit



This post is brought to you by Robert Brown, Senior WebSphere Commerce Consultant, www.redbaritone.com

Installations of WebSphere Commerce Toolkit Developer environments do not provide a dbclean utility.  This utility is only available after completing a full WebSphere Commerce installation.  At times, it is necessary to insert rows into your developer’s CLEANCONF table and test database clean SQL statements for a production server prior to deployment.

Follow the steps below to enable the dbclean utility for v5.6 or v6.0 Toolkit installations.  You will need access to a Windows server installation for files referenced in {WCS_Home}.

Read the rest of this entry »

Java code for MQ Read/Write



While working on MQ Integration on any commerce project, you typically do not have the luxury of testing out MQ send/reply functionality from your development environment. I have MQ Server installed on my development environment and I try and test my send/reply functionality as close to the real environment as possible. I create the queues and queue managers that mimic the server environment. In such cases, when I have to test a functionality that requires sending a message onto the queue and reading a response, I have a few options. One of them is to work with RHF utility I discussed earlier. The other option is to have a simple java problem that behaves like a consumer of my mq message and responds to it. This post discusses the Java Code that I put together to do this.There is a third option which is to write a Message Driven Bean and attach it to the queue using a corresponding listener. This option never worked for me from commerce end, as there were issues with overlapping MQ transactions.

Read the rest of this entry »

RHF - A Very Useful MQ Utility



Earlier I posted two articles on java programs for browsing and writing to MQ queues. This post covers an important MQ utility and a simple summary on how to use it to read, browse, write and reply to queues. Thanks to my colleague at Perficient Inc, I discovered this hidden gem that not many Commerce developers are aware of. This utility lies in the domain of Message Broker developers, but works great even for Commerce developers. The need for this utility arises from the fact that not all development environments provide access to a reliable MQ environment during the full development cycle. They all end up testing their MQ work either on the QA or Staging servers. Utilities like these come in handy when working with MQ on a Websphere Commerce project. The best thing is that there are no limitations on the size of the messages you work with!

Read the rest of this entry »

Java Code to Browse MQ Messages



In order to browse messages on an MQ queue, there are two options. One, browse the messages using MQ Explorer, two use amqsbcg program from MQ_INSTALL_ROOT/bin folder. amqsbcg program takes the parameters of queue manager name and the queue name. The first option has a limitation on the message size and the second option(amqsbcg) provides the entire message but it also provides message in data bytes in numeric values for each line. That does not make it easy to read the message. Amqsbcg is a sample program compiled from amqsbcg0.c file found in MQ_INSTALL_ROOT/tools/c/samples folder.  I wrote a simple java program that can browse and print messages that are easy to read.

Earlier, I discussed a java program to put a message on MQ queue. Like that one, to compile this program, you will need \Java\lib\com.ibm.mq.jar in your classpath. Compile and put this class in an appropriate jar file - I called it MQUtils.jar. You can use the following as an example to run this program:

java.exe -classpath MQ_INSTALL_ROOT\Java\lib\com.ibm.mq.jar;./MQUtils.jar com.wcsadmin.utilities.mq.PutMessage QM_Name Queue_Name

Here is the source of my program: BrowseMessages.java

Hope this helps!

Java Code to Put a Message on MQ Queue



When we use WebSphere MQ on a Commerce project, sometimes we have a need to put a message on the queue for testing inbound or outbound message functionality. In most cases we can get away by putting a message on the queue “manually” i.e. open the relevant queue in MQ Explorer and put a message. But there is a limitation on the size of the message which cannot exceed 1000 characters. This topic discusses some alternatives and a simple java program that can be used to put messages on the queue.

Read the rest of this entry »

Stored Proc Issue in WCS 6.0



Versions:Java Exception!
WebSphere Commerce 6.0.0.1 Enterprise Edition
Database: DB2 8.2.3 Enterprise

Problem
Encountered this error when trying to place an order:

SQL0444N  Routine “GETITEMS” (specific name “SQL061206150656090″) is implemented with code in library or path “\GETITEMS”, function “GETITEMS” which cannot be accessed.  Reason code: “4″.  SQLSTATE=42724

Solution:

Read the rest of this entry »

Using Singleton Pattern



Singleton pattern is gaining ground in the websphere commerce arena. It plays a major role in enhancing the application performance. Simply put, a singleton is a class that can be instantiated only once. This design pattern is very useful for handling data that is static(well almost). Any information that is frequently used and changes less frequently can be stored in a singleton. A singleton stores all the information in the memory and therefore is accessible without having to rebuild the information. Java world has an exhaustive description of what a singleton is all about and how you will go about building a singleton.

Read the rest of this entry »