-
1. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
thomas.diesler Mar 8, 2012 3:22 AM (in response to sivarenati)It seems that you are trying to bootstrap the equinox framework inside the jboss framework.
What is this supposed to do?
-
2. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
sivarenati Mar 8, 2012 4:27 AM (in response to thomas.diesler)Hi Thomas,
Thanks for the reply.
I suppose to do the following task.
1. I have to install 2 bundles
2. I have one service interface in first bundle and i am accessing that service from servlet which is there in the second bundle.Find the snippet of code below
import sample.http.SimpleService;
private SimpleService service ;
public HttpServiceTracker(BundleContext context,SimpleService service) {
super(context, HttpService.class.getName(), null);
this.service = service;
System.out.println(" service HttpServiceTracker() ---------->"+service);
}
public Object addingService(ServiceReference reference) {
HttpService httpService = (HttpService) context.getService(reference);
try {
System.out.println(" service addingService() ---------->"+service);
httpService.registerServlet("/helloworld2", new HelloWorldServlet(service), null, null); //$NON-NLS-1$
} catch (Exception e) {
e.printStackTrace();
}
return httpService;
}
3.I am getting NullpointerException when i try to call Service method in the first bundle.It is not refering the ServiceTracker class which is there in the org.osgi.compendium-4.2.0.jar.
4.As the ServiceTracker is also availabe in the org.eclipse.osgi_3.2.2.R32x_v20070118.jar file, i am trying to place this jar in the Jboss.
5.When i start the server i m getting the above error.
please find the attached jars (bundles) for ur reference.
-
sample.http2_1.0.0.jar 6.1 KB
-
sample.http_1.0.0.jar 3.8 KB
-
-
3. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
thomas.diesler Mar 8, 2012 6:33 AM (in response to sivarenati)The OSGi core APIs (including ServiceTracker) are already available in AS7. You do not need to install additional bundles for those APIs.
Have a look at the JavaEE integration example. It shows how to access an OSGi service from a web app.
The code is here.
-
4. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
sivarenati Mar 8, 2012 6:39 AM (in response to thomas.diesler)ok Thomas. thanks for the quick reply.