Publishing a store archive using the command line (Windows)

Although the primary method of publishing a store archive is through the Administration Console, you can also publish a store archive using the command line. To publish using the command line, do the following:

  1. Ensure that you have Site Administrator access.
  2. At a command line, change the directory to /bin. Then type the following command, using valid parameters for your store archive:
    publishstore -svr hostname -userid userId -pwd password -sar 
    storeArchiveFilename

    where:

    hostname
    is the fully qualified TCP/IP name of your WebSphere Commerce Server.
    userId
    is the user ID for the Site Administrator. You must have Site Administrator access to publish a store archive.
    password
    is Site Administrator's password for WebSphere Commerce.
    storeArchiveFilename
    is the full path of the store archive. For example, c:\wcs\samplestores\ConsumerDirect\ConsumerDirect.sar

    The following is an example of the command:

    publishstore -svr myhost -userid  wcsadmin -pwd wcsadmin -sar 
    c:\wcs\samplestores\ConsumerDirect\ConsumerDirect.sar
    
  3. While the store archive is being published, you will receive updates on the publishing status.
  4. Open Internet Explorer. Go to the following Web address:
    http://hostname/webapp/wcs/stores/store directory/index.jsp, where the store directory is the directory of the store you just published. Your store displays. Note: Compiling the JavaServer Pages (JSP) files in your site or store before launching it will significantly reduce the amount of time needed to load each store page. As a result, it is recommended that you batch compile your store or sites JSP files after publishing a store archive. To batch compile the store's JSP files, see Compiling your JavaServer Page files. If you publish the B2B Direct store archive (ToolTech), you must stop and restart the commerce server before viewing the store, or the registration page will not display properly. For more information, see Starting and stopping WebSphere Commerce. In order to prevent unnecessary exceptions displaying, delete the SendTransactionMsg job from the scheduled jobs. For more information, see Deleting a scheduled job.
  5. In order to enable caching in the sample stores, you must merge the cachespec.xml file from the following directory:
    WAS_installdir/samples/dynacache/businessmodelname with the cachespec.xml file in the following directory:WAS_installdir/installedApps/hostname/WC_ instancename.ear/Store.war/WEB-INF
    You must edit the existing cachespec.xml file in the WEB-INF directory with the changes in the first file, rather than replace it.Note: In WebSphere Studio, caching is turned on by default, so you do not need to complete this step if you are publishing in WebSphere Studio.

Important: 

  1. If you are running your Web server on a separate node than the WebSphere Commerce node, complete the following steps after publishing a store archive:
    1. Stop the Web server.
    2. Copy the following directory from the WebSphere Commerce machine to the Web Server machine in the same location:
      • WAS_installdir/installedApps
    3. Start the Web server.
  2. If you change the Web application Context path, you must ensure that it matches the path defined in the WebSphere Commerce Server.
  3. Only one store archive at a time can be published.
  4. If you are logged in as the default administrator, you cannot browse a store based on the B2B Direct sample store (ToolTech). Instead create a new user that belongs to the default organization, then browse the store.
  5. If you plan to make changes to your JSP files after publishing your store, you should disable servlet caching in the WebSphere Application Server. For more information see the "Dynamic caching" chapter in the  WebSphere Commerce Administration Guide. If you are using WebSphere Commerce Studio, the servlet caching is disabled by default.