OSGI srvice is not getting registered | Community
Skip to main content
New Participant
June 6, 2017
Solved

OSGI srvice is not getting registered

  • June 6, 2017
  • 24 replies
  • 11333 views

Hi,

I am facing an issue i created a project of maven archType10 in eclipse and when i upload the bundle on felix console it does not show the service registered over there below is the code what i wrote and screenshot of the bundle on felix,

MyService.java (Interface)

package com.aem.community.core.services;

public interface MyService {

  public String helloWorld();

}

MyServiceImpl.java (class implementing Interface)

package com.aem.community.core.servicesImpl;

import org.apache.felix.scr.annotations.Service;

import com.aem.community.core.services.MyService;

import aQute.bnd.annotation.component.Component;

@Component(immediate=true)

@Service(value=MyService.class)

public class MyServiceImpl implements MyService {

  @Override

  public String helloWorld() {

  return ("Hello");

  }

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by shubham250894

I made the blunder there is issue with the highlighted import i changed it to

import org.apache.felix.scr.annotations.Component;

and it works fine. Thanks for the help everyone

24 replies

New Participant
June 6, 2017

I can only see the below services,

the service i created is not there, hence it is giving null pointer exception

Feike_Visser1
Employee
June 6, 2017

Is your bundle started?

Can you go to services in the OSGi console, and see if you have more info there?

cquser1
New Participant
June 6, 2017

Hi,

Not pretty sure, but can you just try with "@Service({MyService.class})" instead of @Service(value=MyService.class) and see if it helps.

New Participant
June 6, 2017

sorry , here is the bundle screenshot, JSP screenshot and null pointer exception

JSP

Exception

,

Bundle