Friday, July 15, 2011

JBOSS BRMS 5.1/Drools Guvnor 5.1 on WebLogic 11g

JBOSS BRMS or Guvnor itself is an java application with the file extension of .war. So it is normal that it is runnable on all kinds of application server which is JEE compliant. Running on JBOSS app. server is pretty straightforward, as both are from JBOSS.org. However, running on other application server requires a little bit configuration. I would like to share my experience how to configure the BRMS/Guvnor 5.1 running on WebLogic 11g.

1. First of all, install the weblogic into your platform as usual.
2. Download the JBOSS BRMS/Guvnor 5.1.
a. You can download the standalone file which includes a JBOSS application server.
b. You can just download the war file of the BRMS/GUVNOR application.
3. If you did 2a, you need to grasp the brms war file as below
a. Extract the zip file
b. go to $JBOSS_HOME/server/default/deploy.
c. Find out the folder called jboss_brms.war
d. Copy the entire folder into another separate repository.
4. If you did 2b, just leave it at any separate repository.
5. Assume you have experience of deploying application into WebLogic, just deploy the BRMS war file/folder as usual.
6. Once deployed successfully, open the browser with the URL : http://localhost:7001/jboss-brms
7. You should get the following exceptions :
Service method 'public abstract org.drools.guvnor.client.rpc.UserSecurityContext org.drools.guvnor.client.rpc.SecurityService.getCurrentUser()' threw an unexpected exception: java.lang.IllegalArgumentException: No Configuration was registered that can handle the configuration named brms java.lang.IllegalArgumentException: No Configuration was registered that can handle the configuration named brms
8. By default, BRMS uses JAAS realm with the name of brms as the authenticaion module. But WebLogic has its own authenticaion and authorization mechanism. In order to make it happen, you have to continue the next steps.
9. Create a JAAS configuration file with the filename of jaas.config for example and save it to a separate place.
brms {

weblogic.security.auth.login.UsernamePasswordLoginModule required debug=false;

};
as the default JAAS realm's name is brms, so the module name in jaas.config must be brms.
10. Open the startup script, $WL_HOME/user_projects/domains/[domain name]/bin/startWebLogic.sh
11. Make sure the startup command of WebLogic include -Djavax.security.auth.login.config=file path of jaas.config.

e.g.
...
JAAS_CONFIG="-Djava.security.auth.login.config=/home/benson/Oracle/Middleware/user_projects/domains/brms/lib/jaas.config"

${JAVA_HOME}/bin/java ${JAVA_VM} -version

if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
echo "Starting WLS with line:"
echo "${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAAS_CONFIG} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS} "
${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAAS_CONFIG} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}
else
echo "Redirecting output from WLS window to ${WLS_REDIRECT_LOG}"
${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS} >"${WLS_REDIRECT_LOG}" 2>&1
fi
...

11. Save the file
12. restart the webLogic by executing $WL_HOME/user_projects/domains/[domain name]/startWebLogic.sh
13. BRMS will work on WebLogic 11g.