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

OSGI srvice is not getting registered

  • June 6, 2017
  • 24 replies
  • 11338 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

Feike_Visser1
Adobe Employee
Adobe Employee
June 7, 2017

that is the issue, if it would be in the list you can use it.

When you open your bundle in /system/console/bundles, what do you see?

shubham250894AuthorAccepted solution
Level 2
June 7, 2017

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

Level 2
June 7, 2017

Thanks Feike, I hope you would not mind to help me in future also

with your help, i am able to figure out the issue , Thanks alot

Feike_Visser1
Adobe Employee
Adobe Employee
June 7, 2017

Can you mark the issue as fixed?

Glad it was just a small thing.