Posts

Showing posts from January, 2012

OSGI commons-logging blues

I read that OSGI plugins is difficult to build because of the isolation built into the plugin ecosystem. But only recently I found out that it is really troublesome, tooks me a lot of time to figure these out: - Import-Package clause in the plugin could import already loaded classes in the main application onto the plugin. But the precondition is that the main application must already register the already loaded class packages (Java packages, not maven artifactId) onto the plugin ecosystem. - Imported classes could refer to other classes. Runtime exception could occur unless the other class packages already registered by the main application (ex. in the Felix configuration map) (or exported by other plugin) AND the other class packages is imported in one of the Import-Package clause. - The Apache commons-logging library is very much not compatible with OSGI In my case, My plugin has a spring-jdbc library dependency. At first I OSGI-imported spring packages from the main application,