Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

OSGI srvice is not getting registered

Avatar

Level 3

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");

  }

}

1 Accepted Solution

Avatar

Correct answer by
Level 3

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

import.PNG

View solution in original post

24 Replies

Avatar

Employee

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?

Avatar

Correct answer by
Level 3

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

import.PNG

Avatar

Level 3

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

Avatar

Employee

Can you mark the issue as fixed?

Glad it was just a small thing.