1 Reply Latest reply on Aug 20, 2010 12:26 AM by claudio4j

    Injection inside HttpSessionAttributeListener

    claudio4j

      Hi folks,


      Is it possible to inject a seam component for  HttpSessionAttributeListener
      I want to inject a component loaded from components.xml into a HttpSessionAttributeListener implementation. The code looks like:


      MyInterface obj = (MyInterface) org.jboss.seam.Component.getInstance("obj", true);


      But there is an exception:



      java.lang.IllegalStateException: No application context active
              at org.jboss.seam.Component.forName(Component.java:1945)


      The listener declaration is after SeamListener in web.xml


      JBoss seam is 2.2.0
      JBoss 5.0


      If the injection is not officialy supported in seam, is there a workaround for this ?


      Thanks


      Claudio

        • 1. Re: Injection inside HttpSessionAttributeListener
          claudio4j

          More information.
          The implementation class is


           @Name("obj")
           @Install(false)
           @Scope(ScopeType.APPLICATION)
           @AutoCreate
           public class MyImplementation implements MyInterface
          



          I have tried with
          @Scope(ScopeType.SESSION)


          The components.xml



              <component  class="br.com.MyImplementation" 
                          name="obj">
              </component>