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 Arikan
Messages: 61
Registered: August 2010
Member
Greetings,
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(Activator.java:17)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
	at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:260)
	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(FrameworkCommandInterpreter.java:145)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:294)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:279)
	at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:214)
	at java.lang.Thread.run(Unknown 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
Seref



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


Current Time: Wed Oct 01 16:21:21 GMT 2014

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

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