Log in / create account
View source | Discuss page | Page history | Printable version   
ADVERTISEMENT
Accounting eLearning Courses
Partnerships
SourceForge.net Logo
Openbravo ERP at SourceForge

SourceForge.net Logo
Openbravo POS at SourceForge

Open Solution Alliance Logo
Openbravo at Open Solution Alliance

Build svn sources

Rating :
1.00/5
(1 votes cast)
You have to be registered to be able to vote

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


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.

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.

Image:Snapshot1.png

Accept the License Agreement after reading it.

Image:Snapshot12.png

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".

Image:Snapshot8.png

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.

Image:Snapshot9.png

Check with "show details" if some errors occur while install.

Image:Snapshot11.png

Running ant install.source

If you run "ant install.source" and you discover that error

Image:Ant-error.png

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

Image:First-error1.png

After that another new file got no execution rights, like here to see

Image:First-error2.png

Then it will compile.

Image:Build-ready.png

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".

Image:Oracle-delete-user.png

Then click on Database Users.

Image:Oracle-delete-user1.png

Then click on the user, normally TAD.

Image:Oracle-delete-user2.png

Then click the Button "Drop".

Image:Oracle-delete-user3.png

Then check the "Cascade" checkbox, to delete all objects related with the user. Then we click on the Button "Drop User".

Image:Oracle-delete-user4.png

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.

Retrieved from "http://wiki.openbravo.com/wiki/Build_svn_sources"

This page has been accessed 9,449 times. This page was last modified 08:23, 6 June 2008. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.


Categories: Development | Installation