Installation/Troubleshooting
Contents |
Custom Installation
Fedora
There are a number of issues that break this ant task.
You did not set $JAVA_HOME environment variable, on fedora this is done by;
export JAVA_HOME=/etc/alternatives/java_sdk/
You need to set CATALINA_HOME and CATALINA_BASE to those locations on your machine. The are dependent on how you setup your tomcat 6.0 installation in eclipse. you can go to servers, and then the launch configuration tab, and then check the arguments tab. examples values are given below;
export CATALINA.BASE="/home/yourhomedirectory/workspace-openbravo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0" export CATALINA.HOME="/usr/share/tomcat6"
You might see this error;
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select ur from ADUserRoles ur where ur.userContact.id='0' and ur.active='Y' and ur.role.active='Y' order by ur.role.id asc]
This is due to a conflict with ant loading some optional classes that conflict with those supplied with openbravo, namely antlr.jar
basically ant is including a list of optional jars that are specified in its default config files in /etc/ant.d/*
rather than force uninstall the system antlr.jar it will likely break a whole bunch of "dependee" packages, you can tell ant to ignore those optional jars temporarily like so;
export OPT_JAR_LIST="bcel ant/ant-apache-bcel bsf ant/ant-apache-bsf log4j ant/ant-apache-log4j oro ant/ant-apache-oro regexp ant/ant-apache-regexp xml-commons-resolver ant/ant-apache-resolver checkstyle jakarta-commons-beanutils jakarta-commons-cli jakarta-commons-logging jakarta-commons-collections jaxp_parser_impl cobertura junit4 xerces-j2 ant/ant-commons-logging jakarta-commons-net ant/ant-commons-net javamail jaf ant/ant-javamail jdepend ant/ant-jdepend jsch ant/ant-jsch jtidy ant/ant-junit ant/ant-nodeps ant/ant-swing jaxp_transform_impl ant/ant-trax xalan-j2-serializer"
ant install.source
another error is a missing get_uuid() function for postgresql;
/home/shruti/Downloads/OpenbravoERP-2.50MP22/src-db/database/build-create.xml:274: org.postgresql.util.PSQLException: ERROR: function get_uuid() does not exist
The function get_uuid() is created during the Prescript-postgresql.sql and seems to be a wrapper around this fuction;
uuid_generate_v4()
I installed these packages uuid uuid-pgsql postgresql-contrib
I suspect that you would have to uninstall, and reinstall postgresql-contrib again to get the scripts to run again that create the uuid_generate_v4()
Gentoo
Building and installing Openbravo on Gentoo pretty similar to installing on other Linux boxes. But there is some remarks. This remarks are suitable for version 3.0, and 2.50 as well.
JAVA_HOME settings
JAVA_HOME may be be set to /etc/java-config-2/current-system-vm
-- then you can select JVM system-widelly using eselect:
eselect java-vm set system <desired-java-vm>.
Otherwise, if your preffered way is to select java-vm individually for each user you have to set JAVA_HOME to $HOME/.gentoo/java-config-2/current-user-vm
and ‘eselect’ desired JVM for every user who planned to develop Openbravo.
![]() | Note that setting JVM newer that declared to be compatible with Openbravo may result with errors and unpredictable behaviour. |
On the other hand, you may set JAVA_HOME to specific direct location, but after that you should be careful when you decide to replace current JVM to newer or older one.
JAVA_HOME and Tomcat environment
Keep in mind that JAVA_HOME must set when you run Openbravo instance, not only during initial build, because some operations requires sources to be recompiled. By default installation tomcat running without JAVA_HOME set in environment.
Ant environment
This is corresponds to an error exposed above for Fedora installation troubles but has another solution.
To avoid building error such as
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select ur from ADUserRoles ur where ur.userContact.id='0' and ur.active='Y' and ur.role.active='Y' order by ur.role.id asc]
you should set environment variable ANT_TASKS to 'none' to prevent ant automatically fill classpath with system JAR’s. Some of system-wide installed JAR’s conflicts with ones packaged with Openbravo sources.
![]() | Openbravo sources distribution has all libraries needed for building inside source tree, so it is better not to add anything, but explicitly required. |
Out of memory
To avoid “Out of memory” complaints during building OB you must add options '-Xms384M -Xmx1024M -XX:MaxPermSize=256M'
to both ANT_OPTS and CATALINA_OPTS environment variables.
Notes on editing environment variables
To make changes in environment system-wide you should put its assignations into a file and place it in /etc/env.d
, carefully checking precedence and possible overwritings.
Running ant tasks as the root user
build.xml:331: Don't run ant tasks with the root user
Do as it suggests, create a user and try again. Note that you should make this user the owner of the openbravo source code tree.
JAVA_HOME is not set
build.xml:332: The environment variable JAVA_HOME is not set
Set the JAVA_HOME variable as explained in the installation guide. The correct directory is the one that contains bin and lib.
Permission issues
src-core/build.xml:53: /var/www/html/openbravo/src-core/lib/openbravo-core.jar is read-only.
src/build.xml:838: Directory /var/lib/tomcat6/webapps/openbravo/WEB-INF/lib creation was not successful for an unknown reason
It is likely that you unpacked the source tarball as root and now you're working as a regular user. Become root again and 'chown -R user:user <openbravo_src_dir>' as well as the tomcat/webapps/openbravo directory (if it exists).
Database connectivity issues
src-db/database/build-create.xml:77: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
You may set a postgres superuser password with:
su - postgres psql -d postgres -U postgres
database "openbravo" already exists
src-db/database/build-create.xml:203: org.postgresql.util.PSQLException: ERROR: database "openbravo" already exists
You are probably reinstalling Openbravo. The installation scripts are supposed to drop the database before recreating it, but postgres will reject a DROP DATABASE if the database in question is being used. The culprit is Tomcat accessing the database. Stop tomcat, drop the database manually (su - postgres, pgsql, drop database openbravo;, \q, ^d), start Tomcat again and re-run ant install.source.
No supported regular expression matcher found
src-wad/build.xml:92: : java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher
Do not install Ant from Yum. Download and install it using our recommended guide.
java.lang.OutOfMemoryError
org.openbravo.base.exception.OBException: java.lang.OutOfMemoryError: GC overhead limit exceeded
You should make sure CATALINA_HOME, CATALINA_OPTS and ANT_OPTS are set correctly, in case you have missed them. Follow the Tomcat and Ant guides to do this.