Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1824

TomEE wrongly detecte disabled beans as broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0
    • tomee
    • None

    Description

      The latest TomEE build detects disabled beans as broken and reports a Serialization check issue.

      org.apache.webbeans.exception.WebBeansConfigurationException: Passivation scoped defined bean must be passivation capable, but bean : TissClientConfig, Name:null, WebBeans Type:MANAGED, API Types:[org.apache.myfaces.extensions.cdi.jsf.api.config.ClientConfig,at.ac.tuwien.tiss.core.fe.codi.TissClientConfig,java.io.Serializable,java.lang.Object], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default] is not passivation capable
      at org.apache.openejb.cdi.BeansDeployer.checkPassivationScope(BeansDeployer.java:392)
      at org.apache.openejb.cdi.BeansDeployer.validate(BeansDeployer.java:253)
      at org.apache.openejb.cdi.BeansDeployer.validateInjectionPoints(BeansDeployer.java:215)
      at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:286)
      at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:108)
      at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:50)

      The bean looks like the following:

      @SessionScoped
      @Alternative
      public class TissClientConfig extends ClientConfig implements Serializable {

      The problem is that in my case the Alternative is not enabled via beans.xml. Thus it is disabled, in which case the WebBeansUtil#isPassivationCapable(Contextual<?> contextual) returns null.
      This works as documented:
      > @return the uniqueId if it is

      {@link PassivationCapable}

      and enabled

      The solution: Someone removed the following lines from the class you copied from owb to openejb:
      if (bean instanceof OwbBean && !((OwbBean)bean).isEnabled())
      {
      // we skip disabled beans
      continue;
      }

      Disabled beans do not need to be valid in a CDI sense at all. That might be the reason why they got disabled during the boot.

      I will provide a patch to fix this. Just doing some 7up and testing.

      Attachments

        1. OPENEJB-1824.patch
          0.8 kB
          Mark Struberg

        Activity

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: