Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

OSGI is not invoking implemented code

Avatar

Level 3

HI All,

I have created an new OSGI service XCreateCatalogCommand which implements PIM (cq-commerce-pim) com.day.cq.wcm.api.commands.WCMCommand interace. I have given top ranking for the service . Eventhough the API code is getting invoked instead of newly implemented service when i tried to do an rollout.

To test this i tried disabling the OSGI component com.adobe.cq.commerce.pim.impl.cataloggenerator.CreateCatalogCommand and my newly implement code got invoked when i did an rollout.

i am not sure what i am missing in code. i am pasting below the OSGI annotations written . let me know how to fix this issue

@Component(label = "Hybris Catalog Command", description = "Overrides the default Catalog Rollout", metatype = true)
@Service(WCMCommand.class)
@Properties({
@Property(name = "service.description", value = { "WCM command which creates a product catalog" }),
@Property(label="Service Ranking", name = "service.ranking", intValue = 1200, description = "Service Ranking", propertyPrivate = false)})

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

HI,

first of all, you do not specify which command you want to overlay, therefor your servlet is never picked up. And secondly, the WcmCommands are not supposed to get replaced/overlayed (at least from a coding point of view), as it does not support service rankings.

kind regards,
Jörg

View solution in original post

2 Replies

Avatar

Employee Advisor

Could you please explain the use case you are trying to implement ?

Avatar

Correct answer by
Employee Advisor

HI,

first of all, you do not specify which command you want to overlay, therefor your servlet is never picked up. And secondly, the WcmCommands are not supposed to get replaced/overlayed (at least from a coding point of view), as it does not support service rankings.

kind regards,
Jörg