Ofbiz-osgi-prototype
From Opentaps Wiki
Jump to navigationJump to searchThis page provides information about running ofbiz as an OSGi bundle; this prototype has been hand-crafted.
Contents
What is ofbiz-osgi prototype?
I worked with Raj to get a working ofbiz bundle. The ofbiz bundle and many dependencies were manually created so there is no build. Also the web applications do not work as Tomcat is not started. However the ofbiz services are available and can be tested.
Download the binaries
Please download the binaries from this link:
ofbiz-osgi-proto-wiki.zip
Unzip the archive in a folder; let's call it "base". Under base folder there are 3 folders:
- bundles (includes required dependencies packaged as OSGi bundles)
- com.viithiisys.ofbiz.service (OSGi bundle that activates the ofbiz bundle)
- org.apache.ofbiz (ofbiz as OSGi bundle)
Create the OSGi platform in eclipse
- create a new eclipse workspace to start fresh
- go to Windows -> Preferences
- in the filter text box type "console"
- in the Run/Debug Console section un-check "Limit console output"
- clear the filter and select "Plug-in Development" -> "Target Platform"
- click Add button to add a new OSGi platform
- select Template -> Base RCP (Binary Only) then click Next; this option adds the core equinox OSGi components
- click Add button; select Directory; and select location "base/bundles"; click Finis; (this adds the ofbiz dependencies)
- click Finish to complete the platform creation
- select the new platform (by default is called "Base RCP (Binary Only)"); click Apply so it becomes the default platform
- you can click Reload button to make sure that it is all loaded and fresh
Add projects to eclipse
- File -> Import -> General -> Existing Projects into Workspace
- select folder "com.viithiisys.ofbiz.service" under base and click Finish
- File -> Import -> General -> Existing Projects into Workspace
- select folder "org.apache.ofbiz" under base and click Finish
- Project -> Clean -> Clean All Projects
- there should be no errors after clen
- open the Problems window to check (Window -> Show View -> Other -> General -> Problems)
Create a running configuration and run the platform
- point ofbiz to your database (check under folder base/org.apache.ofbiz)
- Run -> Run Configurations -> OSGi Framework -> New
- give it a name (ofbiz-osgi)
- click "Add Required Bundles" button
- click "Validate Bundles"; there is reported one problem with groovy missing javax.management; this error can be ignored
- select checkbox "Validate bundles automatically prior to launching"
- go to Arguments tab
- change VM arguments; add parameter: -Dofbiz.home=....\base\org.apache.ofbiz so ofbiz finds its configuration
- click Apply button
- click Run button
Watching the console you see a trace similar to:
ofbiz-osgi-proto.log