To change the Heap Configuration - to avoid out of memory issue during enable of Websphere features
- Edit the file <DRIVE>:\IBM\eclipse\IBMIM.ini;
- Add the heap max size according to the local resources (for example -Xmx512M will reserve 512MB for the heap)
- Save the file
- Restart the Installation Manager and run the enable all features task
How to check Websphere Commerce and Application version
To validate the Commerce and Application Version - use versionInfo.bat located in the below locations..
IBM\WCD\bin\versionInfo.bat
IBM\WCD\wasprofile\bin\versionInfo.bat
To switch to Oracle thin client - Websphere Mass Load Utility.
The massload utility must be using the thick client during instance creation and the migration process. By Default, the massload utility uses the Oracle thick JDBC client. To change the massload utility to use the Oracle thin JDBC client:
Steps -
- Extract DbConnectionImplIDProperty.properties from the following file:
- WCDE_installdir\workspace\wc\lib\loader\dbconnect.zip
- Open DbConnectionImplIDProperty.properties
- Locate the following text: ConnectStringID = jdbc:oracle:oci8:@
- Change the text to - jdbc:oracle:thin:@hostname:port:SID.
- Save your changes.
Logging and Tracing in Management Center
-
Open WebSphere Commerce Developer and switch to the Package Explorer view.
- Right-click LOBTools and click Properties. Select OpenLaszlo Settings.
- Clear the Enable the debug console check box. Click Apply.
URL - debugger enable
https://host_name:8000/lobtools?logger.display=true
https://host_name:8000/lobtools?logger.display=true&logger.enabled=true&logger.bufferSize=500&logger.Interval=30&logger.level=ALL&logger.components=com.company.component1,com.company.component2
Component Log Levels
com.ibm.commerce.lobtools.foundation.view
com.ibm.commerce.lobtools.foundation.model
com.ibm.commerce.lobtools.foundation.service
com.ibm.commerce.lobtools.foundation.util
com.ibm.commerce.lobtools.foundation.shell
Use the Debug.debug() method to print messages in the debugger console.
Publishing in WCS RAD does not respond and stops with Out of Memory Error after this message..
Problem -
[9/24/13 10:33:47:402 SGT] 0000001d ModelMgr I WSVR0801I: Initializing all server configuration models
[9/24/13 10:34:39:326 SGT] 0000001d WorkSpaceMana A WKSP0500I: Workspace configuration consistency check is disabled.
Screenshot -
Resolution -
- Delete the existing server instance and re-create it.
- Right click on the server instance in the Servers tab and delete it.
- Once Step a is complete, Right click on the same window select New ->Server ->Websphere Application Server v7.0 -> Next -> Select WC and click on ADD All -> Finish
- Start the server.
- Upon successful, Publish the code.
Troubleshooting OutOfMemoryError during publishing the application in toolkit
Steps -
- Start your test server.
- Log on to the WebSphere Administration Console.
- Select
- Change the value of the Maximum
heap size field.
For example, change the value from 512 to 1024.
- Save your
changes, then restart your test server.
- Republish the application.
Feature enablement hangs at refreshProject task in toolkit
In the enableFeature.log, the log file ends with the following messages:
importCMC:
Logs -
[delete] Deleting 2032 files from F:\IBM\WCDE_E~1\workspace\LOBTools
[delete] Deleted 266 directories from F:\IBM\WCDE_E~1\workspace\LOBTools
[copy] Copying 4050 files to F:\IBM\WCDE_E~1\workspace\LOBTools
[projectImport] projectName=LOBTools projectLocation=null
[projectImport] project.refresh
[projectImport] (Begin)
[projectImport] ... subtask: Refreshing '/LOBTools'.
[projectImport] (Done)
refreshProject:
Comment out '<CleanOpenLaszloIndex projectName="LOBTools" /> ' in toolkitWorkspaceTask.xml, as a workaround
E:\IBM\WCDE_ENT70\components\common\xml\toolkitWorkspaceTask.xml
<antcall target="refreshProject" />
<!-- Clean openlaszlo index for LOBTools project -->
<if>
<or>
<equals arg1="${featureIdLowercase}" arg2="fep0"/>
<equals arg1="${featureIdLowercase}" arg2="fep1"/>
<equals arg1="${featureIdLowercase}" arg2="fep2"/>
</or>
<else>
<!-- If FEP3 or higher, clean openlaszlo index for LOBTools project
-->
<CleanOpenLaszloIndex projectName="LOBTools" />
</else>
</if>
Steps -
- Stop the feature enablement process.
- Take the backup of toolkitWorkspaceTask.xml. Open the file toolkitWorkspaceTask.xml.
- Remove this line:
- <!-- If FEP3 or higher, clean openlaszlo index for LOBTools project -->
- <CleanOpenLaszloIndex projectName="LOBTools" />
- After you have removed the line, run the enablement script again.
- enableFeature.bat -DfeatureName=<feature name> -DcontinueOnSQLError=continue
- In Rational Application Developer, click the LOBTools project . Go to project > clean. This step ensures that files from previous Feature Pack level are no longer indexed
- Revert back the changes in toolkitWorkspaceTask.xml.
Logging and Tracing EJB and Prepared SQL Statements
*=info:enable.trace.log.*=all:com.ibm.ws.rsadapter.jdbc.*=all:EJBContainer=all:PMGR=all
How to install and enable Cache monitor in the developers environment
- Open the WebSphere Application Server Administration Console.
- Click Applications > New Application.
- In the New Application window, click New Enterprise Application.
- Click Browse and locate the CacheMonitor.ear file in the WAS_installdir/installableApps directory. Click Next.
- E:\IBM\SDP\runtimes\base_v7\installableApps\CacheMonitor.ear
- Select Detailed- Show all installation options and parameters, and click Next on the "Preparing for the application installation" window.
- You will receive an application security warning. Select continue.
- Select the installation options, accept the default values, and click Next.
- Map the modules to the servers,Check the box beside the Dynamic Cache Monitor module, and click Apply.
- Click Next until Step 6 or click on Step 6.
- In Step 6: Map virtual hosts for Web modules, check the box beside the Dynamic Cache Monitor Web module and select one of the following:
- Go to Step 8: Map security roles to users or groups.
- Click Next for the Summary window, accept the default values, and click Finish.
- Click Save.
- Use the WebSphere Application Server Administrative console to start the cache monitor.
- Click Applications > Application Types > WebSphere enterprise applications.
- Check the box next to Dynamic Cache Monitor, and click Start.
- Access the Web Application at https://localhost:8002/cachemonitor/
Logging and Tracing BOD request and response along with SQL queries.
*=info:enable.trace.log.*=all:com.ibm.commerce.foundation.server.command.bod=all:com.ibm.commerce.foundation.server.services.dataaccess=all:com.ibm.ws.sdo.mediator.jdbc*=all
WCS Useful links
Stores- http://<hostname>/webapp/wcs/stores/servlet/<store name>/index.jsp
CMC- https://<hostname>:8000/lobtools
Accelerator- https://<hostname>:8000/accelerator
Admin console https://<hostname>:8002/adminconsole
Orgadminconsole- https://<hostname>:8004/orgadminconsole
Workspace Admin - http://<hostname>/webapp/wcs/wkspcadmin/servlet/ToolsLogon?XMLFile=workspaceadmin.WorkspaceAdminLogon
To Create a Command Context Object for a Class
Syntax
ContextHelper.createCommandContext(((BusinessContextInternalService)BusinessContextServiceFactory.getBusinessContextService()).getActivityToken()), null);
How to load the data into the custom table using the Catalog Upload option in Management Center
Make use of the TableObjectMediator to load the data into the Custom Table.
<_config:BusinessObjectMediator className="com.ibm.commerce.foundation.dataload.businessobjectmediator.TableObjectMediator"/> </_config:BusinessObjectBuilder>
WCS7 Migration tips -
By default, the massload utility uses the Oracle thick JDBC client. To change the massload utility to use the Oracle thin JDBC client:
Note: The massload utility must be using the thick client during instance creation and the migration process. The bootstrap data gets processed during these processes.
- Extract DbConnectionImplIDProperty.properties from the following file:
- WC_installdir/lib/loader/oracle/dbconnect.zip
- WebSphere Commerce Developer - WCDE_installdir\workspace\wc\lib\loader\dbconnect.zip
- Open DbConnectionImplIDProperty.properties in a text editor.
- Locate the following text: ConnectStringID = jdbc:oracle:oci8:@
- Note: By default, the dbconnect.zip compressed file does not contain this text string. When the setdbtype utility script runs to switch the database type to an Oracle database, this compressed file is replaced. The compressed file is replaced with a version that contains the property information for Oracle databases. When this script runs, the dbconnect.zip compressed file with the Oracle information is copied from the following directory:
- WC_installdir/wc.ear.ext/oracle/loader
- WCDE_installdir\wc.modules\loader\oracle
- Change the text to match the following text: ConnectStringID = jdbc:oracle:thin:@ If you are using the massload stand-alone utility use: jdbc:oracle:thin:@hostname:port:SID.
- Save your changes.
- Add the updated DbConnectionImplIDProperty.properties file to the WC_installdir/lib/loader/oracle/dbconnect.zip file. Overwrite the existing file in the archive.
- Copy dbconnect.zip and paste it one directory level higher. For example, in this example, it would go in the WC_installdir/lib/loader folder.
Usage of CommonSearchHelperBean to execute SQL Statements
com.ibm.commerce.tools.util.CommonSearchHelperBean provides a method to execute the SQL statements
buildQuery and buildResultDataBean needs to method be implemented in the custom Databean
public class MyNewDataBean extends CommonSearchHelperBean {
public String buildQuery() {
.........
.........
}
public void buildResultDataBean(Vector resultVector)
{.........
.........
}
}
How to Disable ACP in WCS
Update the wc-server.xml with AccessControlUnitTest="true"
Updated info -
<Instance
AccessControlUnitTest="true"
.....
To Enable Trace -
com.ibm.websphere.commerce.WC_ACCESSCONTROL=all
How to Start and Stop WCS appserver
Execute the below commands from WC_profiledir/bin
To start an application server, enter the following command:
./startServer.sh application_server_name
To stop an application server, enter the following command:
./stopServer.sh application_server_name
How to switch development database in WCS
Syntax -
setdbtype oracle ORACLE_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort]
[createdb
- Stop the WebSphere Commerce Test Server.
- Go to the WCDE_installdir/bin directory.
- Execute the above command with appropriate parameters values
- Verify that the script ran successfully by checking that the string BUILD SUCCESSFUL is at the end of the WCDE_installdir/logs/setdbtype.log log file
How to load the ACL for a new 'View' and 'Command' using SQL Queries
For a new View - MyNewView
INSERT INTO ACACTION (ACACTION_ID, ACTION) VALUES ((SELECT COUNTER FROM KEYS WHERE TABLENAME='acaction'), 'MyNewView');
INSERT INTO ACACTACTGP (ACACTGRP_ID,ACACTION_ID) VALUES
((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME = 'AllSiteUsersViews'
AND MEMBER_ID IN (SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization')
),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acaction';
For a new Command - MyNewControllerCmd
INSERT INTO ACRESCGRY
(ACRESCGRY_ID,RESCLASSNAME)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),'com.ibm.commerce.sample.commands.MyNewControllerCmd');
INSERT INTO ACRESACT
(ACRESCGRY_ID, ACACTION_ID)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='Execute'));
INSERT INTO ACRESGPRES
(ACRESGRP_ID, ACRESCGRY_ID)
VALUES
((SELECT ACRESGRP_ID FROM ACRESGRP WHERE MEMBER_ID IN
(SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization') and GRPNAME='AllSiteUserCmdResourceGroup'),
(SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'));
UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acrescgry';