[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] ClassNotFoundException with sun.misc package
- From: njbartlett@xxxxxxxxx
- Date: Thu, 22 May 2008 12:50:57 +0100
- Delivered-to: email@example.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=J3k4ON5uipOxYGVliKnXDneCnsoIyn3GAhJjHYfdlrE=; b=n4Qorwe/Ftp9amSeSCVflVd5buHuYP+zh+WQi9tr9opTqeYKsdef1LMpE+raqPV+fys0D+54rgoRnAUgNjBn7+/5YIbhWHHjvlb1+0cPPBEmhiBAvFiSsgj5a09TJz2yzSXhUc34XLP9kE5EDmMkV2WHLpm8jKDK57660KdbgU4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EnowVKXERN9WUmKvL+YkmbIJ+IYASfQYvd7TOTzjZ6sgKiAZzUOaJRRFpxfUJVfxzJ+yfWZtebNTLVxIXaA8hppZ9iGFFEUPblO9YRFUZCRscHOe7ZXbnk9cuSbRLUKLZI5NPHvu2gGaxEDc/fNAyNLCeBfUcLd4qgP36kmEtSE=
The only packages from rt.jar that are automatically available to you
are the ones beginning with "java.". All others, including javax.*,
org.w3c, etc must be imported using a normal Import-Package statement.
All of the standard rt.jar packages (such as javax.*) are exported by
the System Bundle, so your Import will resolve against that. However
the sun.misc package is non-standard so not exported by the System
The best way to resolve this problem is to NOT USE sun.misc, since
that will make your bundle run only on Sun JVMs! There are Base64
encoders available in other libraries, such as Apache Commons Codec.
If you really cannot avoid using the sun.misc package, then you can
add it to the org.osgi.framework.system.packages property, so the
System Bundle exports it.
On 5/22/08, Srijith Kochunni <ksrijith@xxxxxxxxxx> wrote:
> Hi All,
> I have a bundle in which i am using sun.misc.BASE64Encoder. However
> when I start my bundle I get a ClassNotFound Exception. I see that the
> sun.misc packages are part of rt.jar and thus am expecting that they should
> be available in the runtime. The exception i get only when I run standalone
> java -jar org.eclipse.osgi_3.2.0.jar -console
> However when I run through eclipse or eclipse.exe using the steps mentioned
> in http://www.eclipse.org/equinox/documents/quickstart.php I do not see this
> I did a getprop on org.osgi.framework.system.packages, but sun.misc is not
> part of it. I`m not sure of what i`m missing and how i must rectify this.
> Any help in this regard would be greatly appreciated.
> P.S: Have also attached the stack trace for the same.