IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  WebSphere  >

为带有内嵌JMS 的补偿工作流安装和配置 WebSphere Application Server Enterprise Process Choreographer BPE 容器

developerWorks
文档选项

未显示需要 JavaScript 的文档选项


级别: 初级

Kate Bittles (katebittles@uk.ibm.com), IT 架构师, IBM Business Integration,Hursley,UK

2003 年 12 月 01 日

本文将指导您完成安装、配置和测试带有JMS 和 DB2的 WebSphere Application Server Enterprise Process Choreographer BPE 容器的整个过程,使您能够安装和运行补偿工作流。

©IBM版权所有,2003年。保留所有权利。

引言

本文将指导您完成安装、配置和测试带有JMS 和 DB2的 WebSphere Application Server Enterprise Process Choreographer BPE 容器的整个过程,使您能够安装和运行补偿工作流。如果您以前尝试过这样做,就会知道安装BPE 容器是比较复杂的,所以我们在这里整理了完成此项任务的步骤,并且提供了一些问题诊断信息来帮助解决最典型的困难。

概括地说, 步骤 1要求您验证 WebSphere Application Server 的安装。 步骤2步骤3(它们可以按照任何一种次序执行)将解决所需组件(比如 DB2_JMS 和 BPE 容器本身)的安装和配置问题。 步骤4将列出最后需要完成的管理步骤,而 步骤 5将完成安装和配置旅行预订样本(Travel Booking Sample),这样您就可以确认带有嵌入式 JMS 的补偿 BPE 容器安装完毕。

如果您在安装和配置的过程中出现错误,本教程末尾的 问题诊断部分将帮助您解决您的错误,可以发现的错误以及最新的服务器启动信息都附在 <WebSphere Application Server Install Root>\logs\server1\SystemOut.log 文件最后。

由于本文的重点式任务的执行顺序和正确的配置步骤,所以使用了通用和简化的说明,并且您具有 WebSphere Application Server Enterprise Version 5 和相关软件(包括像嵌入式消息和 Process Choreographer 这样的特征)的应用知识。





回页首


1. 安装 WebSphere Application Server

我们假定您已经成功地安装和配置了 WebSphere Application Server V5 的系统必备软件。因此,您必须:

  1. 安装 WebSphere Application Server Enterprise Edition Version 5.0.x(带有嵌入式消息传递和所选的 Process Choreographer(包括 ProcessChoreographer 样本),并且验证安装成功。 
  2. 停止和重新启动服务器。




回页首


2. 配置 DB2 数据库和 JMS

  1. 在命令提示符下,将目录更改为 <WebSphere Application Server Install Root>\ProcessChoreographer ,然后运行:
    Create_ds_db2.jacl您可能想要打开该文件以检查成功运行 JACL脚本的说明。例如:
    d:\WebSphere\appserver\bin\wsadmin -f create_ds_db2.jacl -node ozona -server server1
    -dbPath "d:/db2/sqllib" -dbName BPEDB -userid winadmin -passwd pwd123如果 JACL 脚本成功运行,则会产生下列输出:
    WASX7209I: Connected to process "server1" on node ozona using SOAP
    connector; The type of process is: UnManagedProcess
    Start creating DataSource definition for Process Choreographer
    Create settings for Server server1 on ozona
    Create J2C Authentication Data Entry BPEAuthDataAliasDb2
    Create variable DB2_INSTALL_ROOT
    Create BPEJdbcDriverDB2
    Create BPEDataSourceDb2
    Create BPEDataSourceDb2_CF
    -----------------------------------------------------------
    Data source configuration
    Server:                     server1
    Node:                       ozona
    JNDI name:                  jdbc/BPEDB
    Database install path:      d:/db2/sqllib
    Database name:              BPEDB
    User:                       winadmin
    -----------------------------------------------------------
  2. 接下来,在 DB2 命令提示符下,退出 DB2 会话,将目录更改为 <WebSphere Application Server Install Root>\ProcessChoreographer ,然后运行:
    db2 -tf createDatabaseDb2.ddl(如果将 -z tempfile.txt 添加到此命令的末尾,则会使输出重定向到指定的文件)

    如果 DDL 运行成功,则会给您提供以下屏幕输出:
    DB20000IThe CREATE DATABASE command completed successfully.


       Database Connection Information

     Database server       = DB2/NT 7.2.5
     SQL authorization ID  = WINADMIN
     Local database alias  = BPEDB


    DB20000IThe SQL command completed successfully.
    DB20000IThe SQL command completed successfully.
    .............
    DB20000IThe SQL command completed successfully.
    set DB2_RR_TO_RS=YES
  3. 在命令提示符下,运行:
    config_queue_emb.jacl将目录更改为 <WebSphere Application Server Install Root>\ProcessChoreographer ,然后输入与 config_queue_emb.jacl 文件中指定的一样的命令:
    D:\WebSphere\AppServer\bin\wsadmin -f config_queue_emb.jacl -node ozona -server server1
    -userid winadmin -passwd pwd123如果 JACL 脚本运行成功,则会产生以下屏幕输出:
    WASX7209I: Connected to process "server1" on node ozona usingSOAP
    connector; The type of process is: UnManagedProcess
    Configure Queue settings using embedded messaging Process Choreographer
    Create settings for Server
    server1(cells/ozona/nodes/ozona/servers/server1:server.xml#Server_1)
    Create J2C Authentication Data Entry BPEAuthDataAliasEmb_ozona_server1
    Create BPECF Queue Connection Factory:
    BPECF(cells/ozona/nodes/ozona/servers/server1:resources.xml
    #WASQueueConnectionFactory_2)
    Create BPECFC Queue Connection Factory:
    BPECFC(cells/ozona/nodes/ozona/servers/server1:resources.xml
    #WASQueueConnectionFactory_3)
    Add JMS Queue BPEIntQueue to JMS Server
    Add JMS Queue BPEApiQueue to JMS Server
    Add JMS Queue BPEHldQueue to JMS Server
    Add JMS Queue BPERetQueue to JMS Server
    Queue list =
    PlantsByWebSphereQ;BPEIntQueue;BPEApiQueue;BPEHldQueue;BPERetQueue
    Create BPEIntQueue
    Create BPEInternalListenerPort
    Create StateManageable: initialState = START
    Create BPEApiQueue
    Create BPEApiListenerPort
    Create StateManageable: initialState = START
    Create BPEHldQueue
    Create BPEHoldListenerPort
    Create StateManageable: initialState = START
    Create BPERetQueue
    Save Admin changes
    -----------------------------------------------------------
    Queue and listener configuration
    Node:                      ozona
    IntQueueName:              BPEIntQueue
    ApiQueueName:             BPEApiQueue
    HldQueueName:             BPEHldQueue
    RetQueueName:             BPERetQueue
    User:                     winadmin
    J2C Authentication Data:   BPEAuthDataAliasEmb_ozona_server1
    -----------------------------------------------------------
  4. 在命令提示符下,运行:
    createQueues.bat将目录更改为 <WebSphere Application Server Install Root>\ProcessChoreographer ,然后输入以下命令:
    createQueues.bat WAS_ozona_server1其中, WAS_ozona_server1 是您想要创建的 Queue Manager 的名称。如果 BAT 文件运行成功,则会产生以下屏幕输出:
    Creating QMgr 'WAS_ozona_server1'
    AMQ8110: WebSphere MQ queue manager already exists.
    Starting QMgr 'WAS_ozona_server1'
    WebSphere MQ queue manager running.
    Creating Queues on QMgr 'WAS_ozona_server1'
    5724-B41 (C) Copyright IBM Corp. 1994, 2002.ALL RIGHTS RESERVED.
    Starting MQSC for queue manager WAS_ozona_server1.


         1 : DEFINE QLOCAL('BPEIntQueue') +
           : REPLACE +
           : DESCR('Internal Queue for ProcessChoreographer') +
           : BOTHRESH(9) +
           : BOQNAME('BPEHldQueue') +
           : PUT(ENABLED) +
           : GET(ENABLED) +
           : DEFPSIST(YES) +
           : MAXMSGL(4194304)
    AMQ8006: WebSphere MQ queue created.
         2 : DEFINE QLOCAL('BPEApiQueue') +
           : REPLACE +
           : DESCR('Api Queue for ProcessChoreographer') +
           : BOTHRESH(9) +
           : BOQNAME('BPEHldQueue') +
           : PUT(ENABLED) +fs
           : GET(ENABLED) +
           : DEFPSIST(YES) +
           : MAXMSGL(4194304)
    AMQ8006: WebSphere MQ queue created.
         3 : DEFINE QLOCAL('BPEHldQueue') +
           : REPLACE +
           : DESCR('Hold Queue for ProcessChoreographer') +
           : BOTHRESH(9) +
           : PUT(ENABLED) +
           : GET(ENABLED) +
           : DEFPSIST(YES) +
           : MAXMSGL(4194304)
    AMQ8006: WebSphere MQ queue created.
         4 : DEFINE QLOCAL('BPERetQueue') +
           : REPLACE +
           : DESCR('Retention Queue forProcess Choreographer') +
           : BOTHRESH(9) +
           : BOQNAME('BPEHldQueue') +
           : PUT(ENABLED) +
           : GET(ENABLED) +
           : DEFPSIST(YES) +
           : MAXMSGL(4194304)
    AMQ8006: WebSphere MQ queue created.
    4 MQSC commands read.
    No commands have a syntax error.
    All valid MQSC commands were processed.




回页首


3. 安装和配置 BPE 容器

  1. 打开并进入 WebSphere Application Server 管理控制台(如果没有启用安全性,您可以使用任何值进入)。
  2. 从菜单栏,选择 Servers => Application Servers => Server1
  3. 选择 Configuration。在对话框的“Additional Properties”区,选择 Business Process Container。消息应该出现在屏幕的顶部,如下所示:
    Message(s) : The Business Process container is not currently installed.If you wish to install it, change the values appropriately and press theInstall button. Once the container is installed, its values cannot be changed.
  4. 向下移动字段列表至 JMS API Userid and Password 字段。输入与上面所用的一样的用户 ID 和密码,然后选择 Apply
  5. 在“Additional Properties”中,选择 Business Process Container Install Wizard。请 不要在单击屏幕顶部的 Install 按钮。
  6. 在 Business Process Container Install 向导中,您将需要完成“Select the Database Configuration for the Business Process Container”对话框(图1)。需要输入值的字段是:
    • Create a new XA Datasource
    • Classpath
    • Datasource Password.
    其他的值将自动进行缺省设置。单击 Next
    图1. 业务流程容器的数据库配置
    业务流程容器的数据库配置
  7. 在“JMS Providers and Security”对话框中,完成如图2所示的字段。JMS Providers 字段必须设置为 WebSphere JMS Provider,而 JMS Password 字段必须包含一个值。这里最好保留其余的字段不变或保持空白。
    图2. JMS 提供者和安全性
    JMS 提供者和安全性
  8. 在对话框的“Business Process Container Security Configuration”区中,完成如图3所示的字段,然后单击 Next。建议 Security Role Mapping 和 JMS API User ID 字段包含与前面所用的一样的用户 ID 和密码。
    图3. 业务流程容器安全性配置
    业务流程容器安全性配置
  9. 在“Select JMS Resources”对话框(图4)中,您可以采取下列两种操作方式中的一种:
    • 选择 Create new JMS Resources using default values,然后单击 Next,或
    • 选择 Select Existing JMS Resources,它将获取您在前面的步骤中创建的 JMS 资源。通常推荐这样做。单击 Next

    图4. 选择 JMS 资源
    选择 JMS 资源
  10. 最后,“Business Process Container Install Wizard Summary”面板显示(图5)。请进行检查,以确保显示的信息就是您在前面的步骤中所指定的。如果您感到满意,则单击 Finish
    图5. Business Process Container 安装向导概览
    Business Process Container 安装向导概览
  11. 当 BPE 容器正在安装时,程序输出将显示在屏幕上。如果安装成功,则在输出的底部选择 SaveURL,然后在下一个屏幕上,选择 Save按钮。如果安装不成功,您将需要 重复此过程
  12. 当 BPE 已经安装完毕时,就停止该应用程序服务器,然后重新进行启动。

    在此处停止服务器时,一般会从 <WebSphere Application Server Install Root>\logs\server1 目录中删除所有的日志文件。通过重命名 SystemOut.log 文件来保留它的备份,这样在下一次重新启动该应用程序时就不会添加它。
  13. 重新启动该服务器,然后通过管理控制台退回到应用程序服务器。选择 Applications => Enterprise Applications来查看全部应用程序所列的状态。您刚刚安装的 BPE 容器应该作为已启动(Started)状态中的应用程序列出,如图6所示。如果您没有看到已启动(Started)状态符,则请打开 SystemOut.log 文件,然后搜索所有的错误信息。本文末尾的 问题诊断部分可以帮助您解决这些错误。
    图6. 已安装的应用程序
    已安装的应用程序




回页首


4. BPE 安装配置的后期工作

我们基本上完成了 BPE 容器的安装和配置。现在需要使用 WebSphere Application Server 管理控制台完成一些后期配置项目。

  1. 从管理控制台中,选择 Environment => Manage WebSphere Variables,确保为 DB2_INSTALL_ROOT and DB2_JDBC_DRIVER_PATH 存储的值是正确的:
    DB2_INSTALL_ROOT : D:/DB2/SQLLIB
    DB2_JDBC_DRIVER_PATH :${DB2_INSTALL_ROOT}/JAVA/DB2JAVA.ZIP
  2. 从管理控制台中,选择 Resources => JDBC Provider => JDBC Provider for Process Choreographer=> Data Sources => JDBC Provider for Process Choreographer。确保 Node 范围设置为“Server”范围,并且检查Component-managed Authentication Alias 是否设置为“Emb”别名,确保管理控制台配置指向正确的引用,例如:
    BPEAuthDataAliasEmb_ozona_server1
  3. 从管理控制台中,选择 Resources => JDBC Provider => JDBC Provider for Process Choreographer。检查 JDBC Provider 的类路径定义是否正确而 没有两个条目。如果 BPE 容器安装和配置过程确实在类路径字段中添加了两个值,则请删掉一个条目。例如,在我安装时,类路径值为:
    ${DB2_INSTALL_ROOT}/java/db2java.zip
  4. 停止该服务器,然后重新进行启动。




回页首


5. 样本库

我们已经完成了安装和配置,现在需要验证该过程已经成功完成。

  1. 通过选择 Start => Programs => WebSphere Application Server => Samples Gallery来启动 Samples Gallery。
  2. 从“Samples Gallery”面板的左栏中,选择 Enterprise Extensions => Process Choreographer => Configure and Run
  3. 在命令提示符下,将目录更改为 <WebSphere Application Server Install Root>\ProcessChoreographer ,然后输入以下命令来安装 Travel Booking Sample:
    d:\websphere\appserver\bin\wsadmin -c "$AdminApp install
    D:/websphere/appserver/samples/lib/bpe/TravelBookingSamp.ear" -user winadmin -password pwd123注意:这可能需要花几分钟时间,因此不要迅速退出DOS命令。BAT文件的成功执行将提供如下屏幕输出:
    WASX7209I: Connected to process "server1" on node ozona using SOAP
    connector; The type of process is: UnManagedProcess
    ADMA5016I: Installation of TravelBookingSamp started.
    BPEC0016I: Process module deployment of dpl_TravelBookingSamp.ear completed.
    ADMA5005I: Application TravelBookingSamp configured in WebSphere repository
    BPEC0015I: Process module configuration of dpl_TravelBookingSamp.ear completed.
    BPEC0017I: Process module installation of dpl_TravelBookingSamp.ear completed.
    ADMA5001I: Application binaries saved in
    D:\WebSphere\AppServer\wstemp\Scriptf40c26ab66\workspace\ce
    lls\ozona\applications\TravelBookingSamp.ear\TravelBookingSamp.ear
    ADMA5011I: Cleanup of temp dir for app TravelBookingSamp done.
    ADMA5013I: Application TravelBookingSamp installed successfully.
  4. 如果安装成功,就停止该应用程序服务器,然后重新进行启动。检查管理控制台以查看 Travel Booking Sample 是否作为企业应用程序列出,并且其状态是已启用(Started)(与我们前面为 BPE 容器做的一样)。
  5. 从 Samples Gallery 面板的“Enterprise Extensions”部分中,再次选择 Process Choreographer => Configure and Run。然后单击页面底部的 Run URL。
  6. 在下一个屏幕中,选择 Request Travel Booking Using Sample Data按钮,然后选择接下来显示的屏幕中的 Continue
  7. 这里,您可以根据您希望进行的测试来输入数据和选择测试选项。屏幕底部的按钮将把您带到最后的屏幕,您的测试结果最后将在此屏幕上显示出来。




回页首


问题诊断

数据库错误

如果您有与下述类似的错误:

  • com.ibm.ws.exception.WsException: DSRA0023E: The DataSource implementationclass "COM.ibm.db2.jdbc.DB2XADataSource" could not be found
  • java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.DB2XADataSource
  • A Reference object looked up from the context "java:" with the name "comp/PM/WebSphereCMPConnectionFactory" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows: ....DSRA0023E: The DataSource implementation class "COM.ibm.db2.jdbc.DB2XADataSource" could not be found.
  • DataAccessReq E PMGR6022E: Error using adapter to create or execute anInteraction. Com.ibm.ws.rsadapter.cci.WSInteractionImpl@49d694f2
  • COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0805N Package"NULLID.SQLLC300" was not found. SQLSTATE=51002

就可以:

JMS 错误

  1. 如果您接收到类似于 SystemOut.log 文件中的以下错误:
    f6a56ef MDBListenerIm W WMSG0017E: Unable to lookup JMS resources,
    JNDI lookup exception: BPEApiQueue
    f6a56ef MDBListenerIm W WMSG0019E: Unable to start MDB Listener
    Generic Process Choreographer JMS API, JMSDestination BPEApiQueue :
    javax.naming.NameNotFoundException: BPEApiQueue ...
    BPEHldQueue/BPEIntQueue那么就可以从管理控制台中选择 Resources => WebSphere JMS Provider => WebSphere Queue Connection Factories,然后检查 BPECF 和 BPECFC 的 WebSphere Queue Connection Factories JNDI 名是否设置为:
    jms/BPECF
    jms/BPECFC接下来,继续选择 Resources => WebSphere JMS Provider => WebSphere Queue Destinations,然后检查 WebSphere Queue Destination JNDI 名是否已经正确设置;例如:
    jms/BPEApiQueue, jms/BPEHldQueue, jmsBPEIntQueue
  2. 如果您接收到类似于 SystemOut.log 文件中的以下错误:
    Exception occurred while the JNDI NamingManager was processing a
    javax.naming.Reference object. Root exception is
    javax.naming.NameNotFoundException: BPECF就从管理控制台中,选择 Applications => Enterprise Applications。选取您刚刚安装和配置的 BPE 容器,然后向下移动至“Additional Properties”对话框中的“Map Resource References to Resources”区。需要分别设置 JNDI 名:
    jms/BPECF
    jms/BPECFC
  3. 如果您接收到类似于 SystemOut.log 文件中的以下错误:
    UnexpectedFailureException: BPEA0010E: Unexpected exception during
    execution.
    javax.naming.NameNotFoundException: BPERetQueue就从管理控制台中,选择 Resources => WebSphere JMS Provider => WebSphere Queue Destinations,然后检查 BPERetQUeue 的值是否与样本应用程序所需的一样。




回页首


结束语

在本教程中,我们人工安装、配置和测试了 WebSphere Application Server Enterprise Process Choreographer BPE 容器(带有嵌入式 JMS)。在 步骤 5Travel Booking Sample 的成功执行将给您提供安装您自己的需要嵌入式 JMS 流程支持的信心,并且懂得合适的服务器配置才是完善的。





回页首


相关信息



关于作者

Kate Bittles 是被认可的 IT 架构师,在位于英国 Hursley 市的 Business Integration 部门,目前的职责包括对 WebSphere 组件进行集成测试。您可以通过 katebittles@uk.ibm.com 与 Kate 联系。




对本文的评价










回页首


IBM 公司保留在 developerWorks 网站上发表的内容的著作权。未经IBM公司或原始作者的书面明确许可,请勿转载。如果您希望转载,请通过 提交转载请求表单 联系我们的编辑团队。
    关于 IBM 隐私条约 联系 IBM 使用条款