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

Using Spring Annotations in a Custom Service Component

timrc116
Level 1
Level 1

I am trying to use Spring Annotations in a custom component, but my beans with annotations are not found.  I am define a service factory class in my component.xml wich extends com.adobe.idp.dsc.component.support.AbstractServiceInstanceFactory.

<component xmlns="http://adobe.com/idp/dsc/component/document">

   ...

  <service-factory-class>

     ....spring.SpringServiceFactory

  </service-factory-class>

  <lifecycle-class>

  </lifecycle-class>

  <search-order>

     PARENT_LAST

  </search-order></component>

In the getBeanFactory method I create an org.springframework.context.annotation.AnnotationConfigApplicationContext and set the base package and scan.  The problem is none of my bean are in the the returned  bean factory.  I have tried setting the classloader to the ServiceConfiguration classloader but that did not help either.

Does anyone know to do this?

Thanks

-Timc

0 Replies