Introduction

I thought I would post some of the blockers and solutions I came across when trying to get CBF (Community Build Framework) running. It took a while to get CBF running smoothly but in the long run the effort was worth it.

My client required 3 BA servers (standard setup):
  1. Development
  2. Staging
  3. Production


They also wanted a white label BA server to run on/with the following:
  • Debian 6
  • PostgreSQL 8.4
  • Custom Login.jsp (not part of this post)
  • Custom theme (not part of this post)
  • No samples (not part of this post)


There are various threads, blog articles and the CBF website itself which can guide you on your installation/configuration of CBF but here are links which I found the most helpful:


So lets get started

Requirements

You will need to make sure you have the following installed/configured:
  • Oracle (Sun) Java 6
  • Apache Ant (Latest stable release)
  • Apache Ant Ivy (Latest stable release)
  • xmltask.jar
  • Apache Tomcat 6.0.36
  • Subversion (Latest stable release)
  • CBF 5.7


Oracle (Sun) Java 6
Code:
$ sudo vi /etc/apt/sources.list
# add the line below
deb http://ftp2.de.debian.org/debian squeeze main non-free
$ sudo apt-get update
$ sudo apt-get install sun-java6-bin sun-java6-javadb sun-java6-jdk sun-java6-plugin
$ java -version
# output on your java version etc.
$ export JAVA_HOME=/usr/lib/jvm/java-6-sun
(Probably best to add your environment variables to your bash script)

Apache Ant v1.8.4
Code:
$ wget http://mirror.ventraip.net.au/apache//ant/binaries/apache-ant-1.8.4-bin.tar.gz
$ tar -xvf apache-ant-1.8.4-bin.tar.gz
$ sudo mv apache-ant-1.8.4 /usr/share/
# create a symbolic link
$ sudo ln -s /usr/share/ant/bin/ant /usr/bin/ant
$ ant -version
# output on your apache ant version etc.
$ cd /usr/local/ant/
# grab apache ant dependencies
$ ant -f fetch.xml -Ddest=user
$ export ANT_HOME=/usr/share/apache-ant-1.8.4
(Probably best to add your environment variables to your bash script)

Apache Ant Ivy v2.3.0 and xmltask.jar
Code:
$ wget http://mirror.ventraip.net.au/apache//ant/ivy/2.3.0/apache-ivy-2.3.0-bin.tar.gz
$ tar -xvf apache-ivy-2.3.0-bin.tar.gz
$ cd apache-ivy-2.3.0
$ cp ivy-2.3.0.jar /usr/share/ant/
$ cd /usr/share/ant/
$ ant -f fetch.xml -Ddest=user
$ cd ~/.ant/lib
# need to get xmltask.jar
$ wget --no-check-certificate https://sourceforge.net/projects/xmltask/files/xmltask/1.16/xmltask.jar/download
$ mv download xmltask.jar
$ cd /usr/share/ant/
$ ant -f fetch.xml -Ddest=user


Subversion
Code:
$ sudo apt-get install subversion


Apache Tomcat v6.0.36

Code:
$ wget http://apache.mirror.uber.com.au/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.tar.gz
$ tar -xvf apache-tomcat-6.0.36.tar.gz
(Remember this location of Apache Tomcat as we will need to put it into our CBF folder later on.)

CBF

Now its time to get started with CBF. The first step is to create the skeleton directory structure, I won't go into too much detail about what each directory does etc. (it is all on the webdetails website). As an example this is what mine looked like:

Code:
cbf
  |--build.xml
  |--pentaho-4.8
  |--project-development
  |--tomcat
Before I look at the project-development directory (where the magic occurs) lets grab some needed files/folders/packages before continuing.

CBF 5.7
Code:
$cd cbf
$wget --no-check-certificate https://raw.github.com/webdetails/cbf/master/build.xml
4.8.0-stable
Code:
$cd cbf
$svn co http://source.pentaho.org/svnroot/bi-platform-v2/tags/4.8.0-stable/ ./pentaho-4.8/
Apache Tomcat
Code:
$cd cbf
$mv ../apache-tomcat-6.0.36 ./tomcat
project-* (project-development)
The project-* (in this example project-development) contains your build properties, patches and solutions necessary for your BA server. As I said above I won't go into too much detail but here is what my project-development looks like (I have also attached a copy of it if anyone wants it):

Code:
.
├── config
│   ├── build-prashant.properties
│   └── build.properties
├── patches
│   ├── project-development
│   │   └── solution
│   │       └── system
│   │           ├── applicationContext-spring-security-hibernate.properties
│   │           ├── applicationContext-spring-security-hibernate.xml
│   │           ├── hibernate
│   │           │   ├── hibernate-settings.xml
│   │           │   └── postgresql.hibernate.cfg.xml
│   │           ├── quartz
│   │           │   └── quartz.properties
│   │           └── simple-jndi
│   │               └── jdbc.properties
│   ├── target-build
│   │   └── bi-platform-assembly
│   │       └── build-res
│   │           └── assembly_shared.xml
│   └── target-dist
│       ├── administration-console
│       │   └── jdbc
│       │       └── postgresql-9.2-1002.jdbc3.jar
│       └── server
│           ├── conf
│           │   └── Catalina
│           │       └── localhost
│           │           └── pentaho.xml
│           ├── lib
│           │   └── postgresql-9.2-1002.jdbc3.jar
│           └── webapps
│               ├── host-manager
│               ├── manager
│               └── pentaho
│                   ├── META-INF
│                   │   └── context.xml
│                   └── WEB-INF
│                       └── web.xml
└── solution
So there are some files/folders which aren't part of any of the tutorials that I have seen (maybe someone who uses CBF often can chime in to why or if they have fixes to how I don't need to use them), so here is an explanation as to why I added them in (these are in italics).

assembly_shared.xml

I kept getting this error message:

Code:
/home/pentaho/work/cbf/build.xml:291: The following error occurred while executing this line:
/home/pentaho/work/cbf/target-build/bi-platform-assembly/build-res/assembly_shared.xml:19:  !!! Blacklisted class javax.servlet.Servlet found in a retrieved jar .   Assembly cannot proceed !!!
Apparently this shouldn't be happening but to get around this I added a new file (as a patch - CBF magic!) which had the following argument added (in bold):

Code:
<available property="Servlet.class.present" classname="javax.servlet.Servlet" ignoresystemclasses="true">
host-manager/ and manager/

For some bizzarre reason when I went to run a new build I received the follow error:

Code:
SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base [..]webapps\host-manager does not exist or is not a readable directory
To fix this I just went ahead and copied the host-manager and manager (not sure if this was needed but did it in case) to the directory listed above as a patch.

build-prashant.properties

For those that don't want to download the attachment here is my build-prashant.properties:

Code:
javac.path = /usr/lib/jvm/java-6-sun/bin
project.revision=4.8.0-stable
solution.path = /home/prashant/cbf/project-development/solution
copy.pentaho.samples = true
server.name = tomcat
tomcat.path = /home/prashant/cbf/tomcat/
dependency.pentaho-cdf-plugin.revision=TRUNK-SNAPSHOT
java.opts = -Dfile.encoding=utf-8 -Xmx512m -XX:MaxPermSize=512m -Xrunjdwp:transport=dt_socket,address=8765,server=y,suspend=n
pentaho.dir = pentaho-4.8/
pentaho.build.dir = target-build/
BASE_URL = http://10.0.1.30:8080/pentaho/
I should have a lot more in here i.e. database connection settings etc. but this was just a quick and dirty to see if I could get this working.

Finally all you have to do is:

Code:
ant -Dproject=development -Denv=prashant dist-clean all run
I should put this together as a blog post and go through the finer details i.e. database connection variables and changing the theme, login page and removing samples but hopefully this helps a potential CBF'er, I mean Community Build Frameworker :P.

Prashant

cbf.zip