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

New CommerceFactory not registering as a Service in OSGI

Avatar

Level 5

I'm trying to add a new commerce provider to an empty AEM project created from the Maven Archtype version 11.

My Core bundle installs just fine but the commerceFactory does not register in OSGI as a service, the exact same class in my existing project (created with Archtype 10 but also is an existing project so numerous changes to the POM etc have been done) works just fine.

Any help would be appreciated, code below:

@Component
@Service
@Properties(value = {
   @Property(name = "service.description", value = "Factory implementation for FooCommerceServiceFactory"),
   @Property(name = "commerceProvider", value = "foo", propertyPrivate = true)
})
public class FooCommerceServiceFactory extends AbstractJcrCommerceServiceFactory implements CommerceServiceFactory {
  

public CommerceService getCommerceService(final Resource res) {
   return new FooCommerceServiceImpl(getServiceContext(), res);
   }
}

1 Accepted Solution

Avatar

Correct answer by
Level 10

See this community article that bsloki​ helped with:

Scott's Digital Community: Creating custom Adobe Experience Manager 6.2 ecommerce providers

Also - here is an Ask the AEM Community Session on this:

Scott's Digital Community: Working with AEM eCommerce - August 2016 Session of Ask the AEM Community...

Yes - i love the performance of this new community. Its hundreds of times faster!

View solution in original post

5 Replies

Avatar

Level 5

PS the new forum is a great improvement!

Avatar

Correct answer by
Level 10

See this community article that bsloki​ helped with:

Scott's Digital Community: Creating custom Adobe Experience Manager 6.2 ecommerce providers

Also - here is an Ask the AEM Community Session on this:

Scott's Digital Community: Working with AEM eCommerce - August 2016 Session of Ask the AEM Community...

Yes - i love the performance of this new community. Its hundreds of times faster!

Avatar

Level 8

Hi,

Not pretty sure, but few observations :

1] (metatype = true, label = "label") Can you try adding this with the component annotation and see of it helps. Everything else looks ok.

2] Also, can you please post a snippet of FooCommerceServiceImpl. It should "extends AbstractJcrCommerceService implements CommerceService" 

Avatar

Level 5

I've had to pause this for the time being and just include the code in our main "Site" project rather than split it out as I wanted due to time constraints. I was trying to also use Cognifide Slice as well which might be causing some issues. Hopefully I can get some time to revisit this.

Avatar

Level 1

Hi,

Could you be able to resolve the issue?

I am also facing the same problem while creating a new commerce provider.

New CommerceFactory not registering as a Service in Web Console Services

Thanks,

Suswan