Bug 1086555 - [GSS] (6.4) Weld - Specialization of generic beans throws inappropriate exception
Summary: [GSS] (6.4) Weld - Specialization of generic beans throws inappropriate excep...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld
Version: 6.1.0,6.2.0,6.1.1,6.2.1,6.2.2,6.2.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR1
: EAP 6.4.0
Assignee: Jozef Hartinger
QA Contact: Tomas Remes
URL:
Whiteboard:
: 1120079 (view as bug list)
Depends On: 1111092
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-11 06:24 UTC by Tomas Remes
Modified: 2019-08-19 12:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In a previous release of JBoss EAP 6, setting a specialization on a generic bean resulted in a `DefinitionException` being thrown. This behavior was not intended as has been addressed in this release. Setting a specialization on a generic bean now operates as expected.
Clone Of:
Environment:
Last Closed: 2019-08-19 12:38:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WELD-1651 0 None None None 2014-08-28 06:38:49 UTC
Red Hat Issue Tracker WELD-1707 0 None None None 2014-08-28 06:38:49 UTC

Description Tomas Remes 2014-04-11 06:24:58 UTC
Basically having following class in your deployment:

public class BeanDefault<T extends AbstractClass> {}

and its speciliazation like this:

@Specializes
public class BeanCustom<T extends AbstractClass> extends BeanDefault<T> {}

You get following exception (which is IMHO inappropriate) during Weld boot time:

org.jboss.weld.exceptions.DefinitionException: WELD-001511 Specializing bean Managed Bean [class mypackage.BeanCustom] with qualifiers [@Any @Default] does not have bean type class mypackage.BeanDefault<T> of specialized bean Managed Bean [class mypackage.BeanDefault] with qualifiers [@Any @Default]
	at org.jboss.weld.bean.AbstractBean.postSpecialize(AbstractBean.java:287)
	at org.jboss.weld.bean.AbstractBean.initialize(AbstractBean.java:124)
	at org.jboss.weld.bean.AbstractClassBean.initialize(AbstractClassBean.java:175)
	at org.jboss.weld.bean.ManagedBean.initialize(ManagedBean.java:329)
	at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:117)
	at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:217)
	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:357)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:63)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

It manifest with following exception in versions prior to EAP 6.3.0 (Weld 1.1.19.Final):

Caused by: org.jboss.weld.exceptions.DefinitionException: Exception message for key SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE not found due to Can't find resource for bundle ch.qos.cal10n.util.CAL10NResourceBundle, key SPECIALIZING_BEAN_MISSING_SPECIALIZED_TYPE
	at org.jboss.weld.bean.AbstractBean.postSpecialize(AbstractBean.java:287)
	at org.jboss.weld.bean.AbstractBean.initialize(AbstractBean.java:124)
	at org.jboss.weld.bean.AbstractClassBean.initialize(AbstractClassBean.java:175)
	at org.jboss.weld.bean.ManagedBean.initialize(ManagedBean.java:329)
	at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:117)
	at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:217)
	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:357)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:63)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

Comment 1 JBoss JIRA Server 2014-05-28 13:57:47 UTC
Jozef Hartinger <jharting> updated the status of jira WELD-1651 to Resolved

Comment 2 baranowb 2014-07-16 08:39:48 UTC
BUmping to 6.3.1 and 6.4

Doc text for 6.3 ?

Comment 4 Jozef Hartinger 2014-07-23 08:22:23 UTC
*** Bug 1120079 has been marked as a duplicate of this bug. ***

Comment 5 Jozef Hartinger 2014-07-23 13:44:56 UTC
https://github.com/jbossas/jboss-eap/pull/1535

Comment 6 Tomas Remes 2014-09-26 13:05:42 UTC
Verified on 6.4.0.DR2 release.


Note You need to log in before you can comment on or make changes to this bug.