To find all the bundles needed by your imports you can follow these simple steps:
Step 1: Open the MANIFEST-MF of your bundle
Step 2: Go to the Dependencies tab
Step 3: Add the packages you need (if you do not already have them)
Step 4: Save the changes
Step 5: Go to Dependency Analysis and chose the hierarchy view
Step 6: Browse the hierarchical list of all dependencies
Step 7: To remove the duplicates use the Flat Layout
Please have in mind that this approach will work only for bundles that are in your Eclipse distribution or in your currently active target platform.
Monday, April 04, 2011
Monday, March 07, 2011
Git Notifier on Windows
Git Notifier is a tool that can keep you up to date with what's going on in a Git repository. Unfortunately it seems that it's only for MacOS. Until this evening...
...when I decided to give Google a try and searched for Growl without removing Windows from my previous search. It turned out that Growl has Windows port so the task of having notifications for Git commits on my desktop moved from the dusty "nearly impossible" corner in my mind to "doable".
So I installed:
The next big step was to download Git Notifier just to find out that it utilized RubyGem. Cygwin does not provide Gem so I had to install it manually. An easy task as it turned out:
- Download RubyGem
- Install it using "ruby setup.rb" as described in RubyGems User Guide
Now that I had RubyGem I went straight to installing the Notifier.
gem install git-notifier --source http://gemcutter.org
Starting Git Notifier however turned out unsuccessful since this tool brings several dependencies:
- ruby-growl
- growl
- daemons
Simply installing the dependencies did the trick:
gem install ruby-growl growl daemons
The rest is up to you. A good start would be to autostart Growl as well as git-notifier :)
Monday, January 31, 2011
At last usable Equinox console
Eclipse Virgo recieved a brand new contribution that improves the usability of the Equinox console. The contribution is especially useful when connecting via telnet.
Thanks to Lazar Kirchev now Virgo has:
- line editing
- command history
- tab completion
- grep for telnet
Up to now the console port was bound to both localhost and the external IP. Therefore it was possible to just about everyone to connect to the console.
To address this issue the syntax of the osgi.console property has been extended and now you can add as well the host or address in org.eclipse.virgo.kernel.userregion.properties:
osgi.console=localhost:2401
What's more is that the telnet protocol allows negotiation between the client and the server. Taking advantage of this now there is a way for Virgo to understand which are the exact key bindings used on the client. This basically means that Virgo server running on Windows for example, can handle properly MacOS or Unix clients.
The new features can be used not only in Virgo, but also in every product using Equinox 3.7:
Virgo (3.0.0 M1)
- Download Virgo from here
- Enable the console as described in the User guide
- Start Virgo
- Connect with telnet to port 2401
Eclipse 3.7
To use the new features with Eclipse you simply need to drop the bundle in plugins and restart Eclipse.
Equinox 3.7
If you just want to try the new features you can use the install command.
If you have P2 enabled (or you like the bundle and want to keep it) you can drop the bundle in dropins and restart Equinox to enable P2 to pick up the bundle.
Wednesday, December 29, 2010
Troubleshooting class loading issues with Virgo
My colleague Diyan Yordanov outlined the class loading issues a web developer can face in his ESE 2010 talk "Migration of existing web applications to OSGi". The classification in the talk divided the class loading issues, based on the exceptions:
- ClassNotFoundException - missing class definition
- NoClassDefFoundError - class definition found, but instantiation failed
- ClassCastException - additional class copies
There is not much I can add, so I will reuse this classification to present the root causes we faced during our work on SAP NetWeave and the use of OSGi.
In the simple/standalone Java applications the classpath was the thing that determined the class loading and the way that we investigated what caused the exceptions above. The problems in this simple world were caused by:
- ClassNotFoundException
- Missing class definition (.class files)
- Too restrictive file system permissions
- NoClassDefFoundError
- Exceptions in static block
- Missing imported class
- Class version mismatch (class is compiled with incompatible JVM)
JEE was the next step in the evolution of the class loading problems :) With the JEE containers we introduced complicated class loading hierarchies. The root causes in this hierarchies were the same as with the simple applications, but we faced dependency (or "reference" in NetWeaver) problems as well . Fortunately (depends on the point of view) we didn't have the time to implement versioned dependencies and get ourselves into more troubles.
The last step was made when we found out that OSGi pretty much eases the development and the support of components. It featured its own class loading that had everything we could dream of (plus some things we didn't really know we wanted). One of the extra things that were missing in our JEE world were the imports and exports of packages. And this is the thing that introduces more root causes for class loading exceptions:
- ClassNotFoundException
- Missing package import or export
- Import version mismatch
- Wrong boot class delegation property
Most of the problems described so far can be solved by simply finding which bundle:
- contains a class
- exports a class
- can load a class
This is not an easy task in bare OSGi environment, but fortunately Virgo provides shell commands that will help you troubleshoot class loading issues by doing exactly the operations described above.The commands are:
- clhas - lists all bundles that contain a class
- clexport - lists all bundles that export a class or package
- clload - lists all bundles that can load a class
ClassNotFoundException can be solved by checking if:
- a bundle provides the class - clhas command
- the class is exported - clexport command
NoClassDefFoundError cause can be determined by:
- inspecting the logs for exception
- trying to load the class
The result from the second step depends on the parameters of clload command and can be:
- a list with bundles that can actually load the class
- confirmation that a bundle can/cannot load the class
The fact that the bundle can load the class now but was unable to do so when an exception was produced would probably mean that a dependency was missing at the time of the problem.
If the bundle cannot load a class, although it should be able to do so, means that there is some problem with the dependencies - most probably there is something wrong with the:
- imports of the bundle
- exported packages
You can check if the needed packages are exported with the help of the clexport command.
ClassCastException is almost always caused by duplicated class(es) in some bundle. You can check the bundles that contain the class in doubt with the clhas command.
Finally you can find some example usages of the commands in the latest build of Virgo's User Guide.
The commands should be available in the next release of Virgo (the current one being 2.1.0).
The commands should be available in the next release of Virgo (the current one being 2.1.0).
Sunday, June 25, 2006
Subscribe to:
Posts (Atom)
id_rsa.pub: invalid format, error in libcrypto
After I upgraded my Linux and got Python 3.10 by default, it turned out that Ansible 2.9 will no longer run and is unsupported together with...
-
My colleague Diyan Yordanov outlined the class loading issues a web developer can face in his ESE 2010 talk "Migration of existing web...
-
If you wanted to try your OSGi based applications in the cloud you can now do so with Eclipse Virgo and CloudFoundry using a VM image. Wh...
-
Git Notifier is a tool that can keep you up to date with what's going on in a Git repository. Unfortunately it seems that it's only...





