[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Trivial OSGi bundle won't run outisde of the IDE (workaround)

I found a workaround ... if you specify -Dosgi.compatibility.bootdelegation=true on the command line, it works. From the bugzillas I found, I'm not sure this is a proper solution.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=162231
https://bugs.eclipse.org/bugs/show_bug.cgi?id=29007

Bryan

On 2007-06-29 19:09:54 -0500, Bryan Hunt <bhunt@xxxxxxx> said:

I've debugged a problem with my application into the trivial example below. I have created an osgi bundle that runs just fine under the Eclipse IDE, but fails to run when exported and installed in an osgi framework. When running in the IDE, I create an OSGi launch configuration that includes my bundle along with org.eclipse.osgi. When I run outside the IDE, I use the following commands:

java -jar org.eclipse.osgi_3.3.0.v20070530.jar -console

osgi> install file:test_1.0.0.jar
Bundle id is 1
osgi> start 1
Starting test ... Failed - java.lang.NoClassDefFoundError: sun/io/ByteToCharASCII



Any ideas would be greatly appreciated. This problem is currently gating my production code.


Bryan


package test;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import sun.io.ByteToCharASCII;

public class Activator implements BundleActivator
{
	public void start(BundleContext context) throws Exception
	{
		System.out.print("Starting test ... ");
		
		try
		{
			new ByteToCharASCII();
			System.out.println("Passed");
		}
		catch (Throwable e)
		{
			System.out.println("Failed - " + e);
		}
	}

	public void stop(BundleContext context) throws Exception
	{}
}