Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Normally we start OFBiz with the command line

Code Block

  %JAVA_HOME%\bin\java -jar ofbiz.jar

To start in debug mode use the command line

Code Block

  %JAVA_HOME%\bin\java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091 -jar ofbiz.jar

...

There is an ant task that you could use to start Ofbiz with the debug settings above.

Code Block

  ./ant run-debug

Step 2: Connect to OFBiz with Eclipse as a Debugger

...

3. Debugging (or running) OFBiz in Eclipse with hot replacement of classes

...

  • Select OFBiz project, right-click on it -> Run As -> Run ... (alike for Debug)
  • Select Java Application and click on New
  • Set Run configuration name to OFBiz.start
    • Main tab:
      • Project: OFBiz
      • Main class: org.ofbiz.base.start.Start
    • Arguments:
      • Program Arguments: -start
      • VM arguments: -DDEBUG=true -Xms(minValue)M -Xmx(maxValue)M  (typically minValue = 128, maxValue = 512)
    • Classpath
      • User Entries: Add the framework/base/config directory
  • Click on Apply
  • add the following lines to the /ofbiz/framework/entity/src/META-INF/services/org.ofbiz.base.conversion.ConverterLoader unless your ofbiz svn release is greater or equal to r1308085. see https://issues.apache.org/jira/browse/OFBIZ-4777
    • org.ofbiz.base.conversion.BooleanConverters
    • org.ofbiz.base.conversion.CollectionConverters
    • org.ofbiz.base.conversion.DateTimeConverters
    • org.ofbiz.base.conversion.JSONConverters
    • org.ofbiz.base.conversion.MiscConverters
    • org.ofbiz.base.conversion.NetConverters
    • org.ofbiz.base.conversion.NumberConverters
  • add the build-eclipse target in the main build.xml as
    <target name="build-eclipse" depends="build">
    <delete>
    <fileset dir="${basedir}">
    <include name="**/build/lib/ofbiz-*.jar"/>
    <exclude name="**/ofbiz-minerva.jar"/>
    </fileset>
    </delete>
    </target>
  • run ant build-eclipse at the OFBiz directory
  • launch OFBiz.start with the debugger launcher

...