How to use Spring bean injection with session scope in AEM/CQ 5.6.1 | Community
Skip to main content
sunny_z1
October 16, 2015
Solved

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

  • October 16, 2015
  • 3 replies
  • 996 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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. 

3 replies

smacdonald2008
Level 10
October 16, 2015
Spring is not an out of the box feature with AEM.        
sunny_z1
sunny_z1Author
October 16, 2015

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.

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

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.