Cannot attach a fragment to the system bundle. [message #130030] |
Wed, 29 April 2009 03:04  |
Eclipse User |
|
|
|
Originally posted by: janthomae.janthomae.de
Hi,
some ages ago, Tom Wilson posted an article to this newsgroup,
explaining, that the recommended way to get access to packages on the
classpath is to create a fragment bundle, let it export the required
packages and attach it to the system.bundle (Original post was:
http://dev.eclipse.org/newslists/news.eclipse.technology.equ inox/msg03760.html).
This should be preferred over using a * in the bootdelegation property.
I did the exact thing, i created a bundle with the follwing manifest:
Manifest-Version: 1.0.0
Bundle-ManifestVersion: 2
Bundle-Version: 1.0.0
Bundle-SymbolicName: de.insomniahq.peroxidej.system
Fragment-Host: system.bundle
Bundle-Version: 1.0
Export-Package: com.sun.java.swing.plaf.windows,javax.swing,apple.laf
Now when i start that bundle up in Equinox, it goes into installed
state, but is not attached to the system.bundle:
bundle 19
initial@file://Users/kork/devel/java/peroxIDE-J/classes/prod uction/peroxIDE-system.jar
[19]
Id=19, Status=INSTALLED Data
Root=/Users/kork/Library/Caches/IntelliJIDEA8x/osmorc/runtmp 1240988474979/fwDir/org.eclipse.osgi/bundles/19/data
No registered services.
No services in use.
Exported packages
com.sun.java.swing.plaf.windows; version="0.0.0"[exported]
javax.swing; version="0.0.0"[exported]
apple.laf; version="0.0.0"[exported]
No imported packages
No host bundles
No named class spaces
No required bundles
Therefore, my exports do not work, and my Swing GUI is not firing up
because the apple.laf-packages are not visible to it.
So I got basically these questions:
- Is using the fragment bundle still the preferred approach to this problem?
- If so, what did I do wrong?
- If not, what is the preferred approach to run a Swing application
within Equinox (and it would be nice if it worked in other OSGi
containers as well)?
Thank you.
Best regards,
Jan Thomä
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Cannot attach a fragment to the system bundle. [message #131080 is a reply to message #130030] |
Mon, 11 May 2009 11:54  |
Eclipse User |
|
|
|
Originally posted by: janthomae.janthomae.de
Hi again,
and thanks for all the help so far.
I found out what is actually causing the issue. The issue occurs, when
I install two different versions of the slf4j-api bundle at the same
time:
com.springsource.slf4j.api-1.5.6.jar - from the SpringSource maven repo
slf4j-api-1.5.0.jar - from the public maven repo
Additionally you need to install these, so the bundles actually resolve:
com.springsource.org.apache.log4j-1.2.15.jar - from the SpringSource maven repo
com.springsource.slf4j.log4j-1.5.6.jar - from the SpringSource maven repo
If the bundles do not resolve, then attaching my bundle (which can be
downloaded at
http://kork.insomnia-hq.de/public/de.insomniahq.peroxidej.sy stem_1.0.0v0.jar)
to the system bundle works. Once both slf4j-api bundles are installed
and resolved, my fragment will no longer attach to the system bundle.
Not on refresh, not on restart, never. I am not an OSGi guru, but that
doesn't sound like correct behaviour to me. Attaching to the system
bundle should work no matter what other bundles are installed. Could
someone please confirm this? I would file a bug report against equinox
then.
Best regards,
Jan
|
|
|
Powered by
FUDForum. Page generated in 0.04081 seconds