4 Replies Latest reply on Mar 8, 2012 6:39 AM by sivarenati

    Getting "Cannot start bundle" error while starting the jboss7.0 server

    sivarenati

      Hi Guys,

       

           i am getitng the below error while starting the jboss server.i am using org.eclipse.osgi_3.3.2.R33x_v20080105.jar  and my jboss server having org.osgi.compendium-4.2.0.jar internally.

       

      10:07:36,551 ERROR [org.jboss.as.osgi] (MSC service thread 1-6) Cannot start bundle: org.eclipse.osgi:3.3.2.R33x_v20080105: org.osgi.framework.BundleExcepti

      on: org.eclipse.osgi.framework.internal.core.SystemBundleActivator is not an implementation of org.osgi.framework.BundleActivator

              at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:297)

              at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:221)

              at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)

              at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:146)

              at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:121)

              at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1442)

              at org.jboss.msc.service.ServiceControllerImpl.access$2500(ServiceControllerImpl.java:49)

              at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1940)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_17]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_17]

              at java.lang.Thread.run(Unknown Source) [:1.6.0_17]

       

      Please help me on this.

       

       

      Thanks

      Siva Renati

        • 1. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
          thomas.diesler

          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

            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.

            • 3. Re: Getting "Cannot start bundle" error while starting the jboss7.0 server
              thomas.diesler

              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

                ok Thomas. thanks for the quick reply.