DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Frameworks
  4. Consistency Checks for Eclipse RCP Applications

Consistency Checks for Eclipse RCP Applications

Vitaly Mikheev user avatar by
Vitaly Mikheev
·
Dec. 15, 08 · Interview
Like (0)
Save
Tweet
Share
5.06K Views

Join the DZone community and get the full member experience.

Join For Free

The Eclipse Runtime enables you to create a well-formed modular architecture for Java applications. Each OSGi bundle has a unique name space and explicitly declares the imported/exported packages, and the Runtime enforces these rules.

Pitfalls

However, arranging application jars into a set of OSGi bundles may be tricky and error-prone, especially if the application jars are "strongly connected", that is, have lots of cross-references. The typical issues that may arise are

  • redundant classes: two jars contain classes with the same package and class name and the jars are placed in the same OSGi bundle. In this case, the classes from one jar will be actually used at run time and the others become "deployment baggage"

  • absent classes: a piece of code references a class that cannot be found within the bundle and is not exported from the other bundles. Unless the "wanted" class appears at run time, ClassNotFoundException will be thrown when control reaches that code.

    If your test suite does not achieve 100% code coverage (including third-party jars), there is a chance that the problem will manifest itself on end user systems.

Static checks to the rescue

To detect such inconsistencies before deployment, you may use Excelsior JET 6.5 beta. The JET Control Panel can analyze your Eclipse RCP application and report the found issues. Under the covers, it takes the OSGi bundles of your application and statically applies the resolution procedure used by the Eclipse Runtime as if the application was started and the bundles were loaded.

The results

When implementing this feature, we were really curious if such warnings would be found in real Eclipse RCP applications, and the answer came soon. Here go two examples:

Eclipse Classic IDE 3.4 (Ganymede)
Redundant (duplicated) classesReferenced absent classesUnresolved super classes
713818

A large commercial RCP application
Redundant (duplicated) classesReferenced absent classesUnresolved super classes
15429974

Note that "unresolved super class" is a severe warning. If the code of a method just references an absent class, say, invokes a method or uses a field of that class, ClassNotFoundException is thrown only when the referencing code is executed. You are lucky if that code is on a rarely executed branch and the enclosing method runs fine in most cases ( of course, this is an optimistic assumption :). On the contrary, an absent super class prevents any usage of any classes derived from it because ClassNotFoundException will be thrown immediately when loading such a derived class.

Finally, if the application works flawlessly since it never uses the problematic classes, what is the point of deploying them to end user systems?

Try it yourself

To avoid surprises, check your Eclipse RCP application for consistency before deployment:

  1. Download and install Excelsior JET 6.5 beta
  2. Start the JET Control Panel and click "Eclipse RCP Application" on the welcome screen
  3. Specify the directory to which your RCP application was exported either by the Product Export Wizard or by an automated build process
  4. Go to the page Classpath and press the "Check consistency" button in the bottom pane

As analysis completes, the detailed report will be displayed in a separate dialog.

You may then inspect the problematic bundles and classes and get the report in text form.

Take care!

Feedback

Now you may perform the consistency checks using the GUI of the Excelsior JET product. We consider implementing a free Eclipse plug-in that provides the functionality. If you find it useful please send us your feedback. Your comments and suggestions are very welcome.

Rich client platform application Eclipse

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • Solving the Kubernetes Security Puzzle
  • mTLS Everywere
  • Stop Using Spring Profiles Per Environment

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: