33.4 JBoss 的安裝後步驟

若要在 JBoss Enterprise Application Platform (EAP) 上部署 Identity Applications,您需要執行幾個手動安裝步驟。

  1. 安裝 JBoss EAP。

  2. 依照使用引導式程序安裝 Identity Applications 或節 33.3, 以靜默模式安裝 Identity Applications 所述安裝 Identity Applications。

  3. 建立包含以下內容的新 messaging-jboss-beans.xml 檔案:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!--
     ========================================================================
    
     Copyright (c) 2014 NetIQ Corporation. All Rights Reserved.
    
     THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES
     NO PART OF THIS WORK MAY BE USED, PRACTICED, PERFORMED COPIED, DISTRIBUTED,
     REVISED, MODIFIED, TRANSLATED, ABRIDGED, CONDENSED, EXPANDED, COLLECTED,
     COMPILED, LINKED, RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN
     CONSENT OF NOVELL, INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT
     AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO CRIMINAL AND CIVIL
     LIABILITY.
    
     ========================================================================
    -->
    
    <!--
        Messaging beans
        $Id: messaging-jboss-beans.xml 88672 2009-05-11 20:49:47Z anil.saldhana@jboss.com $
    -->
    <deployment xmlns="urn:jboss:bean-deployer:2.0">
    
       <!-- messaging application-policy definition -->
       <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
          <authentication>
             <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
                <module-option name="unauthenticatedIdentity">guest</module-option>
                <module-option name="dsJndiName">java:/IDMUADataSource</module-option>
                <module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
                <module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
             </login-module>
          </authentication>
       </application-policy>
    
       <bean name="SecurityStore" class="org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore">
          <!-- default security configuration -->
          <property name="defaultSecurityConfig">
             <![CDATA[
                <security>
                   <role name="guest" read="true" write="true" create="true"/>
                </security>
             ]]>
          </property>
          <property name="suckerPassword">changeit</property>
          <property name="securityDomain">messaging</property>
          <property name="securityManagement"><inject bean="JNDIBasedSecurityManagement"/></property>
          <!-- @JMX annotation to export the management view of this bean -->
          <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.messaging:service=SecurityStore",exposedInterface=org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStoreMBean.class)</annotation>
          <!-- Password Annotation to inject the password from the common password utility
           <annotation>@org.jboss.security.integration.password.Password(securityDomain="messaging",methodName="setSuckerPassword")</annotation>
           -->
       </bean>
    
       <bean name="MessagingDeploymentTemplateInfoFactory"
          class="org.jboss.managed.plugins.factory.DeploymentTemplateInfoFactory"/>
    
       <bean name="QueueTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
          <property name="info"><inject bean="QueueTemplateInfo"/></property>
       </bean>
       <bean name="QueueTemplateInfo"
          class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
          <constructor factoryMethod="createTemplateInfo">
             <factory bean="DSDeploymentTemplateInfoFactory"/>
             <parameter class="java.lang.Class">org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo</parameter>
             <parameter class="java.lang.Class">org.jboss.jms.server.destination.QueueServiceMO</parameter>
             <parameter class="java.lang.String">QueueTemplate</parameter>
             <parameter class="java.lang.String">A template for JMS queue *-service.xml deployments</parameter>
          </constructor>
          <property name="destinationType">QueueTemplate</property>
       </bean>
    
       <bean name="TopicTemplate" class="org.jboss.profileservice.management.templates.JmsDestinationTemplate">
          <property name="info"><inject bean="TopicTemplateInfo"/></property>
       </bean>
       <bean name="TopicTemplateInfo"
          class="org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo">
          <constructor factoryMethod="createTemplateInfo">
             <factory bean="DSDeploymentTemplateInfoFactory"/>
             <parameter class="java.lang.Class">org.jboss.profileservice.management.templates.JmsDestinationTemplateInfo</parameter>
             <parameter class="java.lang.Class">org.jboss.jms.server.destination.TopicServiceMO</parameter>
             <parameter class="java.lang.String">TopicTemplate</parameter>
             <parameter class="java.lang.String">A template for JMS topic *-service.xml deployments</parameter>
          </constructor>
          <property name="destinationType">TopicTemplate</property>
       </bean>
    
    </deployment>
    
  4. 將 IDMProv/deploy/messaging 資料夾中現有的 messaging-jboss-beans.xml 檔案取代為您在步驟 3 中建立的檔案。

  5. 找到 JBoss 的持續性服務組態檔案。例如,對於 PostgreSQL 資料庫,該檔案為 novell\\jboss\docs\examples\jms 目錄中的 postgresql-persistence-service.xml。

  6. 將現有的持續性服務組態檔案取代為資料庫範例資料夾中的檔案。例如,對於 PostgreSQL,請取代為 %jboss-root%/docs/examples/jms/postgresql-persistence-service.xml 檔案。

  7. 將新持續性服務組態檔案的副本新增至 %jboss-root%/server/IDMProv/deploy/messaging/ 目錄中。

  8. 開啟持續性服務組態檔案,然後完成以下步驟:

    1. 將文字 DefaultDS 取代為文字 IDMUADataSource。

    2. 在 Clustered 屬性中,將以下幾行註解:

      <attribute name="Clustered">false</attribute>
      
            <!-- All the remaining properties only have to be specified if the post
      office is clustered.
                 You can safely comment them out if your post office is non clustered
      -->
      
            <!-- The JGroups group name that the post office will use -->
      
            <!--attribute
      name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>-->
      
            <!-- Max time to wait for state to arrive when the post office joins the
      cluster -->
      
            <!--attribute name="StateTimeout">30000</attribute>-->
      
            <!-- Max time to wait for a synchronous call to node members using the
      MessageDispatcher -->
      
            <!--attribute name="CastTimeout">30000</attribute>-->
      
            <!-- Set this to true if you want failover of connections to occur when a
      node is shut down -->
      
            <!--<attribute name="FailoverOnNodeLeave">false</attribute>
      
            <depends
      optional-attribute-name="ChannelFactoryName">jboss.jgroups:service=ChannelFactory</depends>
            <attribute name="ControlChannelName">jbm-control</attribute>
            <attribute name="DataChannelName">jbm-data</attribute>
            <attribute
      name="ChannelPartitionName">${jboss.partition.name:DefaultPartition}-JMS</attribute>-->
         </mbean>
      
    3. 將以下幾行取代為指定的文字:

      將此文字

      取代為此文字

      POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')

      POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('p_user', 'changeit', 'IDMNotificationDurableTopic')

      POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')

      POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('p_user','guest')

      POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')

      POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','p_user')

      POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')

      POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','p_user')

    4. 儲存並關閉持續性服務組態檔案。

  9. 啟動 JBoss。

  10. (視情況而定) 如果 JBoss 無法在 Windows 伺服器上啟動,請執行 Solution 310273「System properties cannot be set via run.bat script in EAP 5.2」(解決方法 310273:「在 EAP 5.2 中無法透過 run.bat 程序檔設定系統內容」) 中指出的解決方法。

    出現此問題時,server.log 檔案中會記錄 AbstractKernelController 的例外錯誤。如需詳細資訊,請參閱 JBoss 社群論壇中關於 JBPAAP-10938 和 JBPAAP-9581 的討論。

  11. 完成以下步驟,以將 JBoss 管理員帳戶新增至 stop-jboss.sh 程序檔中:

    1. 開啟 stop-jboss.sh 程序檔。

    2. 在 shutdown.sh 指令的末尾,附加 JBoss 管理員的使用者名稱和密碼。使用下列語法︰

      shutdown.sh -s jnp://localhost:1199 -u %user_account% -p %password%
      

      例如:

      shutdown.sh -s jnp://localhost:1199 -u admin -p novell
      
    3. 儲存並關閉程序檔。

  12. (選擇性) 若要驗證組態是否正確,請確保伺服器記錄中包含以下資訊:

    INFO  [ServerPeer] JBoss Messaging 1.4.7.GA server [0] started
    
    INFO  [TopicService] Topic[/topic/IDMNotificationDurableTopic] started,
    fullSize=200000, pageSize=2000, downCacheSize=2000
    
    INFO  [RBPM] [com.novell.soa.notification.impl.jms.JMSConnectionMediator:init]
    Starting JMS notification system
    INFO  [STDOUT] INFO  [RBPM]
    [com.novell.soa.notification.impl.NotificationThread:run] Starting asynchronous notification system