Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-933

Validator.validateBean doesn't handle @Typed properly

XMLWordPrintable

    • Hide

      I observe it on:

      @Named("catalogEntityHome")
      @ConversationScoped
      @Typed(CatalogEntityHome.class)
      public class CatalogEntityHome extends BasicDAO<CatalogEntity, ObjectId> implements Serializable {

      public CatalogEntityHome()

      { super(CatalogEntity.class); }

      }

      Show
      I observe it on: @Named("catalogEntityHome") @ConversationScoped @Typed(CatalogEntityHome.class) public class CatalogEntityHome extends BasicDAO<CatalogEntity, ObjectId> implements Serializable { public CatalogEntityHome() { super(CatalogEntity.class); } }
    • Hide

      Workaround not found yet.

      Show
      Workaround not found yet.
    • Medium

      Here is the problem.

      I've got @Typed class becouse I wanted to limit the set of proxies generated by weld becouse it's ancestors would not be proxyable. That's why I tried @Typed. And halfway it works. But just halfway. The problem I notice is here in Validator (lines 142-145)

      if (normalScoped && !Beans.isBeanProxyable(bean))

      { throw Proxies.getUnproxyableTypesException(bean.getTypes()); }

      My @Typed class which is annotated like this:

      @Named("catalogEntityHome")
      @ConversationScoped
      @Typed(CatalogEntityHome.class)
      public class CatalogEntityHome extends BasicDAO<CatalogEntity, ObjectId> implements Serializable {
      ..

      The problem I observe is that Beans.isBeanProxyable checks Proxies.getUnproxyableTypesException(bean) which somehow produces non-null result. However a moment later it checks Proxies.getUnprox....(bean.getTypes()), which turns to be null. And that's what it tries to throw, like here:

      09:32:58,035 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/servers/jboss-6.0.0.Final/server/default/deploy/test.war_WeldBootstrapBean state=Create: java.lang.NullPointerException
      at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:144) [:6.0.0.Final]
      at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:162) [:6.0.0.Final]
      at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:377) [:6.0.0.Final]
      at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:363) [:6.0.0.Final]
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:388) [:6.0.0.Final]
      at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:92) [:6.0.0.Final]

              Unassigned Unassigned
              mrmimo_jira Mike Mosiewicz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: