5.2 Deploying RBPM on JBoss EAP

To deploy the Roles Based Provisioning Module on JBoss 5.1.2 Enterprise Application Platform (EAP), you need to perform several manual setup steps. The setup process is outlined below:

  1. Install JBoss 5.1.2 EAP.

  2. Copy the jbosssx.jar file from the %jboss-root%/lib directory to the %jboss-root%/common/lib directory before launching the RBPM User Application installer.

  3. Install the RBPM User Application.

  4. Replace the messaging-jboss-beans.xml file you have with a modified XML file.

    If you deploy RBPM on JBoss 5.1.2 EAP without replacing the messaging-jboss-beans.xml file, you might see multiple warrnings and errors in the startup log.

    The problem is that the RBPM installer uses the community version of the messaging-jboss-beans.xml file as a template to generate its own version of the file. Unfortunately, the EAP version is very different in many aspects, including the definitions of QueueMODefinition and TopicMODefinition.

    The workaround for this issue is to replace the the messaging-jboss-beans.xml file you have with the modified XML file shown below. The file needs to be in the IDMProv/deploy/messaging folder.

    <?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>
    
  5. Replace the postgresql-persistence-service.xml file with the %jboss-root%/docs/examples/jms/postgresql-persistence-service.xml file and copy it to %jboss-root%/server/IDMProv/deploy/messaging/.

    NOTE:Step 5 through Step 8 refer specifically to the PostgreSQL database. If you use a different database in your environment, find and modify the persistence service configuration file for your particular database.

  6. Edit the postgresql-persistence-service.xml file and replace the text DefaultDS with the text IDMUADataSource.

  7. In the postgresql-persistence-service.xml file, also comment out the following lines within the Clustered attribute:

    <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>
    
  8. Also, in postgresql-persistence-service.xml:

    1. Find this line:

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

      Replace it with this line:

      POPULATE.TABLES.3  = INSERT INTO JBM_USER (USER_ID, PASSWD,
      CLIENTID) VALUES ('p_user', 'changeit', 'IDMNotificationDurableTopic')
      
    2. Find this line:

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

      Replace it with this line:

      POPULATE.TABLES.8  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID)
      VALUES ('p_user','guest')
      
    3. Find this line:

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

      Replace it with this line:

      POPULATE.TABLES.9  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID)
      VALUES ('subscriber','p_user')
      
    4. Find this line:

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

      Replace it with this line:

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

    If you are configured correctly, you will see this information in the server log:

    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
    

    In addition, you will see this information further down in the log:

    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
    

In addition, the stop-jboss.sh script that is created during the installation process needs to be modified. The JBoss administrator’s user ID and password must be appended to the end of the shutdown command:

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

For example:

shutdown.sh -s jnp://localhost:1199 -u admin -p novell