Build svn sources
| Languages: |
English | Deutsch | 中文(中国大陆) | Translate this article... |
Contents |
Intro
Guide to build Openbravo from svn sources. Windows users should read building svn sources in Windows.
Used Software
All software is in contrib,non-free Debian repository or the oracle-repository available.
To access the oracle-repository with aptitude, you must insert following line into the file /etc/apt/sources.list
deb http://oss.oracle.com/debian/ unstable main non-free
- Debian/Etch
- tomcat 5.5.20-2
- ant 1.6.5-6
- sun-java5-jdk 1.5.0-10-3
- libaio-dev 0.3.106-3
- libaio1 0.3.106-3
- oracle-xe 10.2.0.1-1.0
Client software to be installed on client systems for remotely accessing Oracle Database 10g Express Edition. You do not need to install the client onto the same computer as Oracle Database 10g Express Edition.
- oracle-xe-client 10.2.0.1-1.2
Additional Howtos
subversion [subversion]
command line installation [command line installation]
forum postings [forum postings]
oracle beginners guide. [oracle beginners guide.]
oracle edition tutorial [oracle edition tutorial]
oracle debian howto [oracle debian howto]
Installation
First install all needed packages like tomcat and so on. Here is a [description.]
Then install Oracle 10g Database like [here described.] After you have installed Oracle 10g you must set the PATH variable to oracle home and set a ORACLE_HOME environment variable. You do this in the file /etc/profile
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE (for the Express Edition)
export PATH=$ORACLE_HOME/bin:$PATH
Then you can load these settings in e.g. bash with "source /etc/profile". Or even with every new-opened sh-shell it will be loaded. Before you later run "ant install.source" you can check with "env" if your environment variables are correctly set, if not run "source /etc/profile" and check again.
To check the oracle installation you can access "http://127.0.0.1:8080/apex"
Oracle XE 10g sets by default maximum number of processes to 20. This may cause Openbravo to throw an exception indicating that it has no connections available. To fix this set the value of this parameter to 150 by executing 'alter system set processes=150 scope=spfile;' in oracle command line logged as sysdba and then restart the database.
The file /etc/profile looks like
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
export LANG="de_DE.UTF-8"
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
export CATALINA_HOME=/usr/share/tomcat5.5
export CATALINA_BASE=/var/lib/tomcat5.5
export CATALINA_OPTS=-server
export ANT_HOME=/usr/share/ant
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
and the file /etc/environment looks like:
LANG="de_DE.UTF-8" JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun CATALINA_HOME=/usr/share/tomcat5.5 CATALINA_BASE=/var/lib/tomcat5.5 CATALINA_OPTS=-server ANT_HOME=/usr/share/ant ORACLE_SID=XE
Downloading SVN sources
Then download the sources from svn repository.
svn co https://openbravo.svn.sourceforge.net/svnroot/openbravo/trunk AppsOpenbravo
With this command you create a directory called "AppsOpenbravo". If you wanna test more svn sources side-by-side, you could name it with a date or revision number, like "AppsOpenbravo28_8_2007" or "AppsOpenbravo_980".
Running Openbravo.properties setup
After that we will go into our local svn repository and [build the sources.] Here is a little more detailed description. Go to the config/ folder in your application folder, and run the openbravo properties setup which is available for multiple platforms.
Accept the License Agreement after reading it.
Fill out the field with the directory where you have stored the svn sources. As port, in the "web url" you should use the tomcat port, on Debian/Etch it is port 8180. And as next you should use the "tomcat context" name from one field above.E.g. if you have "tomcat context" set to "openbravo_04_09_2007", you should use in the field "web url" the value "http://localhost:8180/openbravo_04_09_2007/web".
Fill out the Oracle database settings. The System password is the password of user system that you assigns during Oracle installation. The Database server field is the name of the computer where the database is installed. Database user and database password is the user and password of the user that the installation process (ant install.source task) will create to import the database schema. The port field is the port where oracle listener is listen. The SID field is the name of the oracle service and tns is the name of the connection in tnsnames.ora (you could open this file to check these values) file. These values are both XE in Oracle XE.
Check with "show details" if some errors occur while install.
Running ant install.source
If you run "ant install.source" and you discover that error
Then you have not correctly done the setup "ant -f build.xml.template setup". Do the setup again, check that the GUI is appearing, where you fill out the information.
After that we run "ant install.source", were we discover that 2 files got no execution rights, so we set it with chmod +x, like here
After that another new file got no execution rights, like here to see
Then it will compile.
Copying Openbravo Context
Now copy the lib/context-name.war file to your tomcat webapps dir. In Debian/Etch it is /var/lib/tomcat5.5/webapps. Then restart /etc/init.d/tomcat5.5 restart, so that tomcat can unpack the .war file and create a directory in that webapps directory.
To check if your tomcat installation does the unpacking automatically, you can do "grep autoDeploy /var/lib/tomcat5.5/conf/server.xml" , which should return unpackWARs="true" autoDeploy="true".
Update svn sources
To update the local svn repository, run
svn up
Delete Oracle User
To start with a complete new database (ant install.source), we must delete the oracle user, which has a standardname of TAD. NOTE: You can also use another username for the installation, but then you must rerun the configuration. We go to the Oracle Webadministrationinterface. On Debian/Etch this is http://localhost:8080/apex . We click on "Administration".
Then click on Database Users.
Then click on the user, normally TAD.
Then click the Button "Drop".
Then check the "Cascade" checkbox, to delete all objects related with the user. Then we click on the Button "Drop User".
Build new svn sources
To build the Application with database changes, run
ant install.source
If you want to build only a part, recompile that is enough. If you want to rebuild the .war file, run
ant compile -Dtab=xxx war
Copying the Openbravo Context
Delete the .war file and the corresponding, same-named directory in the directory /var/lib/tomcat5.5/webapps/. Then copy the .war file from the openbravo directory/lib to /var/lib/tomcat5.5/webapps and restart tomcat.
Now go to http://localhost:8180/context-name and test the new svn sources.
Categories: Development | Installation















