若要在 JBoss 5.1.2 Enterprise Application Platform (EAP) 上部署 Roles Based Provisioning Module,您需要執行數個手動安裝步驟。安裝過程說明如下:
安裝 JBoss 5.1.2 EAP。
在啟動 RBPM 使用者應用程式安裝程式之前,將 jbosssx.jar 檔案從 %jboss-root%/lib 目錄複製到 %jboss-root%/common/lib 目錄。
安裝 RBPM 使用者應用程式。
使用修改後的 XML 檔案取代 messaging-jboss-beans.xml 檔案。
如果在 JBoss 5.1.2 EAP 上部署 RBPM 時不取代 messaging-jboss-beans.xml 檔案,可能會在啟動記錄中看到多個警告和錯誤。
此問題是由於 RBPM 安裝程式使用 messaging-jboss-beans.xml 檔案的社群版作為樣板產生自己的檔案版本。遺憾的是,EAP 版本在許多方面都存在很大差異,包括 QueueMODefinition 和 TopicMODefinition 的定義。
此問題的解決方式是使用下面顯示的修改後的 XML 檔案取代 messaging-jboss-beans.xml 檔案。檔案必須位於 IDMProv/deploy/messaging 資料夾中。
<?xml version="1.0" encoding="UTF-8"?>
<!--
========================================================================
Copyright (c) 2009 Novell, Inc. 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>
使用 %jboss-root%/docs/examples/jms/postgresql-persistence-service.xml 檔案取代 postgresql-persistence-service.xml 檔案,並將其複製到 %jboss-root%/server/IDMProv/deploy/messaging/ 中。
編輯 postgresql-persistence-service.xml 檔案,並將文字 DefaultDS 取代為 IDMUADataSource。
在 postgresql-persistence-service.xml 檔案中,還需要將 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>
此外,在 postgresql-persistence-service.xml 中:
找到以下行:
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')
啟動 JBoss。
如果設定正確,您將會在伺服器記錄中看到以下資訊:
INFO [ServerPeer] JBoss Messaging 1.4.7.GA server [0] started
{About 7 lines down}
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
此外,需要修改在安裝過程中建立的 stop-jboss.sh 程序檔。必須將 JBoss 管理員的使用者 ID 及密碼附加至關閉指令的末尾。
shutdown.sh -s jnp://localhost:1199 -u %value% -p %value%
例如:
shutdown.sh -s jnp://localhost:1199 -u admin -p novell