Skip to main content



      Home
Home » Eclipse Projects » Equinox » Using Swing from stand-alone Equinox
Using Swing from stand-alone Equinox [message #96394] Mon, 03 September 2007 05:53 Go to next message
Eclipse UserFriend
Originally posted by: anastaso.iese.fhg.de

Hello,
I am using Equinox in the stand-alone mode according to the Quickstart
instructions in http://www.eclipse.org/equinox/documents/quickstart.php.

That is I am starting Equinox from the command line like this:
java -jar org.eclipse.osgi_3.3.0.v20070530.jar -console

However when starting a bundle that requires javax.swing I get a Classpath
exception:
java.lang.NoClassDefFoundError: javax/swing/JPanel

It seems that Swing is not in the classpath although it is part of the basic
Java library (rt.jar).

Any hints or comments?

Thanks in advance,
Michalis
Re: Using Swing from stand-alone Equinox [message #96425 is a reply to message #96394] Mon, 03 September 2007 07:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

The OSGi bundle only exports the java.* packages automatically; you'll need to have Import-Package: javax.swing in order to make this work. Do you have that in your manifest?

Alex.
Re: Using Swing from stand-alone Equinox [message #96440 is a reply to message #96425] Mon, 03 September 2007 08:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anastaso.iese.fhg.de

Hello,

> The OSGi bundle only exports the java.* packages automatically

I am not sure about that because when I list the exported services of the
system bundle I see following entry:
javax.swing; version="0.0.0"[exported]

>you'll need to have Import-Package: javax.swing in order to make this work.
>Do you have that in your manifest?

I tried that too, however the statement "Import-Package: javax.swing" seems
to get ignored. When I list the imported services of my bundle the
javax.swing package does not appear there.

By the way: I tried the same same with the eRCP distribution and there it
works. The bundle requiring Swing starts its UI without problems. The import
statement is not necessary.

Regards,
Michalis
Re: Using Swing from stand-alone Equinox [message #96453 is a reply to message #96440] Mon, 03 September 2007 10:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

There's a difference between a 'service' and a 'package'. So it wouldn't show up on any imported/exported services. You'd still need the import to make it work.

In addition, other sub-packages that you might need would need to be imported too, such as javax.swing.event.

Alex.
Re: Using Swing from stand-alone Equinox [message #96482 is a reply to message #96453] Tue, 04 September 2007 03:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anastaso.iese.fhg.de

I imported all javax.swing packages in the manifest.mf, nevertheless the
problem continues,
I still get an NoClassDefFoundError javax/swing/JPanel
I am wondering why this works with eRCP even without the import statements.
Re: Using Swing from stand-alone Equinox [message #96496 is a reply to message #96482] Tue, 04 September 2007 04:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

In 3.3, the default parent classloader mechanism was changed slightly from 3.2. It may be that eRCP still uses the 3.2 way.

If you add 'Require-Bundle: system.bundle' in your plugin, do you still get the same behaviour?

It's quite likely that the problem is finding dependent classes on JPanel, rather than not being able to see JPanel. There may be some com/sun classes that can't be loaded.

http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/porting/3.3/incompatibilities.html#BootDelegation

Alex.
Re: Using Swing from stand-alone Equinox [message #96511 is a reply to message #96496] Tue, 04 September 2007 05:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anastaso.iese.fhg.de

The entry
org.osgi.framework.bootdelegation=*
solved the problem.
The 'Require-Bundle: system.bundle' statement did not help

Thanks a lot
Michalis
Re: Using Swing from stand-alone Equinox [message #97725 is a reply to message #96511] Wed, 19 September 2007 17:06 Go to previous message
Eclipse UserFriend
Michail Anastasopoulos wrote:
> The entry
> org.osgi.framework.bootdelegation=*
> solved the problem.
> The 'Require-Bundle: system.bundle' statement did not help
>
> Thanks a lot
> Michalis
>
>
Do you have a simple example you can provide to reproduce? If so please
open a bug report against Equinox->Framework. Using Import-Package
should work.

Tom.
Previous Topic:Two bundles exporting javax.transaction
Next Topic:Bundle location reported in console
Goto Forum:
  


Current Time: Fri Jul 18 08:59:51 EDT 2025

Powered by FUDForum. Page generated in 0.05690 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top