官术网_书友最值得收藏!

  • ADempiere 3.6 Cookbook
  • Ajit Kumar
  • 554字
  • 2021-04-09 21:40:51

Debugging the ADempiere client application (Desktop version)

Debugging the client version is pretty straightforward and quick. In this recipe, we will see how to configure the project in Eclipse so that we can debug ADempiere when we run it as a client application (the Swing version).

Getting ready

Before we can run ADempiere, there are properties, specific to ADempiere, which need to be configured properly for example, JDK location detail, application server detail, database detail, SMTP detail (for e-mails), and so on. The following steps must be completed to ensure that these properties are set up correctly:

  1. In Eclipse, open the Open Resource window and select the Setup.java file. It is available under the install\src\org\compiere\install package of your adempiere360lts project.
  2. Right-click on the Setup.java file in the Project Explorer and select the option Run As | Java Application. This will launch an ADempiere setup screen.
    Getting ready

    For the client version, we need to set the fields in the following sections of the screen:

    • Java
    • Adempiere
    • Database Server
    • Mail Server (Optional)

    Click on the Test button and if everything was set correctly, you will see the Ok message at the bottom of the setup screen. In case you get errors, verify the values you have entered. Correct them and Test until you get the Ok message. Any errors during the testing are also shown on this window.

    Note

    In case any errors occur during your practice and it is not described in the book, you may refer to the ADempiere Wiki and forums for more information.

  3. Click on the Save button. This will create the Adempiere.properties file in the Adempiere Home directory. After creating the property file, the program tries to build the code base but fails with a build error. Do not worry! Our intention was to only get the Adempiere.properties file created, which we will use in our subsequent setups.

How to do it...

Now that we have got the Adempiere.properties file out, it is a trivial task to be able to debug the application. Here are the steps:

  1. In Eclipse, open the Open Resource window and select the Adempiere.java file. It is available under the base\src\org\compiere folder of your adempiere_360 project. This class is the entry point class for the client version.
    How to do it...
  2. Add a break-point at Line 594 inside the main method.
  3. Right-click on the Adempiere.java file and select Debug As | Debug Configuration. This will bring up the Debug Configurations window.
    How to do it...
  4. Click on the Arguments tab and specify the following VM arguments:
    DPropertyFile="C:\adempiere_svn\tags\adempiere360lts\ADempiere.properties"
    DADEMPIERE_HOME="C:\ tags\adempiere360lts"
    
    • PropertyFile: Points to the Adempiere.properties file, which we had created earlier
    • ADEMPIERE_HOME: Points to the Adempiere folder
    How to do it...
  5. Click on the Debug button to start the debugging.
    How to do it...
  6. Use the toolbar on the Debug window to debug the code. This way, you can figure out how the control is flowing in the ADempiere source code and gain a better understanding of the subject.

How it works...

Adempiere.java is the main class file which provides the entry point for the desktop version of ADempiere. This is the class where you will find the main method. To this class, the two important properties—PropertyFile and ADEMPIERE_HOME must be passed so that it can read the setup information (database, mail server, JRE path, and so on) and run the application.

See also

  • Creating an installer from the source code
  • Installing Adempiere
主站蜘蛛池模板: 绥江县| 茌平县| 无锡市| 兴安县| 大悟县| 汝州市| 延庆县| 隆昌县| 永定县| 宿松县| 富蕴县| 富顺县| 阿鲁科尔沁旗| 平乡县| 萨嘎县| 澄江县| 平遥县| 彰化市| 宿州市| 福泉市| 北宁市| 上犹县| 云阳县| 原平市| 文安县| 沽源县| 台中市| 威远县| 那坡县| 泸州市| 临朐县| 茌平县| 林甸县| 琼海市| 咸宁市| 梅河口市| 广平县| 景洪市| 新密市| 鸡泽县| 贵港市|