Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Demo and Test Setup Guide

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 OFBiz Framework Configuration Guide, the Entity Engine (database) Configuration Guide, the Service Engine Configuration Guide, and other related documents you may found at OFBiz Documentation Index

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

You can get up and running quickly by downloading the OFBiz Complete distribution and following some simple instructions. For more options and explanations, see the rest of this document.

  1. Download and install the Java 2 v1.5 series JDK/J2SDK (not the JRE, you need the full SDK) from Sun's Java (J2SE) site, and 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)
  2. Download the OFBiz release archive and unzip it in the directory of your choice (see comments below about that, so for now checking out of SVN repository is preferred, see below...). This should create one sub-directory: ofbiz. This will be the OFBIZ_HOME location.
  3. Start OFBiz with embedded Tomcat by going into the ofbizdirectory and then running "startofbiz.bat" (or "%JAVA_HOME%\bin\java -jar ofbiz.jar") for Windows, or "./startofbiz.sh"(or "$JAVA_HOME/bin/java -jar ofbiz.jar") for Linux/Unix. For OS X you can just run "java -jar ofbiz.jar" and you don't need to setup the JAVA_HOME or anything because it is already there.
  4. Open a browser and go to http://127.0.0.1:8080/ecommerce/control/main for the ecommerce application or https://127.0.0.1:8443/webtools/control/main for the WebTools application or https://127.0.0.1:8443/catalog/control/main for the Catalog Manager application.
  5. The default administrative account is username: "admin", password: "ofbiz".
  6. Have fun with it! You are running on a Java database. For more discussion of databases, read the section below on that topic.
  7. For more detailed options and configuration information, read on!

Building From SVN

When building from SVN you will need to have a Java 1.5 series J2SDK (NOT just the JRE, need to full SDK) as mentioned above. The build is done using Ant, and sufficient Ant libraries are included with OFBiz. If you have Ant installed separately just make sure you have version 1.5 or later, and then run Ant as normal intead of as listed in the following examples.

In the directory where you want OFBiz to be, do a SVN checkout of the ofbiz trunk. For example:

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

For information on connecting to SVN click here.

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

To load the seed and demo data, run "ant.bat run-install" or "%JAVA_HOME%\bin\java -jar ofbiz.jar install" (Windows), or "./ant run-install" or*"$JAVA_HOME/bin/java -jar ofbiz.jar install"* (Linux/Unix/OSX)

As an alternative to the previous step: to load the seed data only, run "ant.bat run-install-seed" or "%JAVA_HOME%\bin\java -jar ofbiz.jar install -readers=seed" (Windows), or "./ant run-install-seed" or*"$JAVA_HOME/bin/java -jar ofbiz.jar install -readers=seed"* (Linux/Unix/OSX)

To start the server run "ant.bat run" or "%JAVA_HOME%\bin\java -jar ofbiz.jar" (Windows), or "./ant run" or "$JAVA_HOME/bin/java -jar ofbiz.jar" (Linux/Unix/OSX)

Another build option in the Ant build script that is useful is "ant.bat clean" (Windows) or "./ant clean" (Linux/Unix/OSX). That will clean out all built classes allowing you to run "ant" 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.

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 Derby, an open source Java database from IBM that complies with DB2 specs and is based on the 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 (4.1.11 or later, or the 5 series) . 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. Please note that if you use this 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 "run-install" Ant target as mentioned in the Building from SVN section.

J2EE Containers

OFBiz comes and runs by default with Tomcat for a Servlet/JSP container and the Geronimo Transaction Manager for a transaction (JTA) manager. A patched version of Minerva (included in SVN) is the current preference for a transaction aware connection pool, though as other options are made available that may change.

OFBiz can also be configured to run in different containers, but there may be issues with certain quirks that other containers have, especially with servlet containers. We have always been able to find work-arounds for these, but they also seem to keep on appearing, so that is just something to watch for.

Because of the difficulty of deploying in an external application server we have created a configuration and script template tool that takes the classpath and webapp settings from the various OFBiz files to more easily generate the files you need. For more information, see the README file in the ofbiz/framework/appservers directory. If you are looking for a good commercial J2EE app server, Orion is a good place to start, but we recommend trying out Tomcat and Geronimo TM and see if they meet your needs.

  • No labels