Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

OSGI srvice is not getting registered

Avatar

Level 2

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 2

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

0 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 2

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 2

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.