Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ADempiere 3.6 Cookbook

You're reading from   ADempiere 3.6 Cookbook Over 100 recipes for extending and customizing ADempiere beyond its standard capabilities

Arrow left icon
Product type Paperback
Published in Mar 2011
Publisher
ISBN-13 9781849513388
Length 332 pages
Edition Edition
Tools
Arrow right icon
Toc

Table of Contents (16) Chapters Close

ADempiere 3.6 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
1. Preface
1. Preparing the Ground 2. ADempiere Customization Part I FREE CHAPTER 3. ADempiere Customization Part II 4. Web services 5. VirtueMart Integration 6. JasperReports with ADempiere 7. PayPal Integration 8. Equifax Integration 9. Mondrian Integration for Analysis 10. E-mail Integration with Mozilla Thunderbird

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. 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. 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.

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.

  1. 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. 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.

  1. 2. Add a break-point at Line 594 inside the main method.

  2. 3. Right-click on the Adempiere.java file and select Debug As | Debug Configuration. This will bring up the Debug Configurations window.

  1. 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

  1. 5. Click on the Debug button to start the debugging.

  2. 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

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image