glassfish
  1. glassfish
  2. GLASSFISH-20761

Request scope not available in ejb @Singleton @Startup @PostConstruct

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When I try to inject a request scoped cdi bean into an ejb singleton startup, a ContextNotActiveException is thrown.
      While I was looking for a solution I found the same (fixed) issue in the jboss issue tracker.
      The following code illustrates the problem.

      @RequestScoped
      public class RequestScopedBean {

      public void doWhatever()

      { System.out.println("did whatever"); }

      }

      @Startup
      @Singleton
      public class SingletonStartupBean {

      @Inject
      private RequestScopedBean requestScopedBean;

      @PostConstruct
      public void init()

      { requestScopedBean.doWhatever(); }

      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            michael.y.chen
            Reporter:
            waloszek
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: