[weld-issues] [JBoss JIRA] Created: (WELD-933) Validator.validateBean doesn't handle @Typed properly

Mike Mosiewicz (JIRA) jira-events at lists.jboss.org
Thu Jul 7 04:28:23 EDT 2011


Validator.validateBean doesn't handle @Typed properly
-----------------------------------------------------

                 Key: WELD-933
                 URL: https://issues.jboss.org/browse/WELD-933
             Project: Weld
          Issue Type: Bug
          Components: Bootstrap and Metamodel API, Proxies
    Affects Versions: 1.1.0.CR3
         Environment: JBoss 6.0.0.Final
            Reporter: Mike Mosiewicz


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]




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list