Thursday 31 October 2013

WCS Code to find storeId from user LogonId (Expecting that user has registereigd customer role from one store only)

MemberRoleAccessBean m = new MemberRoleAccessBean();
Enumeration mEnum = m.findByMemberIdRoleId(cmdContext.getUserId(),Integer.valueOf("-29"));
Enumeration sEnum = null;
if(mEnum.hasMoreElements()){
   m =(MemberRoleAccessBean)mEnum.nextElement();
   StoreEntityAccessBean stAb = new StoreEntityAccessBean();
   sEnum = stAb.findByMember(Long.valueOf(m.getOrgEntityId()));
   if (sEnum.hasMoreElements()){
   stAb =(StoreEntityAccessBean)sEnum.nextElement();
   storeId = stAb.getStoreEntityId();
}
}

Wednesday 30 October 2013

WCS developer toolkit , WC.ear deployment files location

Error: SRVE0017W: A WebGroup/Virtual Host to handle localhost:443 has not been defined.

It could be the reason that WC application is not deployed to Websphere Test Server; we can see that in app server admin console enterprise application section if it is installed or not. This sometimes happens when we do add/remove wc project in toolkit.

In WCS developer toolkit , C:\IBM\WCToolkitEE60\wasprofile\config\cells\localhost\applications folder contains the WC.ear file which contains deployment files like deployment.xml, resources.cml and variables.xml

if in above file location applications folder is missing then copy it from backup toolkit.

C:\IBM\WCToolkitEE60\wasprofile\config\cells\localhost\nodes\localhost\serverindex.xml contains wc.ear deployment configuration for app server

serverindex.xml should look like this



<?xml version="1.0" encoding="UTF-8"?>

<serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:serverindex="http://www.ibm.com/websphere/appserver/schemas/5.0/serverindex.xmi" xmi:id="ServerIndex_1" hostName="localhost">

<serverEntries xmi:id="ServerEntry_1224144829726" serverName="server1" serverType="APPLICATION_SERVER">

<deployedApplications>WC.ear/deployments/WC</deployedApplications>

<specialEndpoints xmi:id="NamedEndPoint_1224144829726" endPointName="BOOTSTRAP_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829726" host="localhost" port="2809"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829727" endPointName="SOAP_CONNECTOR_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829727" host="localhost" port="8880"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829728" endPointName="SAS_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829728" host="localhost" port="9401"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829729" endPointName="CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829729" host="localhost" port="9403"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829730" endPointName="CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829730" host="localhost" port="9402"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829731" endPointName="WC_adminhost">

<endPoint xmi:id="EndPoint_1224144829731" host="*" port="9060"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829732" endPointName="WC_defaulthost">

<endPoint xmi:id="EndPoint_1224144829732" host="*" port="80"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829733" endPointName="DCS_UNICAST_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829733" host="*" port="9353"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829734" endPointName="WC_adminhost_secure">

<endPoint xmi:id="EndPoint_1224144829734" host="*" port="9043"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829735" endPointName="WC_defaulthost_secure">

<endPoint xmi:id="EndPoint_1224144829735" host="*" port="443"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829736" endPointName="SIB_ENDPOINT_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829736" host="*" port="7276"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829737" endPointName="SIB_ENDPOINT_SECURE_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829737" host="*" port="7286"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829738" endPointName="SIB_MQ_ENDPOINT_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829738" host="*" port="5558"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144829739" endPointName="SIB_MQ_ENDPOINT_SECURE_ADDRESS">

<endPoint xmi:id="EndPoint_1224144829739" host="*" port="5578"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144830117" endPointName="ORB_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1224144830117" host="localhost" port="9100"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144901755" endPointName="WC_PORT_1">

<endPoint xmi:id="EndPoint_1224144901755" host="*" port="8000"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144901817" endPointName="WC_PORT_2">

<endPoint xmi:id="EndPoint_1224144901817" host="*" port="8002"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144901880" endPointName="WC_PORT_3">

<endPoint xmi:id="EndPoint_1224144901880" host="*" port="8004"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144901927" endPointName="WC_PORT_4">

<endPoint xmi:id="EndPoint_1224144901927" host="*" port="8006"/>

</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1224144901958" endPointName="WC_PORT_5">

<endPoint xmi:id="EndPoint_1224144901974" host="*" port="8007"/>

</specialEndpoints>

</serverEntries>

</serverindex:ServerIndex>

How to customize java.util.logging.Logger class to write logs in separate file than System.out.log in Websphere commerce/ HCL commerce)

/** * This method updated the passed in java.util.logging.Logger object with * custom file handler to write logs data form that class ...