Demo and Test Setup Guide - OFBiz Project Open Wiki (2024)

Pre Gradle version

This page documents the usage with Gradle, the pre-Gradle documentation is here: Demo and Test Setup Guide

This page documents the trunk version, the documentation for the R16.11 version is here: Demo and Test Setup Guide

Table of contents

Introduction

This document describes an initial setup process and basic configuration options for the Open For Business Project. For more detail see related documents such as the Framework Configuration Guide, the Entity Engine Configuration Guide, the Service Engine Configuration Guide, and other related documents you may found at Documentation

If you run into trouble there are various resources available to help. The first steps would be to search on the New OFBiz Docs Site and Old OFBiz Wiki (now archived), and then on the OFBiz Mailing Lists. If you can't find you answer there, then subscribe to the Apache OFBiz Users Mailing List, and send a message with as much detail as possible about the problem you are having.

Quick & Easy Setup

There are 2 possibilities to get up and running OFBiz quickly by following some simple instructions:

  • Download an OFBiz release
  • Check out from the repository (see below for more).

For more options and explanations, see the rest of this document.

  1. Download and install Java 1.8 or higher JDK/J2SDK (not the JRE, you need the full SDK) from Sun's Java (J2SE) site. You can use OpenJdk 8 (or higher).
    Make sure your JAVA_HOME environment variable is set to this JDK after installation (NOTE that for Mac OS X no JVM setup is needed, just make sure Java is up to date with the OS X Software Update facility).
    There are still people using older versions, even it it's of course not recommened, notably for security reasons. By and large see this page on system requirements.
  2. "Download" OFBiz in the directory of your choice (see comments below about that). This should create one sub-directory: ofbiz. This will be the OFBIZ_HOME location.
  3. (not for snapshots) Load OFBiz demo data in the embedded Apache Derby database running "gradlew loadAll" on Windows or "./gradlew loadAll" on Linux/Unix/OSX.
  4. Start OFBiz with embedded Tomcat by going into the ofbiz directory and then running
    • Windows: "gradlew ofbiz" or "startofbiz.bat" (or even "%JAVA_HOME%\bin\java -jar build\libs\ofbiz.jar")
    • Linux/Unix/OSX: "./gradlew ofbiz" or "./startofbiz.sh" (or even "$JAVA_HOME/bin/java -jar build/libs/ofbiz.jar").
  5. Open a browser and go to
    https://localhost:8443/ecommerce or https://localhost:8443/ecomseo for the ecommerce application or
    https://localhost:8443/webtools
    for the WebTools application or
    https://localhost:8443/catalog for the Catalog Manager application.
  6. The default administrative account is username: "admin", password: "ofbiz".
  7. Have fun with it! You are running on a Java database. For more discussion of databases, read the section below on that topic.
  8. For more detailed options and configuration information, read on!

Building OFBiz

When building, a release or a svn checkout, you will use Gradle, and sufficientGradle libraries (notably the gradlew wrapper) and scripts are embedded with OFBiz.

In the directory where you want OFBiz to be, do a SVN checkout of, for instance, the ofbiz trunk (releases branches are also availble). For example:

svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz

For information on connecting to SVN see above.

Now go into the "ofbiz" directory and run "gradlew" (Windows), or "./gradlew" (Linux/Unix/OSX). It will compile all modules and leave you an executable jar (ofbiz.jar) in the "ofbiz/build/libs" directory.

About Gradle

  • On *nix platforms, You need to add "./" ahead of "gradlew" to get the embedded Gradlew wrapper running. You might use your own Gradle installation but that's out of the scope of this page.

To start the server run "gradlew ofbiz"

Another build option that is useful is "gradlew clean" (Windows) or "./gradlew clean" (Linux/Unix/OSX). That will clean out all built classes allowing you to run "gradlew" again to get a clean build. If you are running into funny errors after updating from SVN in the future, give this clean build process a try first.

You can get more information about available Gradle possibilities using "gradlew tasks" (Windows) or "./gradlew tasks" (Linux/Unix/OSX)

Database Setup

Database setup is done in the entityengine.xml file. There are many options there which are described in the Entity Engine Configuration Guide

The OFBiz package comes with Apache Derby, an open source Java database with DB2 specs and is based on the IBM Cloudscape product. This database is good for demonstration purposes because it is easy to setup and use. It is not the best for large data sets and does not provide the same performance or scalability that a major database would, but compared to HypersonicSQL (that we used to use) it is significantly better because while not as fast for small scale operations it is closer to a production database environment and allows us to catch issues earlier on. Smaller sites might even consider this as an option for their production deployment, especially once the database is a bit more stabilized.

There are many open source databases that will scale well and deliver good performance. The two most popular are PostgreSQL and MySQL. Postgres is a very full featured database with transaction support, foreign keys, stored procedures, et cetera. Postgres also has very friendly license terms. MySQL is a pretty good option these days as well but we recommend PostgreSQL. Please note that if you use MySQL in a commercial production instance you may have to purchase a commercial license because it is GPL licensed and so is the JDBC driver. MySQL AB allows use of the JDBC driver in open source projects in spite the GPL license, but this may not apply for commercial use of a modified OFBiz. For some, a commercial license is the preferred way to go anyway because of support and warranty and other issues. For those with this preference considering Postgres there is also a commercial Postgres derivative called EnterpriseDB.

Commercial databases are also supported. If you have database licenses for other needs, or have major in-house familiarity with and support for a certain commercial database, then there is no reason not to take advantage of that. OFBiz has been tested with Oracle, DB2, Sybase, MS SQL Server and others and should work fine with any database that has a JDBC driver. Please note that we have experienced that in some cases the JDBC drivers included with certain databases are not fully specification compliant. The options are often to use the database-specific APIs or to get a third party driver. The database-specific code is an issue because of licensing restrictions and additional difficulty needed to keep up with them, so sometimes a third party (even a commercial one) is preferred. For example with Oracle we have had much more success with the DataDirect JDBC driver.

There is no need to run any SQL scripts to create the tables or populate them with the default data. The entity engine can create missing tables or fields when the server starts up and does so if the appropriate property is set in the entityengine.xml file. This is the file that configures the servers for the entity engine.

For the table creation routine to work properly, the field types must be set up. Do this by specifying the corresponding fieldtypeXXX.xml (where XXX is the database name) file for the server in the entityengine.xml file. These fieldtypeXXX.xml files are located in the ofbiz/framework/entity/fieldtypedirectory.

Default data can be loaded through the "loadAll" Gradle target as mentioned in the Building from SVN section.

J2EE Containers

OFBiz comes and runs by default with Tomcat for a Servlet/JSP container, the Apache Geronimo Transaction Manager for a transaction (JTA) manager, and Apache DBCP for a transaction aware connection pool.

Demo and Test Setup Guide - OFBiz Project Open Wiki (2024)
Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 5605

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.