---
schema_version: "1"
id: 2419c9d732f70c8ff2b77d8daed2e9b3bc57f6eb7171b831d7ece0957670dbc1
title: OFBiz Setup and Configuration
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/retail/latest/ofbiz-setup-config.md
canonical_url: https://docs.mulesoft.com/retail/latest/ofbiz-setup-config
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1a2a1e49fd44a2435ff502c8712e886bc6880b8e004c6a063db6dba8bc288821
description: MuleSoft Documentation Site
release: "3.2"
latest: true
---
---
product: Retail
version: 3.2
is-latest-version: true
---

# OFBiz Setup and Configuration

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Apache OFBiz is an OpenSource OMS solution.

## Prerequisites

The following components are required in order to set up and configure OFBiz:

- JDK

- Gradle

- A base installation of OFBiz

## OFBiz Configuration

The following steps are required in order to configure OFBiz for use by the Accelerator assets.

1.  It is recommended to create a separate service account for integration purposes

    - for example, `gradle loadAdminUserLogin -PuserLoginId=integrationadmin`

2.  Edit the framework/security/config/security.properties file and add the OFBiz server hostname to
    the host-headers-allowed setting

3.  Services must be exported in order for the Mule applications to be able to invoke them. These
    are defined in a services xml file under the servicedef folder, organized by domain. For each of
    the following services, add the attribute `export="true"` to the service definition tag (all
    file paths are relative to `$OFBIZ_HOME/applications`):

<table><colgroup><col> <col></colgroup><thead><tr><th>Path</th><th>Object</th></tr></thead><tbody><tr><td><p>party/servicedef/services.xml</p></td><td><p>createPartyPostalAddress quickCreateCustomer createPerson updatePerson createUpdatePartyEmailAddress createUpdatePartyTeleco Number createUpdatePartyPostalAddress findPartiesById</p></td></tr><tr><td><p>party/servicedef/services_view.xml</p></td><td><p>getPerson getPartiesFromExternalId getPartiesFromExactEmail getPartyContactMechValueMaps</p></td></tr><tr><td><p>accounting/servicedef/services_paymentmethod.xml</p></td><td><p>createCreditCard</p></td></tr><tr><td><p>order/servicedef/services.xml</p></td><td><p>addOrderItemShipGroup changeOrderStatus createOrderPaymentPreference findOrders storeOrder</p></td></tr><tr><td><p>product/servicedef/services_shipment.xml</p></td><td><p>createShipment</p></td></tr></tbody></table>

The service names can be cross-referenced with the XML request templates under
`src/main/resources/ofbiz` as well as a few of the Transform Message processors contained in the
flows.

The Order, Party, and Product entities must be customized to support the order, customer, and
product sync process, respectively. Here are the steps:

1.  Navigate to `$OFBIZ_HOME/applications/datamodel/entitydef`

2.  Make a backup copies of the `order-entitymodel.xml`, `party-entitymodel.xml`, and
    `partyproduct-entitymodel.xml` files

3.  Edit the `order-entitymodel.xml` file as follows:

    - Change the type of the externalId field in the OrderItem entity to "name" instead of "id"

    - Do the same for the externalId field in the OrderHeader entity

4.  Edit the `party-entitymodel.xml` file as follows:

    - Change the type of the externalId field in the Party entity to "name" instead of "id"

    - Add the following field to the Person entity:
      `<field name="customerNumber" type="name"></field>`

5.  Edit the `product-entitymodel.xml` file as follows:

    - Add the following field to the Product entity: `<field name="externalId" type="name"></field>`

6.  Save all the files and restart OFBiz if it’s already running

## Starting OFBiz

1.  Change directory to the OFBiz installation root

2.  Run `nohup gradle ofbiz &`

    - You can add the tail `-f nohup.out` to see the console output

3.  Open a browser and navigate to `<ofbizhost>:8443/accounting/control/main`

4.  Use the default administrative username `admin` on the account

## Stopping OFBiz

1.  Change directory to the OFBiz installation root

2.  Run `gradle ofbiz --shutdown`

    - Wait for it to shut down cleanly

## Troubleshooting

If you see column-constraint errors it is possible the `OrderItem.external_id` and/or
`Party.external_id` column did not get altered properly. To correct this, install the Apache Derby
tools (for example, `sudo apt-get install derby-tools`) and run the following commands. Be sure to
shut down OFBiz first:

$ ij ij> connect 'jdbc:derby:/opt/ofbiz/runtime/data/derby/ofbiz' user 'ofbiz' password 'ofbiz'; ij>
alter table Party alter column external\_Id set data type varchar(100); ij> alter table Order\_Item
alter column external\_Id set data type varchar(100); ij> alter table Order\_Header alter column
external\_Id set data type varchar(100); ij> exit;

Restart OFBiz to pick up the changes.

## See Also

- [Prerequisites](https://docs.mulesoft.com/retail/latest/prerequisites)

- [MuleSoft Accelerator for Retail](https://docs.mulesoft.com/retail/latest/)
