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
...
- A database account with access to the Rice database
- 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.
- Download
- A certificate for the machine which the machines hosting the client application that will be connection connecting to the Rice Standalone Server.
- Development Environments
- For the development environments, you may generate a self signed certificate 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 on the client development machine for access to the rice standalone development machine. A certificate from the rice standalone development machine 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 -alias rice-sandboxes.ucdavis.edu
- For the development environments, you may generate a self signed certificate and add to the attached rice.keystore using the following command:
- Development Environments
- 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
- Production Environment
Rice Libraries
...
- See Rice Client Application Certificate Requirements for certificate details.
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 include the modules of rice you are using. In practice, you may need to include them all until rice's modularity work is complete. The only modules rice recommends compiling against are api & framework modules.
Below is a list of the old 1.0.3.3 libraries and their 2.x.x counterparts:
Old Library | New Library |
---|---|
rice-api-1.0.3.3.jar | rice-core-api-2.x.x.jar |
| rice-core-framework-2.x.x.jar |
| rice-core-service-api-2.x.x.jar |
| rice-core-service-framework-2.x.x.jar |
| rice-edl-framework-2.x.x.jar |
| rice-ken-api-2.x.x.jar |
| rice-kew-api-2.x.x.jar |
| rice-kew-framework-2.x.x.jar |
| rice-kim-api-2.x.x.jar |
| rice-kim-framework-2.x.x.jar |
| rice-kns-2.x.x.jar |
| rice-krad-app-framework-2.x.x.jar |
| rice-krad-web-framework-2.x.x.jar |
| rice-krms-api-2.x.x.jar |
| rice-krms-framework-2.x.x.jar |
| rice-krms-ksb-api-2.x.x.jar |
| rice-location-api-2.x.x.jar |
| rice-krmslocation-framework-2.x.x.jar |
rice-impl-1.0.3.3.jar | rice-ksb-apiimpl-2.x.x.jar |
| rice-locationcore-apiimpl-2.x.x.jar |
| rice-core-locationservice-frameworkimpl-2.x.x.jar |
| rice-edl-impl-12.0x.3.3x.jar |
| rice-kew-impl-2.x.x.jar |
| rice-corekim-impl-2.x.x.jar |
| rice-core-servicekrms-impl-2.x.x.jar |
| rice-ksb-edlclient-impl-2.x.x.jar |
| rice-ksb-kewserver-impl-2.x.x.jar |
| rice-kimlocation-impl-2.x.x.jar |
rice-sampleapp-1.0.3.3.jar | rice-krmscore-service-implweb-2.x.x.jar |
| rice-ksbcore-client-implweb-2.x.x.jar |
| rice-ksb-server-implweb-2.x.x.jar |
| rice-location-implweb-2.x.x.jar |
rice-sampleapp-1.0.3.3.jar | rice-core-service-web-2.x.x.jar |
| rice-core-web-2.x.x.jar |
| rice-ksb-web-2.x.x.jar |
| rice-location-web-2.x.x.jar |
Properties Configuration
We use a simple XML configuration to declare properties as key-value pairs. For example:
...
borderStyle | solid |
---|---|
title | /usr/local/rice/rice-config.xml |
...
Properties Configuration
We use a simple XML configuration to declare properties as key-value pairs. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
<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,dc=edu</param> <param name="datasource.ojbdriver.platform">Oracle9i<name">oracle.jdbc.driver.OracleDriver</param> <param name="datasource.platform">org.kuali.rice.core.framework.persistence.platform.OraclePlatform<.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.url">jdbc:oracle:thin:@ldap://oraldap1.ucdavis.edu:389/rice_test,cn=OracleContext,dc=ucdavis.edu,dc=edu</maxActive">50</param> <param name="datasource.driver.name">oracle.jdbc.driver.OracleDriver<minIdle">7</param> <param name="datasource.pool.validationQuery">select 1 from duak<initialSize">7</param> <param name="datasource.pool.maxWaitaccessToUnderlyingConnectionAllowed">30000<>true</param> <param name="datasource.pool.size">30<username">my_db_user</param> <param name="datasource.pool.maxActive">50<password">my_db_password</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> |
Info | ||
---|---|---|
| ||
|
Core Data Source Configuration
Kuali Rice uses Java Open Transaction Manager, so we declare the appropriate beans.
Code Block | |
---|---|
borderStyle | solid
<config>
|
Info | ||
---|---|---|
| ||
|
Core Data Source Configuration
Kuali Rice uses Java Open Transaction Manager, so we declare the appropriate beans.
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean">
<property name="defaultTimeout" value="${transaction.timeout}"/>
</bean>
|
We must declare three data sources:
- A transactional data source where the local client application's Rice tables are located. This is required by JOTM.
Code Block title classpath:edu/ucdavis/myapp
...
/config/application-data.xml borderStyle solid <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="url" value="${datasource.url}" /> <property name="
...
maxSize" value="${
...
We must declare three data sources:
- A transactional data source where the local client application's Rice tables are located. This is required by JOTM.
Code Block borderStyle solid title classpath:edu/ucdavis/myapp/config/application-data.xml <bean id="dataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"datasource.pool.size}" /> <property name="minSize" value="${datasource.initialSize}" /> <property name="transactionManagermaxWait" refvalue="jotm${datasource.pool.maxWait}" /> <property name="driverClassNamevalidationQuery" value="${datasource.driverpool.namevalidationQuery}" /> <property name="urlusername" value="${datasource.urlusername}" /> <property name="maxSizepassword" value="${datasource.pool.sizepassword}" /> <property name="minSize" value="${datasource.initialSize}" /> <property name="maxWait" value="${datasource.pool.maxWait}" //> </bean>
- A non-transactional data source pointing to those same Rice tables. This is required by Quartz.
A non-transactional data source pointing to those same Rice tables. This is required by Quartz.Code Block title classpath:edu/ucdavis/myapp/config/application-data.xml borderStyle solid <bean id="nonTransactionalDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="validationQueryurl" value="${datasource.pool.validationQueryurl}" /> <property name="username" value="${datasource.username}" /> <property name="password" value="${datasource.password}" /> </bean>
Code Block borderStyle solid title classpath:edu/ucdavis/myapp/config/application-data.xml <bean id="nonTransactionalDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" <property name="driverClassName" value="${datasource.driver.name}" /> <property name="urlinitialSize" value="${datasource.urlinitialSize}" /> <property name="usernameminIdle" value="${datasource.usernameminIdle}" /> <property name="passwordmaxActive" value="${datasource.passwordmaxActive}" /> <property name="driverClassNamemaxWait" value="${datasource.driver.namemaxWait}" /> <property name="initialSizevalidationQuery" value="${datasource.initialSizevalidationQuery}" /> <property name="minIdletestOnBorrow" value="${datasource.minIdletestOnBorrow}" /> <property name="maxActivetestOnReturn" value="${datasource.maxActivetestOnReturn}" /> <property name="maxWaittestWhileIdle" value="${datasource.maxWaittestWhileIdle}" /> <property name="validationQueryaccessToUnderlyingConnectionAllowed" value="${datasource.validationQuery}" /> <property name="testOnBorrow" value="${datasource.testOnBorrow}" /accessToUnderlyingConnectionAllowed}" /> </bean>
Tip To take advantage of pooling capabilities,
testOnBorrow
should be set totrue
. - A transactional data source pointing to the database of the Rice Standalone Server.
Code Block title classpath:edu/ucdavis/myapp/config/application-data.xml borderStyle solid <bean id="standaloneDataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"> <property name="testOnReturntransactionManager" valueref="${datasource.testOnReturn}jotm" /> <property name="testWhileIdledriverClassName" value="${standalone.datasource.driver.testWhileIdlename}" /> <property name="accessToUnderlyingConnectionAllowedurl" value="${datasource.accessToUnderlyingConnectionAllowed}" /> </bean>
A transactional data source pointing to the database of the Rice Standalone Server.Tip To take advantage of pooling capabilities,
testOnBorrow
should be set totrue
.Code Block borderStyle solid title classpath:edu/ucdavis/myapp/config/application-data.xml <bean id="standaloneDataSource" class="org.kuali.rice.core.framework.persistence.jdbc.datasource.XAPoolDataSource"standalone.datasource.url}" /> <property name="maxSize" value="${standalone.datasource.pool.size}" /> <property name="transactionManagerminSize" ref="jotmvalue="${standalone.datasource.initialSize}" /> <property name="driverClassNamemaxWait" value="${standalone.datasource.driverpool.namemaxWait}" /> <property name="urlvalidationQuery" value="${standalone.datasource.pool.urlvalidationQuery}" /> <property name="maxSizeusername" value="${standalone.datasource.pool.sizeusername}" /> <property name="minSizepassword" value="${standalone.datasource.initialSizepassword}" /> <property name="maxWait" value="${standalone.datasource.pool.maxWait}" /> <property name="validationQuery" value="${standalone.datasource.pool.validationQuery}" /> <property name="username" value="${standalone.datasource.username}" /> <property name="password" value="${standalone.datasource.password}" /> </bean>
...
</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
- 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/
- Disable encryption by declaring the
...
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
- 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 | ||||
---|---|---|---|---|
| ||||
<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 |
...
UCD Spring Bean Configuration
Declare the UCD-implemented Rice services:
Code Block | ||||
---|---|---|---|---|
| ||||
<param name="rice.kr.additionalSpringFiles">classpath-kew-service.xml</param> |
- If you're using Spring's
ContextLoaderListener
, declare them inweb.xml
Code Block title src/main/webapp/WEB-INF/web.xml borderStyle solid <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> ... classpath:edu/ucdavis/kuali/rice/kim/config/ucd-krad-service.xml classpath:edu/ucdavis/kuali/rice/
...
kew/config/ucd-
...
kew-service.
...
xml
...
...
..
...
- If you're using Spring's
ContextLoaderListener
, declare them inweb.xml
Code Block borderStyle solid title src/main/webapp/WEB-INF/web.xml <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> ... classpath:edu/ucdavis/kuali/rice/kim/config/ucd-krad-service.xml classpath:edu/ucdavis/kuali/rice/kew/config/ucd-kew-service.xml ... </param-value> </context-param>
CoreConfigurer Bean Configuration
Finally, we declare the coreConfigurer
bean and inject all of the core data source beans.
...
borderStyle | solid |
---|---|
title | classpath:edu/ucdavis/myapp/config/rice-common.xml |
...
. </param-value> </context-param>
CoreConfigurer Bean Configuration
Finally, we declare the coreConfigurer
bean and inject all of the core data source beans.
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="coreConfigurer" class="org.kuali.rice.core.impl.config.module.CoreConfigurer"> <property name="dataSource" ref="dataSource" /> <property name="nonTransactionalDataSource" ref="nonTransactionalDataSource" /> <property name="serverDataSource" ref="standaloneDataSource"/> <property name="transactionManager" ref="jotm" /> <property name="userTransaction" ref="jotm" /> </bean> <bean id="ksbConfigurer" class="org.kuali.rice.ksb.messaging.config.KSBConfigurer" /> <bean id="kradConfigurer" class="org.kuali.rice.krad.config.KRADConfigurer" /> <bean id="coreConfigurercoreServiceConfigurer" class="org.kuali.rice.corecoreservice.impl.config.module.CoreConfigurer"> <property name="dataSource" ref="dataSource" CoreServiceConfigurer" /> <bean <property nameid="nonTransactionalDataSourcekimConfigurer" ref="nonTransactionalDataSource" /> <property name="serverDataSource" ref="standaloneDataSource"class="org.kuali.rice.kim.config.KIMConfigurer" /> <bean <property nameid="transactionManagerkewConfigurer" refclass="jotmorg.kuali.rice.kew.config.KEWConfigurer" /> <bean <property nameid="userTransactionkenConfigurer" refclass="jotmorg.kuali.rice.ken.impl.config.KENConfigurer" /> </bean> <bean id="ksbConfigureredlConfigurer" class="org.kuali.rice.ksbedl.messagingimpl.config.KSBConfigurerEDLConfigurer" depends-on="coreConfigurer"/> <bean id="knsConfigurerkrmsConfigurer" class="org.kuali.rice.kradkrms.config.KRADConfigurerKRMSConfigurer" depends-on="coreConfigurer"/> <bean id="coreServiceConfigurerlocationConfigurer" class="org.kuali.rice.coreservice.impl.config.CoreServiceConfigurer" depends-on="coreConfigurer"/> <bean id="kimConfigurer" class="org.kuali.rice.kim.config.KIMConfigurer" depends-on="coreConfigurer"/> <bean id="kewConfigurer" class="org.kuali.rice.kew.config.KEWConfigurer" depends-on="coreConfigurer"/> "org.kuali.rice.location.impl.config.LocationConfigurer" /> |
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. If you use the maven command for creating a client application, be sure to update the -Darchetypeversion=2.1.2Code Block mvn archetype:generate -DarchetypeGroupId=org.kuali.rice -DarchetypeArtifactId=rice-archetype-quickstart -DarchetypeVersion=2.1.2
- The Kuali 2.1.2 Techincal Reference Guide
Recommended reading for understanding the overall Rice architecture.