wste-configuring wcbd mussie nicola piraveen
DESCRIPTION
WSTCTRANSCRIPT
-
IBM Software Group
WebSphere Support Technical Exchange
WebSphere Commerce: Configuring WebSphere Commerce Build and Deployment for SuccessMussie Abraham ([email protected])Nicola Byrne ([email protected])Piraveen Shanmuganathan ([email protected])WebSphere Commerce Support June 26th, 2013
This session will be recorded and a replay will be available on IBM.COM sites and possibly social media sites such as YouTube. When speaking, do not state any confidential information, your name, company name or any information that you do not want shared publicly in the replay. By speaking during this presentation, you assume liability for your comments.
-
IBM Software Group
WebSphere Support Technical Exchange 2
Agenda
Overview
WCBD Build Configuration
WCBD Deploy Configuration
Case Studies
Hints and Tips
References
-
IBM Software Group
OVERVIEW
WebSphere Commerce Build and Deployment
WebSphere Support Technical Exchange 3
-
IBM Software Group
WebSphere Support Technical Exchange 4
WCBD Overview
The WebSphere Commerce Build and Deployment tool is designed to automate build and deployment of customized assets.
Supports deployment of Java EE assets to a WebSphere Application Server using the wsadmin tool
Supports deployment of WebServer Assets using FTP and SCP/SFTP
Once you have your package built, you can deploy to multiple different environments:Production
Staging
Test/Development
-
IBM Software Group
WCBD Architectural Overview
WebSphere Support Technical Exchange 5
WCBD Execution process flow:1. Extracts code from SCM
2. Executes build and compilation
3. Deploys package to Server Env.
4. Deploys package to Toolkit Env.
-
IBM Software Group
WCBD Build ConfigurationsWebSphere Commerce Build and Deployment
WebSphere Support Technical Exchange 6
-
IBM Software Group
WebSphere Support Technical Exchange 7
Create Server and Toolkit packages
Clean working directory
Extract source codeExecute compilation
WCBD Build Configurations: Build Process
-
IBM Software Group
WebSphere Support Technical Exchange 8
WCBD Build Configurations: Repository structure
The structure reflects the workspace of the WebSphere Commerce Developer installation directory structure
Recommended that you use this repository structure
For WC project you are recommended to check in only the changed files
For any project in the workspace that has not been modified by your customization, do not check it into the repository. This avoids unnecessary work in the build
-
IBM Software Group
WebSphere Support Technical Exchange 9
WCBD Build Configurations: Build properties Build properties file - WC_installdir/wcbd/wcbd-build.properties.template. Important property variables to consider are as follow:Property Description Examplejava.module.list The comma-separated list of Java utility
modules to be builtWebSphereCommerceServerExtensionsLogic,TestJava1
web.module.list The comma-separated list of Web modules to be built
SiteAdministration,Stores,TestWeb1
wc.home The WebSphere Commerce or WebSphere Commerce Developer installation directory.
C:/IBM/WCDE_ENT70
was.home The WebSphere Application Server installation directory
C:/Progra~1/IBM/SDP/runtimes/base_v7
extract.ant.file The Ant build file that is used to extract source code
${basedir}/extract-local.xml
ejb.module.list The comma-separated list of EJB modules to be built
WebSphereCommerceServerExtensionsData,TestEJB1
-
IBM Software Group
WebSphere Support Technical Exchange 10
WCBD Build Configurations: Build properties Property Description Exampleconnector.module.list The comma-separated list of Java utility
modules to be builtWebSphereCommerceServerExtensionsLogic,TestJava1
ejbdeploy.trace (Feature Pack 3)
Whether internal tracing for the ejbdeploy utility should be enabled
Default set to: false
ear.dir.includes The comma-separated list of files in ${module.dir}/WC to be included in the deployment packages.
MyProject.jar,MyProjectData.jar,MyProjectHTTPInterface.war
ear.dir.excludes The comma-separated list of files in ${module.dir}/WC to be excluded in the deployment packages.
xml/config/wc-server.xml
run.clean.working.dir (Feature Pack 3)
Whether the working directory should be cleaned at the end of the build process.
Default set to: false
ejbdeploy.dbvendor The name of the database vendor which the ejbdeploy utility uses
Default set to: DB2UDB_V95
ext.compile.class.path Set the classpath of libraries without having to copy the library over to a specific folder
/usr/IBM/WebSphere/CommerceServer70/wcbd/lib
ejbdeploy.codegen Whether the Java files generated by the ejbdeploy utility (RMIC stub/tie classes) should be kept.
Default set to: false
-
IBM Software Group
WCBD Deployment Process and Configuration.
WebSphere Commerce Build and Deployment
WebSphere Support Technical Exchange 11
-
IBM Software Group
WebSphere Support Technical Exchange 12
Deployment process steps:
1. Unzip the server deployment package.
2. Optional: Set up static web server assets deployment Ant script.
3. Optional: Set up WebSphere Commerce configuration file synchronization Ant script.
4. Configure server deployment settings (The main focus of this section.)
5. Run server deployment process.
-
IBM Software Group
WebSphere Support Technical Exchange 13
Server Deployment Directory Structure:Directory or File Description
lib Contains the Java libraries required by the deployment process.
scripts wsadmin Jython deployment scripts for deployment to the EAR. (Also contains a script with reusable methods.)
source Contains the assets to deploy.
working Contains the assets generated during the deployment process.
wcbd-ant.bat/sh The batch/shell file used to start the deployment process.
-
IBM Software Group
WebSphere Support Technical Exchange 14
Toolkit Deployment Directory Structure:
Directory or File Description
backup Contains Derby database and workspace back up (if configured).
workspace Contains the RAD projects associated with the Commerce Application being deployed to.
wcbd-rad-ant.bat The batch/shell file used to start the deployment process.
-
IBM Software Group
WebSphere Support Technical Exchange 15
Creating BackupsImportant: Backup your Commerce environment.
Ensure you backup your database and Commerce EAR.Derby databases are automatically backed up
Refer to your database vendor documentation on how to backup other vendor databases
Instructions to backup the Commerce EAR can be found here:
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rdptbear_rollback.htm
-
IBM Software Group
WebSphere Support Technical Exchange 16
Deployment Configuration Files:3 Important files:
File Description
setenv.bat Path information for Ant, Java, WAS, WC, etc.
deploy--private.properties Contains information like passwords, that are needed. This is encoded during the deployment process.
deploy-.properties Contains the general settings used for deployment. (Which we will discuss next)
-
IBM Software Group
Configuration Parameters:
WebSphere Support Technical Exchange 17
Property Description Exampleconnector.module.list Add any connector
modules you would like to update/include during deployment.
TestConnector1,TestConnector2
connector.module.delete.list Add connector modules that need to be deleted.
TestConnector3,TestConnector4
ejb.module.list Add any EJB modules that you want to deploy.
WebSphereCommerceServerExtensionsData,TestEJB1
ejb.module.delete.list Add EJB modules that need to be deleted.
TestEJB2
-
IBM Software Group
Configuration Parameters (continued):
WebSphere Support Technical Exchange 18
Property Description Exampleexisting.web.module.list Add any existing Web
modules you would like to update.
SiteAdministration,Stores,LOBTools
new.web.module.list Add any new/custom Web modules you would like to deploy. Equivelant to a single module update from the WAS Administrative Console.
TestWeb1,TestWeb2
web.module.delete.list Add any Web modules you would like removed during the deployment
TestWeb3
-
IBM Software Group
Configuration Parameters (continued):
WebSphere Support Technical Exchange 19
Property Description Examplevirtual.host.mapping.list Virtual host mappings for new
Web modules that you want to deploy. The format is:moduleURI:virtualHost If not defined, the deployment descriptor (web.xml) of the module will be used.
TestWeb1.war:VH_${wc.instance.name}_Preview
TestWeb2.war:VH_${wc.instance.name}_Preview
context.root.mapping.list Context root mappings for new Web modules that you want to deploy. The format is: moduleURI:contextRootIf not specified, the default context root (same as module name) is used.
TestWeb1,TestWeb2
-
IBM Software Group
Configuration Parameters (continued):
WebSphere Support Technical Exchange 20
Property Description Examplejdbc.url Specify the
jdbc urlDB2: jdbc:db2://db_host_name:db_port/${db.name}Oracle: jdbc:oracle:oci:@db_host_name:db_port:${db.name}DB2 for i: jdbc:as400://db_host_name/${db.schema.name};database name=${db.name}
jdbc.driver Specify the classname of the jdbc driver
DB2: com.ibm.db2.jcc.DB2DriverOracle: oracle.jdbc.driver.OracleDriverDB2 for i: com.ibm.as400.access.AS400JDBCDriver
jdbc.driver.path Classpath to jdbc library and libraries it depends on.
DB2:Windows: DB2_installdir/java/db2jcc4.jar;DB2_installdir/java/db2jcc_license_cu.jarUNIX/Linux: DB2_installdir/java/db2jcc4.jar:DB2_installdir/java/db2jcc_license_cu.jarOracle: Oracle_installdir/jdbc/lib/ojdbc6.jarDB2 for i:WC: ${wc.home}/lib/jtopen.jarWCDE: ${wc.home}/wc.modules/workspace/WC/lib/jtopen.jar
-
IBM Software Group
Configuration Parameters (continued):
WebSphere Support Technical Exchange 21
Property Description Exampledatasource.jndi.name The JNDI name of the
default datasource that will be mapped for entity beans in EJB modules that are deployed. This value is only used if the EJB deployment descriptor doesn't already contain a set datasource.
DB2: jdbc/WebSphere Commerce DB2 DataSource ${wc.instance.name}
Oracle: jdbc/WebSphere Commerce Oracle DataSource ${wc.instance.name}
DB2 for i: jdbc/WebSphere Commerce iSeries DataSource ${wc.instance.name}
wsadmin.properties.file Contains the properties passed onto the wsadmin tool during deployment, including the enablement of traces.
Template available at ${was.home}/properties/wsadmin.properties
-
IBM Software Group
Running the Deployment:
The deployment can be run in normal mode or in delta mode for both server and toolkit environments:Normal Mode: All assets that are part of the source are
deployed to the target environment.
Delta Mode: Only assets that have changed since the currently deployed assets are deployed to the target environment. This is done by completing the delta preparation process and adding the Ddelta.mode=true parameter when running the deployment process to use the output configuration file from the preparation process.
WebSphere Support Technical Exchange 22
-
IBM Software Group
WebSphere Support Technical Exchange 23
Common Deployment IssuesEJBs were deployed, but datasource settings are incorrect after deployment.
Make sure EJBs were NOT included in the full.ear.dir directory specified. That directory should only contain non-module EAR assets like properties, XMLs, etc.
Make sure EJBs ARE located in the module.dir Verify the following parameters in the wcbd_deploy.properties file:
working.module.dir
ejb.module.list (EJBs to be deployed must be in this list. Note the '.jar' extension should not be included in the file name.)
mapping.option.file (if you have a CSV file with additional mapping options)
jdbc.url
jdbc.driver
jdbc.driver.path
datasource.jndi.name
-
IBM Software Group
WebSphere Support Technical Exchange 24
Common Deployment IssuesWeb modules were deployed but JDBC and virtual host settings were incorrect after deployment.
Verify the following parameters in the wcbd_deploy.properties file: full.module.dir
module.dir
working.module.dir
existing.web.module.list (if the module is being updated. Partial app update is performed.)
new.web.module.list (non-existing modules being deployed for the first time.)
context.root.mapping.list
virtual.host.mapping.list
-
IBM Software Group
WebSphere Support Technical Exchange 25
Common Deployment IssuesLOBTools was deployed, but JDBC and virtual host settings were incorrect after deployment.
LOBTools must be deployed as an existing module, so it must be listed under existing.web.module.list in the wcdb-deploy.properties file. (open.laszlo.web.module.list if deploying to Toolkit.)
-
IBM Software Group
WebSphere Support Technical Exchange 26
WCBD Case StudiesWebSphere Commerce Build and Deployment
-
IBM Software Group
Case Study 1 Build issue:Build failed for newly created moduleSymptom:copy.java.source: [javac] Compiling 2190 source files to /usr/IBM/WebSphere/CommerceServer70/wcbd/working/compile/global/bin [javac] /usr/IBM/WebSphere/CommerceServer70/wcbd/working/compile/global/src/com/commerce/search/RuleQuery.java:53: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Class for a varargs call [javac] cast to java.lang.Class[] for a non-varargs call and to suppress this warning [javac] Method aMethod = aClass.getMethod("getSingleton", null); [javac] ^ [javac] /usr/IBM/WebSphere/CommerceServer70/wcbd/working/compile/global/src/com/commerce/search/RuleQuery.java:54: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning [javac] attrInfo = (AttributeInfo)aMethod.invoke(null, null); [javac] ^ [javac] /usr/IBM/WebSphere/CommerceServer70/wcbd/working/compile/global/src/com/github/montagejava/DefaultMontageFactory.java:158: cannot find symbol [javac] symbol : method listeningDecorator(java.util.concurrent.ExecutorService) [javac] location: class com.google.common.util.concurrent.MoreExecutors [javac] les = MoreExecutors.listeningDecorator(es); [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 error [javac] 2 warnings
WebSphere Support Technical Exchange 27
-
IBM Software Group
WebSphere Support Technical Exchange 28
Case Study 1 Build issue:Build failed for newly created moduleTroubleshooting: Check if the JAR/class containing the method exists and is
configured correctly in the build properties file:ext.compile.class.path
Check if there are multiple JAR/class files that contain the same method, usually in the form of newer versions of the same JAR.
Root Cause: An older version of guava-*.jar existed at
/source/ProductETL/lib/guava-r05.jar This contained references to 'MoreExecutors' and was being loaded
during compilation instead of the intended 'guava-12.0.jar' file and throwing the error.
-
IBM Software Group
WebSphere Support Technical Exchange 29
Case Study 1 Build issue:Build failed for newly created moduleSolution:There are a number of ways to solve this issue Remove the older 'guava-r05.jar' file and see if the newer 'guava-
12.0.jar' file is compatible. Make changes to the customization based on one version of the
Guava library. Remove ProductETL from the compile project
-
IBM Software Group
Case Study 2 Build issue:SqlSyntaxErrorExceptionin logs after deploymentSymptom:Test a bean in the development environment and it works fine. However, when you deploy the EJBs on the server and try to access the bean, the SqlSyntaxErrorException occurs. The following is an example of the error that is logged in SystemOut.log:
RemoteExcepti E CNTR0019E: EJB threw an unexpected (non-declared) exception during invocation of method "findByPrimaryKey". Exception data: com.ibm.websphere.cpi.CPIException: ; nested exception is: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2INST1.DBTABLE, DRIVER=4.11.88
at com.ibm.ejs.container.ContainerManagedBeanO.load (ContainerManagedBeanO.java:1066)
at com.ibm.ejs.container.ContainerManagedBeanO.loadForEnlist (ContainerManagedBeanO.java:992)
at com.ibm.ejs.container.EntityBeanO.enlist(EntityBeanO.java:785)
WebSphere Support Technical Exchange 30
-
IBM Software Group
WebSphere Support Technical Exchange 31
Case Study 2 Build issue:SqlSyntaxErrorExceptionin logs after deploymentRoot Cause: Theejbdeploy.dbvendorproperty must be set in the build
properties fileWhen you run the WebSphere Commerce Build and
Deployment tool operation, the ejbdeploy.dbvendor property is used to determine database column types, mapping information, DDL, and other information.
Solution: Set the ejbdeploy.dbvendorproperty and save the file Rerun WCBD tool Verify the EJB JAR files are built and that there are no errors in the
log Confirm that the EJB can be accessed from the storefront
-
IBM Software Group
Case Study 3 Deploy issue:Incorrect value for wsadmin.properties.fileSymptom:[wsadmin] WASX7011E: Cannot find file "$(was.install.root)/bin/securityProcs.py"[wsadmin] WASX7011E: Cannot find file "$(was.install.root)/bin/LTPA_LDAPSecurityProcs.py"...WCBD_deploy_server_dir/wcbd-deploy.xml:142: The following error occurred while executing this line:WCBD_deploy_server_dir/wcbd-deploy.xml:208: The following error occurred while executing this line:WCBD_deploy_server_dir/wcbd-deploy-common.xml:2164: The following error occurred while executing this line:WCBD_deploy_server_dir/wcbd-deploy-common.xml:2365: Java returned: 99at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)...
WebSphere Support Technical Exchange 32
-
IBM Software Group
Case Study 3 Deploy issue:Incorrect value for wsadmin.properties.fileCause:The wsadmin.properties.file value is configured incorrectly in wcbd-deploy.properties.
### The properties file that contains JVM system properties that are passed in to# the wsadmin utility. It is used to enable wsadmin tracing among other uses. A# template for the properties file, ${was.home}/properties/wsadmin.properties,# is provided. For details, refer to the WebSphere Application Server# Information Center. Leave the value of this property empty if you do not# require this functionality.## @since# 7.0.0.2#wsadmin.properties.file=
WebSphere Support Technical Exchange 33
-
IBM Software Group
Hints and Tips
WebSphere Support Technical Exchange 34
WebSphere Commerce Build and Deployment
-
IBM Software Group
WebSphere Support Technical Exchange 35
Hints and Tips To run WCBD in debug mode, you would add -d or -debug to the
command line when running the tool or -v for verbose.wcbd-ant -buildfile wcbd-build.xml -v -Dbuild.label=build-label
Note: The log needs to be piped to a file manually since the information is not logged by the regular logging process which we put into WCBD.
Backup your application before running WCBD (export EAR from WAS Administrative Console)
Do not check in, build, or deploy OOB WebSphere Commerce files When adding a path value to a configuration parameter, be careful of
paths with spaces e.g. C:/Program Files/... Because of the space, this needs to be put within quotes 'C:/Program Files/...'
Note: The shortened value, For example: Progra~1 is accepted
-
IBM Software Group
WebSphere Support Technical Exchange 36
References Build configuration properties (wcbd-build.properties XML)
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.commerce.developer.doc%2Frefs%2Frdewcbdbldprop.htm
Server deployment configuration properties (wcbd-deploy.properties XML) http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=
%2Fcom.ibm.commerce.developer.doc%2Frefs%2Frdewcbdsvrdeployprop.htmToolkit deployment configuration properties (wcbd-deploy.properties XML)
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.commerce.developer.doc%2Frefs%2Frdewcbdtktdeployprop.htm
File structure of the server deployment directory http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=
%2Fcom.ibm.commerce.developer.doc%2Fconcepts%2Fcdewcbdserverdeploydir.htm
Tutorial: Using the WebSphere Commerce Build and Deployment tool http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=
%2Fcom.ibm.commerce.developer.doc%2Ftutorial%2Ftde_wcbd1_intro.htm
-
IBM Software Group
WebSphere Support Technical Exchange 37
Summary
WCBD Architecture
Discussed Build and Deploy Configurations
Case Studies
Hints and Tips
References
-
IBM Software Group
WebSphere Support Technical Exchange 38
Additional WebSphere Product Resources Learn about upcoming WebSphere Support Technical Exchange webcasts, and access
previously recorded presentations at:http://www.ibm.com/software/websphere/support/supp_tech.html
Discover the latest trends in WebSphere Technology and implementation, participate in technically-focused briefings, webcasts and podcasts at:http://www.ibm.com/developerworks/websphere/community/
Join the Global WebSphere Community: http://www.websphereusergroup.org
Access key product show-me demos and tutorials by visiting IBM Education Assistant:http://www.ibm.com/software/info/education/assistant
View a webcast replay with step-by-step instructions for using the Service Request (SR) tool for submitting problems electronically:http://www.ibm.com/software/websphere/support/d2w.html
Sign up to receive weekly technical My Notifications emails:http://www.ibm.com/software/support/einfo.html
-
IBM Software Group
WebSphere Support Technical Exchange 39
Connect with us!
1. Get notified on upcoming webcastsSend an e-mail to [email protected] with subject line wste subscribe to get a list of mailing lists and to subscribe
2. Tell us what you want to learnSend us suggestions for future topics or improvements about our webcasts to [email protected]
3. Be connected!Connect with us on FacebookConnect with us on Twitter
-
IBM Software Group
Questions and Answers
WebSphere Support Technical Exchange 40
This Support Technical Exchange session will be recorded and a replay will be available on IBM.COM sites and possibly social media sites such as YouTube. When speaking, do not state any confidential information, your name, company name or any information you do not want shared publicly in the replay. By speaking in during this presentation, you assume liability for your comments.
40
-
IBM Software Group
THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBMS CURRENT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION, NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO NOR SHALL HAVE THE EFFECT OF CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCT OR SOFTWARE.
Copyright and Trademark Information IBM, The IBM Logo and IBM.COM are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks and others are available on the web under Copyright and Trademark Information located at www.ibm.com/legal/copytrade.shtml.
4141
TitleAgendaSlide 3HeadingSlide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36SummaryAdditional WebSphere Product ResourcesSlide 39Slide 40Slide 41