glassfish
  1. glassfish
  2. GLASSFISH-18435

IllegalStateException: Singleton not set for ... when invoking @PreDestroy on @SessionScoped bean

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 4.0
    • Component/s: cdi
    • Labels:
      None

      Description

      I had an issue with @SessionScoped beans giving me an error during execution of @PreDestroy method.
      In the server.log there were lines similar to this
      [#|2012-03-01T09:16:14.799+0100|SEVERE|glassfish3.1.1|org.jboss.weld.Bean|_ThreadID=23;_ThreadName=Thread-2;|WELD-000019 Error destroying an instance Managed Bean [class test.SessionBeanProducer] with qualifiers [@Any @Default] of test.SessionBeanProducer@1c65470|#]

      I investigated it a little bit and found thad when @PreDestroy method invoked @RequestScoped bean, the method org.glassfish.weld.ACLSingletonProvider.ACLSingleton#get raised IllegalStateException.
      When this method was invoked TCCL was set to WebApp classloader but in the store only ear class loader was registered

      The issue seems to be specific to EAR deployments. I created an arquillian test case demonstrating the issue.

        Activity

        titmus created issue -
        jjsnyder83 made changes -
        Field Original Value New Value
        Fix Version/s 4.0 [ 10970 ]
        Sivakumar Thyagarajan made changes -
        Assignee Sivakumar Thyagarajan [ sivakumart ] jjsnyder83 [ jjsnyder83 ]
        jwells made changes -
        Assignee jjsnyder83 [ jjsnyder83 ] jwells [ jwells ]
        jwells made changes -
        Tags 4_0-review
        michael.y.chen made changes -
        Tags 4_0-review 4_0-approved
        jwells made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            jwells
            Reporter:
            titmus
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: