Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox fails to find type in bundle(Trying to create Bundles for RestEasy)
Equinox fails to find type in bundle [message #760127] Thu, 01 December 2011 12:05
Seref Arikan is currently offline Seref ArikanFriend
Messages: 73
Registered: August 2010
This is going to be a long post, but I'm really running out of ideas here, so your input would really help me.

I've been trying to get a bundle in Equinox communicate with the outside world through RestEasy based web services. I already have a web project that uses RestEasy, and I can do alot by moving it to OSGI.

I've tried almost everything to turn RestEasy jars into bundles and deploy them to Equinox running under Tomcat 6. I'm using the bridge.jar from Server side Equinox, which seems to be dated 2007. The bridge.jar works OK, and simple examples that use servlets etc also work fine.

My problem starts when I try to use RestEasy. I have set my target platform to the Tomcat directory (webapps/bridge/web-inf/eclipse-plugins) and Eclipse environment has no trouble with this setup. I have created a test plugin that is supposed to instantiate an instance of the problematic type. Eclipse does not complain about the following snippet from the Activator of my test plugin:

public void start(BundleContext context) throws Exception {
		System.out.println("Hello World!!");
		DataSourceProvider dp = new DataSourceProvider();
		System.out.println("dprovider instance created!!");

Previously I had issues with an error that complained about access rules and did not allow access to DataSourceProvider, but a setup from scratch fixed that.

The DataSourceProvider is in another bundle, created from a RestEasy jar. I have followed the following method for all resteasy jars (that are used by the working web project)

1) Choose create new plugin from existing jar in Eclipse wizard
2) Choose a single jar
3) Check Analyze library contents and add dependencies
4)Choose "an osgi framework" as target platform and choose Standard as osgi framework
5) create bundle
6)export it to Tomcat/webapp/bridge/...

When I start Tomcat, osgi is loaded, and ss gives me RESOLVED status for all the bundles I've deployed.

If I start only my test bundle, I get a class not found exception about a type which is in one of the bundles. If I start all resteasy jar based bundles before I start my test bundle, then I get the following exception for the snippet above:

java.lang.NoClassDefFoundError: org/jboss/resteasy/plugins/providers/DataSourceProvider
	at restez_osgi_tests.Activator.start(
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$
	at Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(
	at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(
	at Source)

This is not the whole text, but it is a repetition of this particular exception.

I really can't figure out what is wrong here. I can't even think of a way of debugging the problem.
My resteasy based bundles has imported packages filled automatically, and they seem to be exporting all the namespaces they have.

I would really appreciate your input, since I've spent 3 days for this, and I am out of ideas.

Best regards

Previous Topic: Eclipse 3.7 RCP Update with p2
Next Topic:how to get osgi.framework.extensions property
Goto Forum:

Current Time: Wed Oct 20 11:27:41 GMT 2021

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

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

Back to the top