OSGi allows for having packages split across multiple bundles. This, together with a dropins mechanism, is a true mine field.
So, what's wrong with those split packages? They are split! OSGi, in some magic way, merges them during runtime, but does not see explicit dependency between bundles providing those packages.
The P2 reconciler app, using some Equinox service, refreshes all packages that have dependency changed. So, for example, if you install a bundle providing javax.xml into dropins, you'll have almost all plugins refreshed (depending on the dependency tree).
But, since bundles with split packages are not dependent on each other, you may end up in a not so much theoretical situation, were a bundle with one split package is refreshed, and the other is not. If they do depend on each other (f.e. one has an implementation, the other an interface) you will get a nice ClassCastExceptions or other, similar runtime errors.
Real Eclipse bug can be found in the Eclipse bugzilla.
Showing posts with label osgi. Show all posts
Showing posts with label osgi. Show all posts
Wednesday, April 24, 2013
Monday, April 22, 2013
DevCrowd'13 – share knowledge, share passion - impressions
I had a pleasure of participation in a conference called DevCrowd this weekend in Szczecin. And I must admit - I underestimated it, and got very, very surprised.
First of all, the conference, held at the Szczecin University of Technology was developer community organized, meaning there was no single, leading technology, solution, nor vendor. This resulted in a really mind-blowing mix of speakers that touched problems on the border of many spaces (technical, human and legal one) and made many people to think about what they do.
Let me mention two really noteworthy presentation fragments:
I realized apparently not so secret plan of OSGi and Fedora conquering the Java world and performed a brief introduction to it, and quite unexpectedly, found people who were really interested in migrating their applications.
I got totally convinced to small conferences, and I look forward next edition!
First of all, the conference, held at the Szczecin University of Technology was developer community organized, meaning there was no single, leading technology, solution, nor vendor. This resulted in a really mind-blowing mix of speakers that touched problems on the border of many spaces (technical, human and legal one) and made many people to think about what they do.
Let me mention two really noteworthy presentation fragments:
- Adam Dudczak, "6 things that you were not taught during studies" discussed, amongst other things, the problem of choosing 3rd party dependencies for use in your project. This was a very right call in the era of social coding, and clearly outlined the need for IP management for communities that want to share their code.
- There were two talks by Jarosław Ratajski and Grzegorz Godlewski, related to web programming. Those talks resonated in my mind because they were about Java developers finding themselves in the JavaScript world, and giving a really strong message, that despite Web is somewhat inferior to desktop, it needs superior developers. I guess Netscape was wrong by targeting JavaScript "to nonprofessional programmers".
I realized apparently not so secret plan of OSGi and Fedora conquering the Java world and performed a brief introduction to it, and quite unexpectedly, found people who were really interested in migrating their applications.
I got totally convinced to small conferences, and I look forward next edition!
Thursday, April 11, 2013
Maven groupId:artifactId and OSGi Bundle-SymbolicName - how they relate to each other?
OSGi massively coming to the maven world is a new trend, and is causing quite a big disturbance (at least to me).
First of all, as you already know, Fedora policies don't allow me to use binaries. Therefore Eclipse Orbit, a project that contains 3rd party Eclipse dependencies in the form of jars, is banned for me.
I witness that more and more open source jars support OSGi by default, but sometimes not exactly in the way I'd love to - especially if it comes to the naming schemes.
Let's look at the example of JDT core - the most widely used Eclipse jar. It was used as a maven dependency long before it received its official pom. As a result, it is available in Fedora with following aliases:
The artifactId for Eclipse should be a jar name, which in turn should follow Eclipse Naming conventions. The groupId should be a reverse domain name of the project, so in case of JDT, we would get org.eclipse.jdt, thus the final and proper groupId:artifactId of JDT core is org.eclipse.jdt:org.eclipse.jdt.core.
The real problem will appear if the project does not obey Maven guidelines, and has groupId:artifactId commons-logging:commons-logging or junit:junit. In that case applying OSGI guidelines will cause invalid Bundle-SymoblicNames: commons-logging and junit, which are against OSGi guidelines, although based on them.
In this situation it would be good to reconsider group and jar name changes to reflect the organization domain:
First of all, as you already know, Fedora policies don't allow me to use binaries. Therefore Eclipse Orbit, a project that contains 3rd party Eclipse dependencies in the form of jars, is banned for me.
I witness that more and more open source jars support OSGi by default, but sometimes not exactly in the way I'd love to - especially if it comes to the naming schemes.
Let's look at the example of JDT core - the most widely used Eclipse jar. It was used as a maven dependency long before it received its official pom. As a result, it is available in Fedora with following aliases:
org.eclipse:jdt.coreorg.eclipse.tycho:org.eclipse.jdt.coreorg.eclipse.jetty.orbit:org.eclipse.jdt.coreorg.eclipse.jdt:org.eclipse.jdt.core
A BSN often takes the form of a reverse domain name. If automatically generated via Maven Bundle Plugin, takes the formSo, in that case, we need to go the Maven Guide to Naming, and find out that:${pom.groupId}.${pom.artifactId}, or${pom.artifactId}if it already starts with${pom.groupId}.
groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. Look at More information about package names.and
artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed.
The artifactId for Eclipse should be a jar name, which in turn should follow Eclipse Naming conventions. The groupId should be a reverse domain name of the project, so in case of JDT, we would get org.eclipse.jdt, thus the final and proper groupId:artifactId of JDT core is org.eclipse.jdt:org.eclipse.jdt.core.
The real problem will appear if the project does not obey Maven guidelines, and has groupId:artifactId commons-logging:commons-logging or junit:junit. In that case applying OSGI guidelines will cause invalid Bundle-SymoblicNames: commons-logging and junit, which are against OSGi guidelines, although based on them.
In this situation it would be good to reconsider group and jar name changes to reflect the organization domain:
- org.apache.commons:logging (logging.jar shipped)
- org.junit:org.junit (org.junit.jar shipped).
Monday, January 7, 2013
far Orbit
I am not a biggest fan of Orbit project. I do, however, understand now, that it is needed due to the legal reasons, as it was stated in the comment to my blogpost nearly a year ago:
The biggest fear I have is that Orbit version of projects is isolated. They get OSGi Manifests, sometimes version number that is different from what is in the original, and sometimes even different name.
All those things does not make adoption and updates easy. There is practically no way to build Eclipse with newer version of a particular library and use it for testing.
So here is my proposition - let's contribute OSGi manifests or even entire packaging back to their providers. They don't always know/care about OSGi, but they rarely object such changes.
This will make the process of new version adoption easier, because testing/3rd party products could use newer version of libraries which is not yet present in the Orbit without taking the effort to build it them themselves.
Of course, I'm not demanding everyone to do it right now, but please, give it a thought before submitting a new [version of] Orbit bundle.
We should be removing the border between Eclipse and the rest of world.
Happy bundling!
- The 3rd party libs have been vetted for IP,
- they have been turned into OSGi bundles so they can be used
- they are available from a p2 repo so they can be consumed by PDE builds
The biggest fear I have is that Orbit version of projects is isolated. They get OSGi Manifests, sometimes version number that is different from what is in the original, and sometimes even different name.
All those things does not make adoption and updates easy. There is practically no way to build Eclipse with newer version of a particular library and use it for testing.
So here is my proposition - let's contribute OSGi manifests or even entire packaging back to their providers. They don't always know/care about OSGi, but they rarely object such changes.
This will make the process of new version adoption easier, because testing/3rd party products could use newer version of libraries which is not yet present in the Orbit without taking the effort to build it them themselves.
Of course, I'm not demanding everyone to do it right now, but please, give it a thought before submitting a new [version of] Orbit bundle.
We should be removing the border between Eclipse and the rest of world.
Happy bundling!
Subscribe to:
Posts (Atom)
