Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Table of Contents

Overview

This document is intended to supplement the Kuali Rice 2.1.2 Installation Guide and aid the creation of an embedded rice client application. The information on this page is targeted for the Rice 2.1.2 release.

Running a Rice client application in Embedded Mode means:

  • one or more Rice modules - in particular, KEW and KIM - is are executing from within the client application
  • the client application has direct access to the Rice Standalone Server database

...

  1. A database account with access to the Rice database
  2. Procure the UC Davis-specific JARs for the modules you will be embedding along with any of their associated dependencies using either of the following methods:
    • Download ucd-rice-standalone-server-impl WAR from Artifactory , selecting the most recent version. This WAR contains all dependencies.
    • Download JARs for the specific module from this location in the Artifactory , selecting the most recent version.
  3. A certificate for the machines hosting the client application that will be connecting to the Rice Standalone Server.
    • Development Environments
      • For the development environments, you may generate a self signed certificate for the client machine and add to the attached rice.keystore using the following command:
        Code Block
        
        keytool -keystore rice.keystore -storepass nowUCme_nowUdont -v -alias <your alias> -genkeypair -validity 9999 -dname "CN=<your fully qualified machine name>, OU=<your organization>, O=UC Davis, L=Davis, ST=California, C=US"
        
      • Install the updated rice.keystore in your environment where it will be referenced in the rice configuration files.
      • A copy of the updated rice.keystore must also be installed on the Rice Standalone Server.
      • An additional cert is required for client applications connecting to the rice-sandboxes environment. The rice-sandboxes.ucdavis.edu machine does not currently have an InCommon cert, therefore a certificate from rice-sandboxes.ucdavis.edu (rice-sandboxes_ucdavis_edu.pem) must be imported into the java cacerts bundle on the client machine. The following command shows how to import the cert (attached) for the rice-sandboxes.ucdavis.edu development machine:
        Code Block
        
        keytool -importcert -file rice-sandboxes_ucdavis_edu.pem -keystore cacerts -storepass changeit -alias rice-sandboxes.ucdavis.edu
        
      • Certificates for the various development environments (rice-sandboxes, rice-testint1, rice-qa-a, rice-qa-b) are attached to this document.
    • Production Environment
      • For the production environment, an InCommon Certificate is required for the machine(s) which will be connecting to the production Rice Standalone Server.
      • The InCommon cert must be installed in the production rice keystore as well as the keystore of the client application.
      • For more information on how to request an InCommon certificate for your application, visit the following link and click on the SSL Certificate category: MyUCDavis > UCD Resources > Software

Rice Libraries

...

Rice Libraries

In Rice 1.0.x, there were only two main jars, rice-api and rice-impl. With the modularity work there are more api jars corresponding to service apis and framework components. Additionally, the implementation module has been split (though there is still a shared implementation module as not all components of the Rice implementation have been fully modularized as of the Rice 2.x.x release). This work was done according to the design outlined at the following page: Modularity Design

The libraries and their dependencies required for the modules which your application will be using must be included in your client application. Ideally you only declare include the modules of rice you are using. In practice, you may need to declare include them all until rice's modularity work is complete. The only modules rice recommends compiling against are api & framework modules.

...

We use a simple XML configuration to declare properties as key-value pairs. For example:

solid
Code Block
borderStyle
title/usr/local/rice/rice-config.xml
borderStylesolid
<config>
    <param name="datasource.ojb.platform">Oracle9i</param>
    <param name="datasource.platform">org.kuali.rice.core.framework.persistence.platform.OraclePlatform</param>
    <param name="datasource.url">jdbc:oracle:thin:@ldap://oraldap1.ucdavis.edu:389/rice_test,cn=OracleContext,dc=ucdavis.edu,dc=edu</param>
    <param name="datasource.driver.name">oracle.jdbc.driver.OracleDriver</param>
    <param name="datasource.pool.validationQuery">select 1 from duak</param>
    <param name="datasource.pool.maxWait">30000</param>
    <param name="datasource.pool.size">30</param>
    <param name="datasource.pool.maxActive">50</param>
    <param name="datasource.minIdle">7</param>
    <param name="datasource.initialSize">7</param>
    <param name="datasource.accessToUnderlyingConnectionAllowed">true</param>
    <param name="datasource.username">my_db_user</param>
    <param name="datasource.password">my_db_password</param>
<config>
solid
Info
titleConfiguration File Options
Code Block
borderStyle
  • Default Rice Configuration
    • By default Rice looks for rice-config.xml in /usr/local/rice/ at launch time. Externalizing the configuration out to the file system allows us to substitute different values for different properties in different environments. We don't need to create a configuration file for say, the TEST vs. the PROD environment, and then build the application (i.e. the same WAR can be deployed in any instance).
    • See a set of sample properties .
  • Other Kuali Application Configurations
    • Kuali COEUS is a fully enabled rice application. The Kuali COEUS config file, kc-config.xml , is included here for reference.

Core Data Source Configuration

Kuali Rice uses Java Open Transaction Manager, so we declare the appropriate beans.

    • create a configuration file for say, the TEST vs. the PROD environment, and then build the application (i.e. the same WAR can be deployed in any instance).
    • See a set of sample properties .
  • Other Kuali Application Configurations
    • Kuali COEUS is a fully enabled rice application. The Kuali COEUS config file, kc-config.xml , is included here for reference.

Core Data Source Configuration

Kuali Rice uses Java Open Transaction Manager, so we declare the appropriate beans.

Code Block
titleclasspath:edu/ucdavis/myapp/config/application-data.xml
borderStylesolid

<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean">
    <property name="defaultTimeout" value="${transaction.timeout}"/>
</bean>
	

We must declare three data sources:

  1. A transactional data source where the local client application's Rice tables are located. This is required by JOTM.
    Code Block
    titleclasspath:edu/ucdavis/myapp

...

  1. /config/application-data.xml
    borderStylesolid
    
    <bean id="dataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource">
        <property name="transactionManager" ref="jotm" />
        <property name="driverClassName" value="${datasource.driver.name}" />
        <property name="

...

  1. url" value="${

...

We must declare three data sources:

  1. A transactional data source where the local client application's Rice tables are located. This is required by JOTM.
    Code Block
    borderStylesolid
    titleclasspath:edu/ucdavis/myapp/config/application-data.xml
    
    <bean id="dataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"datasource.url}" />
        <property name="maxSize" value="${datasource.pool.size}" />
        <property name="transactionManagerminSize" refvalue="jotm${datasource.initialSize}" />
        <property name="driverClassNamemaxWait" value="${datasource.driverpool.namemaxWait}" />
        <property name="urlvalidationQuery" value="${datasource.pool.urlvalidationQuery}" />
        <property name="maxSizeusername" value="${datasource.pool.sizeusername}" />
        <property name="minSizepassword" value="${datasource.initialSize}" />
        <property name="maxWait" value="${datasource.pool.maxWait}" />
        <property name="validationQuery" value="${datasource.pool.validationQuery}" /password}" />
    </bean>
    
  2. A non-transactional data source pointing to those same Rice tables. This is required by Quartz.
    Code Block
    titleclasspath:edu/ucdavis/myapp/config/application-data.xml
    borderStylesolid
    
    <bean id="nonTransactionalDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="usernameurl" value="${datasource.usernameurl}" />
        <property name="passwordusername" value="${datasource.passwordusername}" />
     </bean> 
    A non-transactional data source pointing to those same Rice tables. This is required by Quartz.
    Code Block
    borderStylesolid
    titleclasspath:edu/ucdavis/myapp/config/application-data.xml
     <bean id="nonTransactionalDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"<property name="password" value="${datasource.password}"/>
        <property name="urldriverClassName" value="${datasource.driver.urlname}" />
        <property name="usernameinitialSize" value="${datasource.usernameinitialSize}" />
        <property name="passwordminIdle" value="${datasource.passwordminIdle}" />
        <property name="driverClassNamemaxActive" value="${datasource.driver.namemaxActive}" />
        <property name="initialSizemaxWait" value="${datasource.initialSizemaxWait}" />
        <property name="minIdlevalidationQuery" value="${datasource.minIdlevalidationQuery}" />
        <property name="maxActivetestOnBorrow" value="${datasource.maxActivetestOnBorrow}" />
        <property name="maxWaittestOnReturn" value="${datasource.maxWaittestOnReturn}" />
        <property name="validationQuerytestWhileIdle" value="${datasource.validationQuerytestWhileIdle}" />
        <property name="testOnBorrowaccessToUnderlyingConnectionAllowed" value="${datasource.testOnBorrow}" />
        <property name="testOnReturn" value="${datasource.testOnReturn}" /accessToUnderlyingConnectionAllowed}" />
    </bean>
    
    Tip

    To take advantage of pooling capabilities, testOnBorrow should be set to true.

  3. A transactional data source pointing to the database of the Rice Standalone Server.
    Code Block
    titleclasspath:edu/ucdavis/myapp/config/application-data.xml
    borderStylesolid
    
    <bean id="standaloneDataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource">
        <property name="testWhileIdletransactionManager" valueref="${datasource.testWhileIdle}jotm" />
        <property name="accessToUnderlyingConnectionAlloweddriverClassName" value="${datasource.accessToUnderlyingConnectionAllowedstandalone.datasource.driver.name}" />
      </bean> 
    Tip

    To take advantage of pooling capabilities, testOnBorrow should be set to true.

    A transactional data source pointing to the database of the Rice Standalone Server.
    Code Block
    borderStylesolid
    titleclasspath:edu/ucdavis/myapp/config/application-data.xml
    
    <bean id="standaloneDataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource" <property name="url" value="${standalone.datasource.url}" />
        <property name="transactionManagermaxSize" refvalue="jotm${standalone.datasource.pool.size}" />
        <property name="driverClassNameminSize" value="${standalone.datasource.driver.nameinitialSize}" />
        <property name="urlmaxWait" value="${standalone.datasource.pool.urlmaxWait}" />
        <property name="maxSizevalidationQuery" value="${standalone.datasource.pool.sizevalidationQuery}" />
        <property name="minSizeusername" value="${standalone.datasource.initialSizeusername}" />
        <property name="maxWaitpassword" value="${standalone.datasource.pool.maxWaitpassword}" />
        <property name="validationQuery" value="${standalone.datasource.pool.validationQuery}" />
        <property name="username" value="${standalone.datasource.username}" />
        <property name="password" value="${standalone.datasource.password}" />
    </bean>
    

...

  1. </bean>
    

KEW Service Configuration

As of 1.0.1.1-UCD-SR1d, Rice applications will no longer encrypt workflow document content. This is accomplished by disabling encryption using the out-of-the-box non-encryption implementation (org.kuali.rice.core.impl.encryption.NoEncryptionEncryptionServiceImpl). It is instantiated by declaring classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew-service.xml in the Spring context.

Consequently, the encryption.key property is no longer required.

KRAD Service Configuration

  1. Maintenance Document Encryption
    • As of 1.0.1.1-UCD-SR1d, Rice applications will no longer encrypt

...

    • maintenance document content.
    • This is accomplished by disabling encryption using the out-of-the-box non-encryption implementation (org.kuali.rice.core.impl.encryption.NoEncryptionEncryptionServiceImpl).

...

    • Disable encryption by declaring the classpath:edu/ucdavis/kuali/rice/

...

    • krad/config/ucd-

...

    • krad-service.xml

...

    • Spring file (see UCD Spring Bean Configuration).
    • Remove (or comment out) references to the encryption.key property

...

KRAD Service Configuration

  1. Maintenance Document Encryption
    • As of 1.0.1.1-UCD-SR1d, Rice applications will no longer encrypt maintenance document content.
    • This is accomplished by disabling encryption using the out-of-the-box non-encryption implementation (org.kuali.rice.core.impl.encryption.NoEncryptionEncryptionServiceImpl).
    • Disable encryption by declaring the classpath(e.g. in rice-config.xml, kc-config.xml, embedded-client-config.xml, etc.).

UCD Spring Bean Configuration

Declare the UCD-implemented Rice services:

Code Block
title/usr/local/rice/rice-config.xml
borderStylesolid

    <param name="rice.kr.additionalSpringFiles">classpath:edu/ucdavis/kuali/rice/krad/config/ucd-krad-service.xml</param>
    <param name="rice.kew.additionalSpringFiles">classpath:edu/ucdavis/kuali/rice/

...

kew/config/ucd-

...

kew-service.

...

UCD Spring Bean Configuration

Declare the UCD-implemented Rice services:

Code Block
borderStylesolid
title/usr/local/rice/rice-config.xml
xml</param>
  1. If you're using Spring's ContextLoaderListener, declare them in web.xml
    Code Block
    titlesrc/main/webapp/WEB-INF/web.xml
    borderStylesolid
    
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param

...

  1. -value>
            ...
            classpath:edu/ucdavis/kuali/rice/

...

  1. kim/config/ucd-krad-service.

...

  1. xml
           

...

  1.  classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew

...

  1. If you're using Spring's ContextLoaderListener, declare them in web.xml
    Code Block
    borderStylesolid
    titlesrc/main/webapp/WEB-INF/web.xml
    
    <listener>-service.xml
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>.
        </param-value>
    </listener>
    
    <context-param>
        <param-name>contextConfigLocation</param-name>context-param>
    

CoreConfigurer Bean Configuration

Finally, we declare the coreConfigurer bean and inject all of the core data source beans.

Code Block
titleclasspath:edu/ucdavis/myapp/config/rice-common.xml
borderStylesolid


   

...

<bean id="coreConfigurer" class="org.kuali.rice.core.impl.config.module.CoreConfigurer">
    <property 

...

name="dataSource" ref="dataSource" />
    <property name="nonTransactionalDataSource"  

...

ref="nonTransactionalDataSource" />
    

...

CoreConfigurer Bean Configuration

Finally, we declare the coreConfigurer bean and inject all of the core data source beans.

Code Block
borderStylesolid
titleclasspath:edu/ucdavis/myapp/config/rice-common.xml
<property name="serverDataSource" ref="standaloneDataSource"/>
    <bean<property idname="coreConfigurertransactionManager" classref="org.kuali.rice.core.impl.config.module.CoreConfigurer"jotm" />
    <property name="dataSourceuserTransaction" ref="dataSourcejotm" />
  </bean>
  <property<bean nameid="nonTransactionalDataSourceksbConfigurer"  refclass="nonTransactionalDataSourceorg.kuali.rice.ksb.messaging.config.KSBConfigurer" />
  <bean  <property nameid="serverDataSourcekradConfigurer" refclass="standaloneDataSource"org.kuali.rice.krad.config.KRADConfigurer" />
  <bean  <property nameid="transactionManagercoreServiceConfigurer" refclass="jotmorg.kuali.rice.coreservice.impl.config.CoreServiceConfigurer" />
  <bean  <property name="userTransaction" ref="jotmid="kimConfigurer" class="org.kuali.rice.kim.config.KIMConfigurer" />
  </bean>


  <bean id="ksbConfigurerkewConfigurer" class="org.kuali.rice.ksb.messagingkew.config.KSBConfigurerKEWConfigurer" depends-on="coreConfigurer"/>

  <bean id="knsConfigurerkenConfigurer" class="org.kuali.rice.ken.kradimpl.config.KRADConfigurerKENConfigurer" depends-on="coreConfigurer"/>

  <bean id="coreServiceConfigureredlConfigurer" class="org.kuali.rice.coreserviceedl.impl.config.CoreServiceConfigurer" depends-on="coreConfigurer"EDLConfigurer" />

  <bean id="kimConfigurerkrmsConfigurer" class="org.kuali.rice.kimkrms.config.KIMConfigurerKRMSConfigurer" depends-on="coreConfigurer"/>

  <bean id="kewConfigurerlocationConfigurer" class="org.kuali.rice.location.kewimpl.config.KEWConfigurerLocationConfigurer" depends-on="coreConfigurer"/>
 

Additional Rice Resources

  • The Kuali Rice 2.1.2 Installation Guide
    The installation guide contains useful information on all aspects of the Rice application from configuration of the standalone server to creation of a template rice client application and is a recommended additional resource for setting up your client application. TipThe If you use the maven command for creating a client application should be mvn , be sure to update the -Darchetypeversion=2.1.2
    Code Block
    
     mvn archetype:generate -DarchetypeGroupId=org.kuali.rice -DarchetypeArtifactId=rice-archetype-quickstart -DarchetypeVersion=2.1.2