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
BedrockMission!

Learn More

View all

Sign in to view all badges

How I can see my service in Felix console

Avatar

Avatar
Contributor 2
Level 4
AdobeID24
Level 4

Likes

54 likes

Total Posts

153 posts

Correct Reply

1 solution
Top badges earned
Contributor 2
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Contributor 2
Level 4
AdobeID24
Level 4

Likes

54 likes

Total Posts

153 posts

Correct Reply

1 solution
Top badges earned
Contributor 2
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
AdobeID24
Level 4

27-09-2018

I am able to see my bundle in aem felix console but I want to see my service HelloServiceImpl I am not able to find ..

1580771_pastedImage_6.png

Develop.java(This is my consumer class who will consume my services)

=====================================================================================================

package amitsample.core.filters;

import com.adobe.cq.sightly.WCMUse;

import amitsample.core.filters.HelloService;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

public class Develope extends WCMUse {

                Logger logger = LoggerFactory.getLogger(Develope.class);

             protected String details;

                @Override

                  public void activate() throws Exception {

  HelloService serv= getSlingScriptHelper().getService(HelloService.class);

details=serv.getRepositoryName();

logger.info("this is the first log values");

}

                   public String getDetails() {

                                    return details;

                  }

               

  1. HelloService.java(This is my interface ,I have made this because service must implement at least one service)

=====================================================================================================

package amitsample.core.filters;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

/**

* A simple service interface

*/

public interface HelloService{

   

      

    /**

     * @return the name of the underlying JCR repository implementation

     */

    public String getRepositoryName();

}

  1. HelloServiceImpl .java(This is my service )

=====================================================================================================

package amitsample.core.filters;

import javax.jcr.Repository;

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

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

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

import org.apache.sling.jcr.api.SlingRepository;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

@Service

@Component(immediate = true)

public class HelloServiceImpl implements HelloService {

                Logger logger = LoggerFactory.getLogger(HelloServiceImpl.class);

               

   

    @Reference

    private SlingRepository repository;

    public String getRepositoryName() {

               

                logger.info("this is the first log values inside Helloserviceimp class");

        return repository.getDescriptor(Repository.REP_NAME_DESC);

    }

}

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,223 posts

Correct Reply

915 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,223 posts

Correct Reply

915 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

27-09-2018

Hi,

Can you check if is it registered as service or component? your service should be listed at above url.

Check http://localhost:4502/system/console/components

Avatar

Avatar
Contributor 2
Level 4
AdobeID24
Level 4

Likes

54 likes

Total Posts

153 posts

Correct Reply

1 solution
Top badges earned
Contributor 2
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Contributor 2
Level 4
AdobeID24
Level 4

Likes

54 likes

Total Posts

153 posts

Correct Reply

1 solution
Top badges earned
Contributor 2
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
AdobeID24
Level 4

27-09-2018

Thanks my bundle was in Installed status ....I didn't notice

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

27-09-2018

I wonder why it is listed as service. It's only a component, but not a service.

You are using the Felix SCR annotations, which means that you need to use both @Component and @Service; if you switch to the OSGI components, @Comonent is sufficient.

Jörg

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,223 posts

Correct Reply

915 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,346 likes

Total Posts

3,223 posts

Correct Reply

915 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

27-09-2018

Hi Jorg,

He is using Felix annotation and used service annotation as well thats why it should be listed as service. Initially I was also confused then I saw service annotation just below imports

import org.slf4j.LoggerFactory;

@Service

@Component(immediate = true)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

27-09-2018

Ah, sorry, overlooked the @Service (bad formatting).

Jörg