OSGI srvice is not getting registered | Community
Skip to main content
Level 2
Jun 6, 2017 7:02 AM UTC
Solved

OSGI srvice is not getting registered

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.
shubham250894Accepted solution
Level 2
Jun 7, 2017 10:57 AM UTC

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
Employee
Jun 7, 2017 12:24 PM UTC

Can you mark the issue as fixed?

Glad it was just a small thing.

Translate
Level 2
Jun 7, 2017 10:59 AM UTC

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

Translate
shubham250894AuthorAccepted solution
Level 2
Jun 7, 2017 10:57 AM UTC

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

Translate
Feike_Visser1
Employee
Jun 7, 2017 10:55 AM UTC

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?

Translate
Level 2
Jun 7, 2017 10:52 AM UTC

Yes there is no MyServiceImpl but Why ?

Translate
Feike_Visser1
Employee
Jun 7, 2017 10:44 AM UTC

Also I don't see "MyServiceImpl" in this list.

Translate
Feike_Visser1
Employee
Jun 7, 2017 10:43 AM UTC

What do you see when you open the details?

Translate
Level 2
Jun 7, 2017 6:55 AM UTC

Translate
Level 2
Jun 7, 2017 6:50 AM UTC

yeah the service is null

Translate
Feike_Visser1
Employee
Jun 7, 2017 6:50 AM UTC

Also check in /system/console/components and see for more info there.

Translate