[weld-issues] [JBoss JIRA] (WELD-933) Validator.validateBean doesn't handle @Typed properly
Ales Justin (Commented) (JIRA)
jira-events at lists.jboss.org
Fri Oct 28 08:56:45 EDT 2011
[ https://issues.jboss.org/browse/WELD-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638278#comment-12638278 ]
Ales Justin commented on WELD-933:
----------------------------------
Can you try this on JBossAS7?
Or, can you write a simple Arquillian test for it?
> 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
> Labels: jboss
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues
mailing list