- 浏览: 1071707 次
文章分类
最新评论
-
shunyang218:
图刷不出来 ,有点可惜了。
android facebook twitter开发 与 OAUTH -
whoshaofeng:
eval('('+str+')') 为什么加 '('
JSON那些事 -
ileson:
可否把代码贴出来、研究一下。
分享几个超级震憾的图片特效
构建 SOA 组合业务服务,第 6 部分: 自动化构建与部署步骤
可以通过在面向服务的体系结构(Service-Oriented Architecture,SOA)框架中对多个不同的服务和数据存储区进行松散耦合来创建组合应用程序。SCA 规范(请参见参考资料部分中提供的链接)描述了用于使用 SOA 构建和组装应用程序和系统的模型。组合应用程序经常使用 Rational 工具(如 IBM Rational Application Developer)作为独立的项目开发,然后使用 IBM Websphere Integration Developer 组装为 SCA 模块。最后,将这些组装好的包部署在包含 IBM WebSphere Portal Server、IBM WebSphere Process Server 容器和 IBM DB2® 数据库服务器的宿主环境中。不过,在 Rational Application Developer 和 Websphere Integration Developer 中的很多构建和导出步骤以及 WebSphere Portal Server 和 WebSphere Process Server 中的部署步骤都是手动的 GUI 指向-点击步骤。在本文中,您将了解如何实现这些手动步骤的自动化。
在部署环境中使用了 WebSphere 服务器的以下版本:
- IBM WebSphere Process Server V6.0.1,其中包括 IBM WebSphere Application Server V6.0.2
- IBM WebSphere Portal Server V6.0
- IBM DB2 Universal Database V8.2
- IBM Directory Server V5.2
自动构建将使用以下版本的 IBM 构建工具:
- IBM Rational Software Architect V6.0.1,其中还包括 IBM Rational Application Developer V6.0.1
- IBM WebSphere Portlet Factory V6.0
- IBM WebSphere Integration Developer V6.0.1
Apache Ant 是基于 Java 的构建工具,开发人员通常将其用于实现 Java 程序的自动化(有关 Apache Ant Project 的更多信息,请参见参考资料)。Eclipse 将 Ant 支持作为缺省功能提供(有关 Eclipse Ant 支持的更多信息,请参见参考资料)。在此解决方案中,将使用 Rational Application Developer 中的 runAnt 工具来启动 headless Eclipse 工作区,并执行 Ant 构建脚本(相关内容,请参见参考资料中提供的链接)。WebSphere Integration Developer 和 Rational Application Developer 提供了处理不同类型的组合应用程序项目的 Eclipse 构建程序。在 WebSphere Integration Developer 和 Rational Application Developer 内创建的这些项目的例子包括业务集成模块、Enterprise JavaBeans (EJB) 项目、动态 Web 项目和 Portlet 项目。可以在项目的顶级目录中的 .project 文件中找到每个项目对应的一组构建程序。在构建自动化流程中,可以将这些构建程序与 Rational Application Developer、WebSphere Integration Developer 及 WebSphere Portlet Factory 提供的 Ant 任务一起重用。
构建自动化流程将使用以下 Ant 任务:
-
svn checkout
,用于从 SubVersion (SVN) 团队存储库签出项目源代码。 -
projectSetImport
,用于将项目集导入 Eclipse 工作区。 -
projectSetBuild
,用于使用 Eclipse 构建程序构建项目集。 - WebSphere Portlet Factory Ant 脚本,用于将 Portlet 打包为 WAR 文件。
-
earExport
,用于将 Web 服务和 EJB 组件与 JAR 文件一起打包为 EAR 文件。 -
moduleExport
,用于将 WebShpere Integration Developer 中的 SCA 模块项目和依赖项目打包为压缩文件。
以下内容对这些任务进行了详细的说明,可以参考下面具体的示例。
组合应用程序中的组成应用程序可以驻留在不同的源代码管理(Source Code Management,SCM)存储库中。清单 1 显示了如何在 SVN 存储库中从不同的位置为不同的组合应用程序提取源代码(有关 Subversion 的信息,请参见参考资料中提供的链接)。
清单 1. 用于从源代码控制系统中签出代码的 SVN Ant 任务
<propertyname="urlRepos"value="https://svn.yourcompany.com/svn/jivaro2/trunk"/>
<targetname="checkout">
<svn>
<checkouturl="${urlRepos}/asset"destPath="${output.dir}/src/asset"/>
</svn>
<svn>
<checkouturl="${urlRepos}/wps"destPath="${output.dir}/src/wps"/>
</svn>
<svn>
<checkouturl="${urlRepos}/webservice"destPath="${output.dir}/src/webservice"/>
</svn>
<svn>
<checkouturl="${urlRepos}/portal"destPath="${output.dir}/src/portal"/>
</svn>
</target>
清单 2 显示了旨在使用 projectSetImport
将签出的项目导入 Eclipse 工作区的 Ant。
<!--###projectSetImportandBuild(allnormalprojects)###-->
<echomessage="${ant.project.name}importAllProjectSTARTED..."/>
<projectSetImportProjectSetFileName="${projectSetFileName}"
failOnError="${failonerror}"
autoDeleteExistingProjects="${autoDeleteExistingProjects}"/>
<echomessage="ProjectSetImportedProjectNames=${ImportedProjectNames}"/>
<echomessage="${ant.project.name}importAllProjectDONE."/>
</target>
projectSetImport
任务使用 Eclipse Project Set 文件来指定要导入的项目及其在文件系统中的位置,如清单 3 中所示。
清单 3. 指定组合应用程序组件的 Eclipse 项目在文件系统中的位置
<providerid="antimportProjectSet">
<projectreference="1.0,antimportProjectSet,
./tmp/src/wps/CWYBC_JDBC,CWYBC_JDBC"/>
<projectreference="1.0,antimportProjectSet,
./tmp/src/wps/CWYFF_FlatFile,CWYFF_FlatFile"/>
<projectreference="1.0,antimportProjectSet,
./tmp/src/wps/DynamicServiceLibrary,DynamicServiceLibrary"/>
<projectreference="1.0,antimportProjectSet,
./tmp/src/wps/SasBankSharedWebServiceLib,SasBankSharedWebServiceLib"/>
</provider>
</psf>
每个 WebSphere Portlet Factory Portlet 项目均包含用于导出为 WAR 文件的 Ant 脚本。清单 4 显示了如何调用 Portlet 项目的 Ant 脚本。
清单 4. 将 WebSphere Portlet Factory Portlet Eclipse 项目导出为 WAR 文件
<antdir="${src.portal}/J2BWPFPortlets/WEB-INF/bin/deployment/jsr168"
antfile="${src.portal}/J2BWPFPortlets/WEB-INF
/bin/deployment/jsr168/build_deployment.xml">
<propertyname="output.location"value="${dist}"/>
<propertyname="rootDirectory"value="${src.portal}/J2BWPFPortlets/WEB-INF"/>
<propertyname="warfile"value="J2BWPFPortlets.war"/>
<propertyname="webxmlFile"value="./web.xml"/>
</ant>
.
.
</target>
清单 5 显示了如何使用 Ant 任务 earExport
来构建和将 Web 服务与 EJB 实现打包为 EAR 文件。
清单 5. 用于构建和将 Web 服务与 EJB 实现打包为 EAR 文件的 earExport
<projectSetBuildProjectSetFileName="${webserviceSetFileName}"useBuildXML="false"
failOnError="${failonerror}"/>
<antcalltarget="exportWebServiceEarFiles"/>
</target>
<targetname="exportWebServiceEarFiles">
<earExportEARProjectName="SaasBankUserGroupEJBProjectEAR"
EARExportFile="${dist}/SaasBankUserGroupEJBProjectEAR.ear"Overwrite="true"/>
<earExportEARProjectName="NewCreditCheckEJBProjectEAR"
EARExportFile="${dist}/NewCreditCheckEJBProjectEAR.ear"Overwrite="true"/>
.
.
</target>
清单 6 显示了如何使用 Ant 任务 moduleExport
在 WebSphere Integration Developer 中构建和打包 SCA 模型项目。注意:需要调用 ServiceDeploy
Ant 任务来生成可部署的 SCA 模块。另外,需要从 developerWorks 单独下载 moduleExport
Ant 任务。请参见“Develop an Automated Build Engine Using WebSphere Integration Developer”(developerWorks,2006 年 11 月)。
清单 6. 调用 ServiceDeploy Ant 任务来生成可部署 SCA 模块
classpath="${basedir}/IntegrationModuleZipExport.jar:${wid.home}/eclipse
/plugins/org.eclipse.ui.ide_3.0.1/ide.jar"/>
<targetname="moduleExport"depends="importAllProject">
<moduleExportproject="${workspace}/SasBankWSSelectors"
output="${output.dir}/SasBankWSSelectors.zip"/>
</target>
<targetname="exportSCAEar"depends="moduleExport">
<execdir="${buildscripts.dir}"executable="${service.deploy}">
<argline="${output.dir}/SasBankWSSelectors.zip-outputApplication
${dist}/SasBankWSSelectors.ear-cleanStagingModules-noj2eedeploy-ignoreErrors"/>
</exec>
.
.
</target>
自动构建流程的最后,要将这些 EAR 和 WAR 文件打包为单个压缩文件,如清单 7 中所示。
<targetname="buildzip"depends="clean,checkout,cleanSVNPath,
buildWebservice,buildAsset,buildPortal,buildWPS">
<zipdestfile="${zipName}"basedir="${buildDir}"/>
</target>
WebSphere Process Server 的自动部署解决方案
在我们的部署拓扑中,将使用 WebSphere Process Server 实例承载 SCA 模块、J2EE 包,并使用独立的 WebSphere Portal Server 实例来承载门户组件。之所以这样,是因为 WebSphere Portal Server 会消耗大量的 Java 堆。使用实用工具 pcatWindows.exe 来在 WebSphere Process Server 中创建独立的 WebSphere 配置文件,以承载 SCA 模块。调用此实用工具时,要指定用于进行静默安装的响应文件(请参见参考资料中提供的指向“Creating a JDBC Provider and a DataSource Using Java Management Extensions API and the Scripting Tool”的链接)。清单 8 中的 Ant 任务演示了如何从 Ant 脚本调用此实用工具。
清单 8. 在 WebSphere Process Server 中创建用于承载 SCA 模块的独立 WebSphere 配置文件
<propertyname="wasHome"value="D:IBMRationalSDP.0 untimesi_v6"/>
<propertyname="wasBin"value="${wasHome}in"/>
<propertyname="profileName"value="pf2"/>
<propertyname="profilePath"value="D:IBMWebSpherepf2"/>
<propertyname="cell"value="widCell"/>
<propertyname="node"value="widNode"/>
<propertyname="host"value="localhost"/>
<propertyname="server"value="server1"/>
<targetname="createWBIProfile">
<execexecutable="${wasBin}ProfileCreator_wbipcatWindows.exe"failonerror="on">
<argline="-options${basedir} esponsefile.txt-silent"/>
</exec>
</target>
接下来,在 WebSphere Process Server 中创建数据源,以连接到数据库层。“Creating a JDBC Provider and a DataSource Using Java Management Extensions API and the Scripting Tool”(请参见参考资料)说明了如何使用 WebSphere WsAdmin Java Command Language (JACL) 脚本自动创建数据源。将从 Ant 脚本内使用 WebSphere Application Server Ant 任务 WsAdmin
调用 WsAdmin 脚本,如清单 9 中所示。
清单 9. 在 WebSphere Process Server 中创建数据源
<propertyname="wasHome"value="D:WebSphereProcServer"/>
<propertyname="conntype"value="none"/>
<propertyname="host"value="localhost"/>
<propertyname="script"value="sasDataSourceCreate.jacl"/>
<propertyname="node"value="PoddarPCNode01"/>
<propertyname="server"value="server1"/>
<propertyname="dbuser"value="db2admin"/>
<propertyname="dbpassword"value="ondemand"/>
<propertyname="dbserver"value="localhost"/>
<taskdefname="WsAdmin"classname="com.ibm.websphere.ant.tasks.WsAdmin"/>
<targetname="createDataSource">
<WsAdminwasHome="${wasHome}"script="${script}">
<argvalue="-node"/>
<argvalue="${node}"/>
<argvalue="-server"/>
<argvalue="${server}"/>
<argvalue="-dbuser"/>
<argvalue="${dbuser}"/>
<argvalue="-dbpassword"/>
<argvalue="${dbpassword}"/>
<argvalue="-dbname"/>
<argvalue="SASBNKDB"/>
<argvalue="-dbserver"/>
<argvalue="${dbserver}"/>
<argvalue="-dsname"/>
<argvalue="ebankdb"/>
<argvalue="ebankdb"/>
</WsAdmin>
</target>
WebSphere Application Server 提供了名为 ws_ant 的实用工具,用于将 WsAdmin
之类的 WebSphere 特定的 Ant 任务与内置 Apache Ant 任务一起打包。可使用 ws_ant 实用工具和 WebSphere Application Server Ant 任务 wsInstallApp
将 WebSphere 流程模块、Web 服务及 EJB 应用程序部署到 WebSphere Process Server 中,如清单 10 中所示。
<propertyname="temp"value="${basedir}/tmp"/>
<propertyname="wasHome"value="D:IBMRationalSDP.0 untimesi_v6"/>
<propertyname="conntype"value="SOAP"/>
<propertyname="host"value="localhost"/>
<propertyname="port"value="8880"/>
<propertyname="user"value="wpsbind"/>
<propertyname="password"value="wpsbind"/>
<taskdefname="wsInstallApp"classname="com.ibm.websphere.ant.tasks.InstallApplication"/>
<targetname="installApps"depends="unZipPack,unInstallApps">
<wsInstallAppwasHome="${wasHome}"ear="${temp}/CEIEventEmitterRouterEAR.ear"
conntype="${conntype}"
host="${host}"
port="${port}"
user="${user}"
password="${password}"
failonerror="false"/>
<wsInstallAppwasHome="${wasHome}"ear="${temp}/CEIQueryServiceEAR.ear"
conntype="${conntype}"
host="${host}"
port="${port}"
user="${user}"
password="${password}"
failonerror="false"/>
.
.
.
</target>
WebSphere Portal Server 的自动部署解决方案
组合应用程序中的 Portlet 经常要求与 WebSphere Process Server 中的人工任务管理器进行交互。要部署这些 Portlet,请首先在 WebSphere Portal Server 中创建 WebSphere Process Server 配置文件(请参见参考资料,其中提供了指向“Creating a Stand-Alone Server Profile Silently”的链接)。此配置文件允许 WebSphere Portal Server 和 WebSphere Process Server 在相同的应用服务器实例内运行。
门户主题和皮肤经常用于提供属于不同企业的独特门户外观(请参见参考资料,其中提供了指向“Deploying Customized Themes and Skins”的链接)。可以使用 Ant 自动部署门户主题和皮肤,如清单 11 中所示。
清单 11. 使用 Ant 脚本将主题和皮肤部署到 WebSphere Portal Server 中
<svn>
<checkouturl="${urlRepos}/installation/InstallationFiles/ThemesSkins"
destPath="${temp}"/>
</svn>
</target>
<targetname="copyThemesSkins"depends="clean">
<copytodir="${destTheme}/SasBankBank1AdminTheme"overwrite="true">
<filesetdir="${temp}/SasBankBank1AdminTheme"/>
</copy>
<copytodir="${destTheme}/SasBankBank1Theme"overwrite="true">
<filesetdir="${temp}/SasBankBank1Theme"/>
</copy>
<copytodir="${destTheme}/SasBankBank2Theme"overwrite="true">
<filesetdir="${temp}/SasBankBank2Theme"/>
</copy>
<copytodir="${destSkin}/SasBankBank1Skin"overwrite="true">
<filesetdir="${temp}/SasBankBank1Skin"/>
</copy>
<copytodir="${destSkin}/SasBankBank2Skin"overwrite="true">
<filesetdir="${temp}/SasBankBank2Skin"/>
</copy>
</target>
在自动构建流程执行期间,会将 Portlet 导出为 WAR 文件。可以使用 WebSphere Portal Server XML 配置接口来部署 Portlet 和 Portlet 的配置。此接口会在 WebSphere Application Server 安装目录的 installableAppes 子目录中查找 Portlet WAR 文件。可以使用清单 12 中的 Ant 脚本来将 Portlet WAR 文件放到恰当的目录中。
清单 12. 用于将 Portlet WAR 文件放入相应的目录中的 Ant 脚本
<propertyname="portalInstallable"value="${portalServer}/installableApps"/>
<targetname="unZipPack">
<unzipsrc="${basedir}/JivaroBankingV2.zip"dest="${temp}/war">
<patternset>
<includename="**/*.war"/>
</patternset>
</unzip>
</target>
<targetname="copyWarToPortal"depends="unZipPack">
<copytodir="${portalInstallable}"overwrite="true">
<filesetdir="${temp}/war"/>
</copy>
</target>
可以在 WebSphere Application Server 中使用虚拟门户来在单个应用服务器实例中承载多个承租者。清单 13 中的 Ant 脚本说明了如何在 WebSphere Portal Server 中创建虚拟门户。
清单 13. 在 WebSphere Portal Server 中创建虚拟门户
<conditionproperty="WPSConfig"value="WPSConfig.bat">
<and>
<osfamily="windows"/>
</and>
</condition>
<conditionproperty="WPSConfig"value="WPSConfig.sh">
<and>
<osfamily="unix"/>
</and>
</condition>
</target>
<targetname="createVirtualPortal"depends="setConfigCommand">
<execdir="${portalConfig}"executable="CMD">
<argline="/C${WPSConfig}create-virtual-portal-DVirtualPortalTitle=bank1
-DVirtualPortalRealm=bank1-DVirtualPortalContext=bank1"/>
</exec>
<execdir="${portalConfig}"executable="CMD">
<argline="/C${WPSConfig}create-virtual-portal-DVirtualPortalTitle=bank2
-DVirtualPortalRealm=bank2-DVirtualPortalContext=bank2"/>
</exec>
<execdir="${portalConfig}"executable="CMD">
<argline="/C${WPSConfig}create-virtual-portal-DVirtualPortalTitle=bank3
-DVirtualPortalRealm=bank3-DVirtualPortalContext=bank3"/>
</exec>
</target>
最后,清单 14 中的 Ant 脚本说明了如何使用 WebSphere Portal XML 配置接口为每个虚拟门户部署门户配置。
清单 14. 使用 WebSphere Portal Server XML 配置接口配置每个虚拟门户
setXmlAccessCommand,copyWarToPortal">
<execdir="${portalBin}"executable="CMD">
<argline="/C${xmlAccess}-in${basedir}anksrelease.xml
-userwpsadmin-pwdwpsadmin-urlhttp://${host}:${port}/wps/config"/>
</exec>
<execdir="${portalBin}"executable="CMD">
<argline="/C${xmlAccess}-in${basedir}ank1release.xml
-userwpsadmin-pwdwpsadmin-urlhttp://${host}:${port}/wps/config/bank1"/>
</exec>
<execdir="${portalBin}"executable="CMD">
<argline="/C${xmlAccess}-in${basedir}ank2release.xml
-userwpsadmin-pwdwpsadmin-urlhttp://${host}:${port}/wps/config/bank2"/>
</exec>
</target>
可以使用 WebSphere Portal Server XML 配置接口(请参见参考资料,其中提供了指向“Moving from a Test to Production Server Using the XML Configuration Interface”的链接)来将门户配置从开发/过渡环境导出到生产环境中。还可以使用 WebSphere Portal 发布构建程序工具(有关更多信息,请参见参考资料)来开发将门户配置部署到生产服务器所需的配置更改的测试版。清单 15 中的命令说明了如何使用 xmlaccess
和 releasebuilder
生成测试版 XMLAccess 配置文件。
清单 15. 使用 xmlaccess 和 releasebuilder 生成测试版 XMLAccess 配置文件
-urlhttp://testportalserver.yourco.com/wps/config-outREV1_config.xml
2.Deployportlets,themesandskinsandcreatevirtualportals.
3.xmlaccess.bat-inExportRelease.xml-userwpsadmin-passwordwpsadminpwd
-urlhttp://testportalserver.yourco.com/wps/config-outREV2_config.xml
4.releasebuilder.bat-inOldREV1_config.xml-inNewREV2_config.xml
-outoutputfile.xml
清单 16 说明了如何使用 WebSphere Portal Server xmlaccess
接口为 Portlet 配置主题和皮肤。
清单 16. 使用 WebSphere Portal Server xmlaccess 接口为 Portlet 配置主题和皮肤
<requestxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"build="wp5103_025"
type="update"version="5.1.0.3"xsi:noNamespaceSchemaLocation="PortalConfig_1.3.1.xsd">
<portalaction="locate">
<skinaction="update"active="true"default="false"
objectid="_K_003II0L7N8022GN6_69"
resourceroot="SasBankBank1Skin"type="default">
<localedatalocale="en">
<title>Bank1Skin</title>
<description></description>
</localedata>
</skin>
<themeaction="update"active="true"default="false"
defaultskinref="_K_003II0L7N8022GN6_69"objectid="_J_003II0L7N8022GN6_69"
resourceroot="SasBankBank1Theme">
<localedatalocale="en">
<title>Bank1Theme</title>
<description></description>
</localedata>
<allowed-skinskin="_K_00KC5030880624SK_35"update="set"/>
<allowed-skinskin="_K_00KC5030880624SK_39"update="set"/>
.
.
</theme>
</portal>
</request>
清单 17 中的 XML 代码片段说明了用于在 WebSphere Portal Server 中配置 Portlet WAR 文件的 XMLAccess 脚本的内容。配置信息包括要求有一些预先存在的门户安全性配置的访问控制配置(请参见参考资料,其中给出了指向“Section DB2 and Tivoli® Directory Server Configuration”的链接)。
removable="true"
uid="sasbankloanapprovalportlet.SasBankLoanApprovalPortletPortlet.9bdb2f3550.webmod">
<url>file://localhost/$server_root$/installableApps/SasBankLoanApprovalPortlet.war</url>
<access-controlexternalized="false"owner="undefined"private="false">
<roleactionset="Editor"update="set">
<mappingsubjectid="cn=wpsadmin,cn=groups,dc=banks,dc=com"
subjecttype="user_group"update="set"/>
<mappingsubjectid="cn=wpsadmins,cn=groups,dc=bank3,dc=com"
subjecttype="user_group"update="set"/>
<mappingsubjectid="cn=bank1admins,cn=groups,dc=bank1,dc=com"
subjecttype="user_group"update="set"/>
</role>
</access-control>
<servletaction="update"active="true"cache-expiration="0"
objectid="_V_00KC5030880624SK_IP"
referenceid="LoanApprovalPortlet.servlet"
remote-cache-dynamic="false"
remote-cache-scope-private="false"/>
<portlet-appaction="update"active="true"defaultlocale="en"
name="sasbankloanapprovalportlet.SasBankLoanApprovalPortletPortlet.9bdb2f3550"
objectid="_2_00KC5030880624SK_IP"
uid="sasbankloanapprovalportlet.SasBankLoanApprovalPortletPortlet.9bdb2f3550">
<access-controlexternalized="false"owner="undefined"private="false"/>
<portletaction="update"active="true"defaultlocale="en"
name="LoanApprovalPortlet"objectid="_3_00KC5030880624SK_IP"
provided="false"servletref="_V_00KC5030880624SK_IP">
<access-controlexternalized="false"owner="undefined"private="false">
<roleactionset="Editor"update="set">
<mappingsubjectid="cn=wpsadmin,cn=groups,dc=banks,dc=com"
subjecttype="user_group"update="set"/>
<mappingsubjectid="cn=wpsadmins,cn=groups,dc=bank3,dc=com"
subjecttype="user_group"update="set"/>
<mappingsubjectid="cn=bank1admins,cn=groups,dc=bank1,dc=com"
subjecttype="user_group"update="set"/>
</role>
</access-control>
</portlet>
</portlet-app>
</web-app>
除了 Portlet 配置和主题与皮肤的配置外,包含在 XMLAccess 配置文件中的门户解决方案版本还包括门户配置数据,如内容树、页布局、访问控制列表等。
DB2 和 Tivoli Directory Server 配置脚本
清单 18 显示了一个 IBM 目录服务器配置文件,该文件配置轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP)服务器,以提供 WebSphere Portal 和 WebSphere Process Server 安全性。
dn:dc=banks,dc=com
objectclass:domain
objectclass:top
#Addlinesaccordingtothisschemethatcorrespondtoyoursuffix
dc:banks,dc=com
dc:banks
dn:dc=bank1,dc=com
objectclass:domain
objectclass:top
dc:bank1,dc=com
dc:bank1
dn:cn=users,dc=bank1,dc=com
objectclass:container
objectclass:top
cn:users
.
.
.
可以使用清单 19 中的 IBM Directory Server 命令将此用户数据导入到目录服务器中。
可以使用清单 20 中的 IBM DB2 Universal Database™ Data Definition Language (DDL) 脚本配置数据库层。
CREATEDATABASECREDITDB;
echo---connecttoCREDITDBdatabase---;
CONNECTTOCREDITDB;
createschemacredit;
--Thistablestoresthebasiccustomerinformationincludingcreditscore
echo---dropthecredit.customertable---;
droptablecredit.customer;
echo---createthecredit.customertable---;
createtablecredit.customer(
custIDchar(32)NotNULL,
firstnamevarchar(32),
lastnamevarchar(32),
creditscoreINT,
ssnCHAR(9)notnull,
statusdateTimestampnotnullwithdefaultCURRENT_TIMESTAMP,
phoneCHAR(20),
altphoneCHAR(20),
maritalCHAR(1),
sexCHAR(1),
dobDATE,
streetvarCHAR(50),
cityvarchar(32),
stateCHAR(12),
zipcodeCHAR(10),
countryvarchar(32),
homeownersmallint,
primarykey(custID)
);
echo---adduniqueconstrainttothecredit.customertable---;
altertablecredit.customeraddunique(ssn);
可以使用清单 21 中的 DB2 命令配置 DB2 数据库上的模式。
设置自动构建和部署时可能会遇到一些问题:
- 从 WebSphere Process Server 卸载业务流程执行语言(Business Process Execution Language,BPEL)或 HumanTask 组件应用程序前,必须确保所有 BPEL/HumanTask 实例均已终止,否则就不能正确卸载。可以使用 Business Process Choreographer Explorer 来检查和终止流程的任何活动实例(有关使用 Business Process Choreographer Explorer 的更多信息,请参见参考资料)。
- Microsoft® Windows® 中的长路径可能在部署期间导致 WSAdmin 中出现错误,包括
[wsadmin] java.io.IOException: java.io.IOException: The URI length is greater than the Windows limit of 259 characters. Unable to create or update file.
这通常都是无害的。 - 在与 WebSphere Process Server V6.0.1 相同的 Windows 计算机上安装 WebSphere Portal Server V5.1.0.3 可能会导致出现问题。您可能需要在安装 WebSphere Portal Server 前删除文件 c:/Windows/vpd.properties。
在本文中,我们了解了如何为使用各种类型组件的组合应用程序开发自动构建和部署解决方案,这些组件包括 Portlet、流程模块、Web 服务、J2EE 组件、数据库模式以及 LDAP 模式。我们使用了各个 WebSphere 产品(如 WebSphere Process Server)提供的 Ant 任务、WebSphere Portal 和 WebSphere Application Server 支持的脚本语言、DB2 及 Tivoli LDAP 目录服务器。我们已经作为示例了解了采用脚本的自动化解决方案的各个代码片段。请一定参阅“参考资料”部分提供的各个参考信息,以了解有关这些主题的更多信息。
学习
- 您可以参阅本文在 developerWorks 全球站点上的 英文原文 。
- 了解有关 Apache Ant Project 的更多信息。
- 访问 Eclipse Ant Support,以获得更多帮助。
- 阅读“Running Ant in a Headless Workspace”。
- 了解关于项目构建程序和本质的更多信息。
- 了解关于以下 Ant 任务的信息:
- 阅读“Setting Up WebSphere Portal Server 5.1.0.1 on WebSphere Process Server 6.0.1”。
- 阅读“Creating a Stand-Alone Server Profile Silently”。
- 阅读“Creating a JDBC Provider and DataSource Using Java Management Extensions API and the Scripting tool”。
- 阅读“Moving from a Test to Production Server Using the XML Configuration Interface”。
- 阅读“Building a Release”,以了解 WebSphere Portal Server 配置。
- 获得 WebSphere Portal Server WPSConfig 接口配置程序。
- 阅读 服务组件体系结构 规范。
- 阅读关于 SubVersion 源代码管理的信息。
- 了解关于在 WebSphere Portal Server 中部署自定义主题和皮肤的更多信息。
- 阅读“Starting to Use the Business Process Choreographer Explorer”,了解关于检查业务流程的活动实例的更多信息。
- 阅读文章“Develop an Automated Build Engine Using WebSphere Integration Developer”(developerWorks,2006 年 11 月)。
- 阅读“Deploying Applications Using Ant Tasks”,以了解如何在 WebSphere Process Server 中使用
ServiceDeploy
Ant 任务。
- 请访问 IBM developerWorks 上的 SOA 与 Web services 专区,以获得数百篇关于如何开发 Web 服务应用程序的文章以及入门级、中级和高级教程,您将大开眼界。
-
IBM SOA 网站提供了 SOA 的概述,并说明了 IBM 可以如何帮助您实现此目标。
- 了解关于 developerWorks 技术事件和网络广播的最新消息。
- 获取此系列的 RSS Feed。(了解关于 RSS 的更多信息。)
相关推荐
变化点角色用例拓扑关系图支持业务服务的组合应用程序特性通过不同的方式组合现有SOA服务来进行SOA服务集成。我们将重点讨论如何在服务组件体系结构框架内完成此工作。引言组合应用程序提供了集成现有面向服务的体系...
采用这种方法的一个关键步骤是构建可重用服务的组合。而SOA 作为沟通 IT 世界和业务世界的桥梁这一论断在不断地发展着。服务组合的构建是一项时间和资源的投资,它必将在面向服务的业务应用程序方面带来巨大的回报。...
使用Java Web服务构建SOA使用Java Web服务构建SOA使用Java Web服务构建SOA使用Java Web服务构建SOA
采用这种方法的一个关键步骤是构建可重用服务的组合。SOA 表示新应用程序的设计、开发和集成方式的根本性转变。它还将企业应用程序的开发简化为模块化业务服务,可以轻松地对其进行集成和重用。
ORACLE SOA 业务流程管理 与 Web 2.0:
第一部分介绍关于 SOA 和 Web Services 的初步知识,第二部分介绍Apache CXF 框架的一些基础知识,第三部分重点介绍 Apache CXF 框架的应用,包括 Apache CXF 框架的前端 (Frontends) 应用、 数据绑定 ...
使用Java Web服务构建SOA 中文版 part3
SOA组合业务服务的自动化测试 软件测试 通过本文您将了解组合业务服务的概念以及如何自动化的将WebSphereProcessServer,WebSphereApplicationServer,DB2等应用中间件和RationalPerformanceTesterforSOAquality,...
SOA 在金融行业的应用一:业务流程管为切入点
本文是其中的第3部分,将对WS响应模板模式实现进行说明。可以将WS响应模板模式应用到服务的UML模型,以创建更为灵活的服务。我们将以SOAImplementandOptimizeServicesRecipe以及随附的参考示例(本系列前两篇文章对...
基于SOA架构服务组合的研究与实现,基于SOA架构服务组合的研究与实现,基于SOA架构服务组合的研究与实现
硕士论文,2008年的SOA中服务组合与自动构建技术研究.kdh,很实用。
SOA与REST是当前两种流行的技术架构... 《SOA与REST:用REST构建企业级SOA解决方案》适合于考虑实施面向服务架构的开发人员、架构师或项目经理阅读参考,尤其适合任何SOA实践者或任何计划发起一个SOA项目的专业人员。
2013版的 <基于Apache CXF构建SOA应用> 源码 Apache CXF是一个开放源码的Web服务框架,提供了一个易于使用,用于开发Web Services标准为基础的编程模型。本书主要介绍Apache CXF在构建SOA架构各个方面的应用说明和...
使用Java Web服务构建SOA源代码使用Java Web服务构建SOA源代码使用Java Web服务构建SOA源代码使用Java Web服务构建SOA源代码