Expand my Community achievements bar.

SOLVED

How to use Spring bean injection with session scope in AEM/CQ 5.6.1

Avatar

Level 1

I put following jars into a package an installed into AEM standalone (jar) instance, then created a SpringTestBundle with applicationContext.xml file in [SpringTestBundle]\src\main\resources\META-INF\spring folder. Spring bean injection works, but only for singleton scope. Then I created AEM war instance in Tomcat 7 and added org.springframework.web.context.request.RequestContextListener in AEM war web.xml. The following jar was put into new created lib sub folder. My previous Spring test bundle still report "No Scope registered for scope 'session' " error. I don't think my current approach is correct? Could someone let me know how should I get Spring injection with session and request scope work?

com.adobe.fmeschbe.blueprint.client-0.0.1-SNAPSHOT.jar
com.adobe.fmeschbe.blueprint.service-0.0.1-SNAPSHOT.jar
gemini-blueprint-core-1.0.2.RELEASE
gemini-blueprint-core-1.0.2.RELEASE.jar
gemini-blueprint-extender-1.0.2.RELEASE
gemini-blueprint-extender-1.0.2.RELEASE.jar
gemini-blueprint-io-1.0.2.RELEASE.jar
org.apache.servicemix.bundles.aopalliance-1.0_6.jar
org.apache.servicemix.bundles.spring-aop-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-aop-3.2.8.RELEASE_1.jar
org.apache.servicemix.bundles.spring-beans-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-beans-3.2.8.RELEASE_1.jar
org.apache.servicemix.bundles.spring-context-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-context-3.2.8.RELEASE_1.jar
org.apache.servicemix.bundles.spring-core-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-core-3.2.8.RELEASE_1.jar
org.apache.servicemix.bundles.spring-expression-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-expression-3.2.8.RELEASE_1.jar
org.apache.servicemix.bundles.spring-web-3.2.8.RELEASE_1
org.apache.servicemix.bundles.spring-web-3.2.8.RELEASE_1.jar

1 Accepted Solution

Avatar

Correct answer by
Level 10

This is not a common use case and would require  customization to get AEM to work with the Spring framework. I would suggest reaching out Adobe AEM consulting to address this use case. 

View solution in original post

3 Replies

Avatar

Level 10
Spring is not an out of the box feature with AEM.        

Avatar

Level 1

smacdonald2008 wrote...

Spring is not an out of the box feature with AEM.

 

That's why I am asking for help. There is no good article on Internet.

Avatar

Correct answer by
Level 10

This is not a common use case and would require  customization to get AEM to work with the Spring framework. I would suggest reaching out Adobe AEM consulting to address this use case.