Web / Apache OFBiz Interview questions
1. What is Apache OFBiz?
Apache OFBiz (Open For Business) is an open-source enterprise resource planning (ERP) framework and suite of business applications built entirely on Java. It started as a SourceForge project in 2001, entered the Apache Incubator in January 2006, and became an Apache top-level project in December ...
2. What are the main business applications that ship with Apache OFBiz?
OFBiz ships as a collection of business-application components on top of one shared framework, so installing it gives you working, connected apps rather than separate products. Accounting - general ledger, invoicing, payments, and fixed assets. Order Manager - sales and purchase order processing....
3. What is the Entity Engine in OFBiz?
The Entity Engine is OFBiz's built-in data access and persistence layer . It sits between the applications and the underlying relational database, so no application code writes raw SQL. Entities (tables) and their fields, relations, and indexes are declared once in XML files such as entitymodel.x...
4. What is the Service Engine in OFBiz?
The Service Engine is OFBiz's layer for defining and invoking business logic as discrete, reusable units called services . A service has a name, a defined set of input/output parameters, and an implementation written in Java, Mini-language (simple-method), or Groovy. Instead of calling a Java met...
5. What is a component in OFBiz?
An OFBiz component is a self-contained module - such as party , order , or a custom app - that packages everything it needs: entity definitions, services, screens, forms, web app configuration, and data files. Every component is described by an ofbiz-component.xml file at its root, which tells th...
6. What is the purpose of the Screen Widget?
The Screen Widget defines the layout and composition of a page in XML, independent of any specific template language. A screen widget file (usually *Screens.xml ) says what decorator to use, what data to prepare, and which sub-elements - other screens, forms, menus, or a FreeMarker template - to ...
7. What is the purpose of the Form Widget?
The Form Widget declares data-entry and list forms in XML - field types, labels, validation hints, and layout - without hardcoding HTML. A form definition (in a *Forms.xml file) references an entity or service to auto-derive field types where possible, then lets you override individual fields. Fo...
8. What is a delegator in OFBiz?
A delegator is OFBiz's handle to the Entity Engine for a given tenant/data source. Every entity operation - findOne , findList , create , store , removeByAnd - is called on a delegator instance rather than on a raw JDBC connection. The delegator name (commonly default ) is resolved via entityengi...
9. What is a dispatcher in OFBiz?
A dispatcher (LocalDispatcher) is the entry point used to invoke services. Where a delegator talks to the Entity Engine, a dispatcher talks to the Service Engine via dispatcher.runSync(...) or dispatcher.runAsync(...) . The dispatcher resolves the service name against its definition in a *Service...
10. What is entitymodel.xml used for?
entitymodel.xml is the file (one per component, under entitydef/ ) that declares that component's data model for the Entity Engine: which entities exist, their fields and types, primary keys, indexes, and relations to other entities. A typical entity declaration looks like this:
11. How do you define a new entity in OFBiz?
Defining a new entity is a declarative, config-first process: Add an
12. How do you define a new service in OFBiz?
A service's definition and its implementation are kept separate: Declare the service in a servicedef/services.xml file: its name, engine type ( java , simple , groovy , entity-auto , etc.), and its attribute list (input/output parameters with mode IN , OUT , or INOUT ). Point it at an implementat...
13. What is Mini-language (simple-method) in OFBiz?
Mini-language , also called simple-method , is OFBiz's original XML-based scripting language for writing service and event implementations without full Java classes. A typical simple-method reads like a small procedural script expressed as XML tags -
14. What build tool does OFBiz use?
OFBiz builds and runs using Gradle , having migrated off Apache Ant in the 16.11 release series. The gradlew / gradlew.bat wrapper scripts are checked into the repository, so no separate Gradle install is required. Common tasks include: Command Purpose ./gradlew cleanAll loadAll Wipes and reloads...
15. What are the default admin login credentials for a fresh OFBiz install?
Out of the box, a freshly loaded demo dataset creates an administrative UserLogin with the username admin and password ofbiz . It's used to sign into applications such as Order Manager, Catalog Manager, and WebTools right after installation. This account exists purely to let you explore and confi...
16. What are Security Groups and Security Permissions in OFBiz?
OFBiz's security model has two layers. A Security Permission is a named right, like ORDERMGR_ADMIN or CATALOG_VIEW , checked before an action is allowed. A Security Group is a named bundle of permissions - FULLADMIN , for example, grants every permission in the system. Users get access by being a...
17. What is the Party component used for?
The Party component is OFBiz's model of "who" - it represents both persons and organizations under one shared abstraction, so a customer, a supplier, an employee, and your own company can all be represented consistently. On top of the base Party entity, it layers PartyRole (customer, vendor, empl...
18. What are seed, seed-initial, and demo data types in OFBiz?
OFBiz classifies its XML data files by purpose so you can load only what a given environment needs: Type Contains Used in seed Core reference data the app needs to function (enum types, status codes) Every environment, including production seed-initial One-time setup data (initial admin user, def...
19. Why does OFBiz use its own Entity Engine instead of a plain JPA/Hibernate ORM?
OFBiz predates the maturity of JPA/Hibernate and was built to solve problems those ORMs don't fully cover for a multi-app ERP: one logical data model shared and extended across dozens of independently deployable components, multiple simultaneous data sources or tenants from one codebase, and data...
20. How does a Service Engine call differ from a direct Java method call?
A direct Java method call executes in-process with whatever access and error handling the caller happens to implement. Calling the same logic as an OFBiz service instead routes it through the dispatcher, which layers in behavior a plain method call doesn't get for free: Parameter validation again...
21. What is the difference between SECA and EECA?
SECA (Service Event Condition Action) and EECA (Entity Event Condition Action) both trigger extra logic automatically, but they hook into different layers of the framework. SECA EECA Fires on a service invocation event (before/after, success/failure) Fires on a raw entity operation (create, store...
22. Explain the execution flow of a synchronous service call in OFBiz?
A synchronous call runs to completion and returns its result map before the caller continues - used whenever the caller needs the outcome immediately, such as validating a form submission. sequenceDiagram participant Caller participant Dispatcher participant Engine as Service Engine participant I...
23. Explain the execution flow of an asynchronous service call in OFBiz?
An async call ( dispatcher.runAsync ) queues the service to run on a separate thread or, if declared persistent, as a row in the JobSandbox table picked up later by the Job Scheduler - the caller doesn't wait and gets no direct return value. This is the pattern for fire-and-forget work: sending a...
24. Explain the internal working of the Screen Widget rendering pipeline?
Rendering a screen is a two-phase process: gather data, then render layout. flowchart LR A[Request hits Control Servlet] --> B[RequestHandler resolves view to a screen] B --> C[Screen actions run: service calls, entity queries] C --> D[Widgets composed: decorator, sections, sub-screens/forms/menu...
25. What is the difference between a static entity and a view-entity?
A regular entity maps directly to one physical database table - fields correspond to columns, and CRUD operations write straight through. A view-entity , by contrast, is a virtual entity assembled from one or more underlying entities via declared member-entity and view-link elements - conceptuall...
26. How does OFBiz cache entity data, and when should the cache be cleared?
The Entity Engine keeps several in-memory caches - by primary key, by query condition, and for entire lists - keyed per delegator, so repeated reads of reference data (like a status or product-type list) avoid hitting the database every time. Caching is configured per entity and is most valuable ...
27. What is the difference between GenericValue and GenericEntity?
GenericEntity is the base class providing the core map-like behavior for any entity instance - field storage, equality, and comparison against a ModelEntity definition. GenericValue extends GenericEntity and adds the behavior used day to day: a reference back to its delegator, so you can call .ge...
28. Why would you use a dynamic-view-entity instead of a predefined view-entity?
A predefined view-entity is declared once in XML and fixed - great for a join you'll reuse everywhere. A DynamicViewEntity is built at runtime in Java, letting you assemble member entities, aliases, and conditions on the fly based on parameters only known when the code executes - a search screen ...
29. Explain the lifecycle of a sales order in OFBiz from cart to fulfillment?
A sales order moves through a well-defined status chain, driven by services rather than direct database updates, so every transition can trigger related side effects such as inventory reservation, invoicing, or notifications: flowchart LR A[Shopping Cart] --> B[Order Created] B --> C[Order Approv...
30. How does OFBiz support multi-tenancy?
OFBiz supports multi-tenancy at the delegator level: each tenant gets its own delegator name mapped, via entityengine.xml and the Tenant / TenantDataSource entities, to either a separate schema or an entirely separate database, while sharing the same deployed application code. A tenant is identif...
31. What is the difference between writing a service in Mini-language versus Groovy?
Both compile down to the same Service Engine contract - identical parameter validation, identical transaction handling - so the choice is really about implementation language, not the service's external behavior. Mini-language Groovy XML-based, declarative-looking tags Real scripting language, cl...
32. How does OFBiz's Job Scheduler execute persisted and recurring jobs?
Persisted jobs live as rows in the JobSandbox entity, each recording the service to run, its serialized parameters, a run time, and, for recurring jobs, a link to a TemporalExpression defining the recurrence pattern (daily, every N minutes, specific weekdays, and so on). A background JobPoller th...
33. What is the difference between OFBiz's ModelEntity and ModelService?
ModelEntity is the in-memory, parsed representation of one entity's definition from entitymodel.xml - its fields, types, primary key, and relations - used by the Entity Engine to validate queries and generate SQL. ModelService is the equivalent parsed representation for a service definition from ...
34. How do you troubleshoot a service invocation failure using OFBiz logs?
Start with the log files under runtime/logs (commonly ofbiz.log and the rolling console logs), where the Service Engine logs the service name, the exception, and often the full parameter map at the point of failure. Confirm the service name and check its definition in the relevant *Services.xml -...
35. Explain the internal working of the OFBiz security/permission checking framework?
Every protected action - a service call, a screen view, a specific button - can declare the permission it requires. At request or service-invocation time, the framework checks whether the current UserLogin has that permission through its group memberships. flowchart TD A[UserLogin attempts action...
36. What is the difference between a screen decorator and a plain screen definition?
A plain screen renders one piece of page content - a form, a report, a fragment. A decorator is a special screen that defines the surrounding page shell: header, navigation, footer, and a named placeholder (a body section) where the content screen gets inserted. A content screen references its de...
37. When should you use a stored/Java service instead of a Mini-language service?
Reach for Java (or Groovy, for less ceremony) when the logic needs things Mini-language handles awkwardly: complex branching and loops, calls to external Java libraries or APIs, precise numeric or date manipulation, or performance-sensitive code executed very frequently. Mini-language stays a fin...
38. How does Distributed Cache Clear (DCC) keep entity caches consistent across a cluster?
When multiple OFBiz instances point at the same database, each instance keeps its own in-memory Entity Engine cache - a write on one node wouldn't otherwise be visible to another node's cache. Distributed Cache Clear solves this by broadcasting a cache-invalidation message to every other configur...
39. What happens internally when you run "gradlew cleanAll loadAll"?
cleanAll and loadAll are two separate Gradle tasks usually run together during setup or a full reset: cleanAll drops and recreates the configured database schema(s), wiping all existing data, based on every component's merged entitymodel.xml . loadAll then reloads XML data files across all instal...
40. What is the difference between the plugins directory and the older hot-deploy directory?
Older OFBiz releases used a hot-deploy directory for custom or third-party components: drop a component folder in, and the Ant-based build would pick it up automatically alongside the core framework. Since the move to Gradle, custom and optional components live under the plugins directory instead...
41. How can you optimize entity queries in OFBiz for large datasets?
Several framework-level levers help before reaching for custom SQL: Select only the fields you need with an EntityListIterator instead of full GenericValue objects when scanning large result sets. Use findList with an EntityCondition that maps to an indexed column, and confirm the matching index ...
42. What is the difference between the Order Manager and Accounting components?
Order Manager owns the commercial transaction itself: carts, sales and purchase orders, order items, statuses, and fulfillment tracking through shipments. Accounting owns the financial consequences of those transactions: the general ledger, invoices, payments, and fixed assets. It doesn't know ho...
43. Explain the execution flow of an inbound web request through OFBiz's Control Servlet?
sequenceDiagram participant Browser participant ControlServlet participant RequestHandler participant Event participant View as Screen/View Browser->>ControlServlet: HTTP request to /control/orderview ControlServlet->>RequestHandler: dispatch RequestHandler->>RequestHandler: look up request in co...
44. How do Entity ECAs enforce validation rules without modifying core Java code?
An Entity ECA (EECA) is declared in XML against a specific entity and operation - "whenever ExampleItem is created or stored, run this condition and action" - without touching the Java class or Mini-language service that performs the actual write.
45. Why doesn't OFBiz ship with a traditional MVC framework like Spring MVC?
OFBiz predates the popularity of Spring MVC and built its own request/response and templating layer - Control Servlet, controller.xml, and Screen/Form Widgets - specifically to be driven by the same declarative model as its Entity and Service Engines, so a screen's data-gathering step is naturall...
46. How can you extend an existing core entity without modifying core framework files?
OFBiz's entity model is additive by design: a plugin component can declare its own entitymodel.xml that adds new fields or relations onto an existing entity name, and the framework merges every component's contributions into one logical model at startup rather than requiring a single file to own ...
47. What is the difference between the Fluid and default (Bootstrap-based) OFBiz themes?
OFBiz's UI is theme-driven, so the same Screen/Form Widget definitions can look completely different depending on which theme component is active - themes supply the CSS, layout templates, and macro implementations that actually render each widget element. The default /backend theme targets the i...
48. How does OFBiz integrate with Apache Solr for product search?
OFBiz ships an optional integration that indexes product data into Apache Solr so storefront searches don't run expensive relational queries - multi-table joins across products, categories, features, and prices - on every keystroke. A dedicated service reads product-related entities and pushes do...
49. What is the difference between OFBiz's REST/SOAP service export and calling a service internally?
Internally, calling a service through dispatcher.runSync or runAsync happens in-process: parameters are a Java object (typically a Map ), and the caller shares the same JVM, transaction context, and delegator as the callee. Exposing the same service over REST or SOAP adds a network and serializat...
50. How do you troubleshoot a permission denied error accessing a screen?
Start by identifying exactly which permission the screen or its underlying service requires - check the security element on the relevant controller.xml request, or the permission check inside the service definition being invoked. Look up the user's UserLogin in WebTools and list their UserLoginSe...