Bug 1054876

Summary: [GSS] (6.4) Proxy creation fails when a superclass does not have a no-arg constructor
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Anton Giertli <agiertli>
Component: CDI/WeldAssignee: Jozef Hartinger <jharting>
Status: CLOSED CURRENTRELEASE QA Contact: Matej Novotny <manovotn>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: agiertli, bbaranow, jharting, kkhan
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previous versions of JBoss EAP included an implementation of Weld that performed an unnecessarily strict check that constructors of all superclasses have public no-arg constructors. This issue has been resolved in this release. Now only the proxiability of the bean itself is checked, not all supertypes.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1111092    
Bug Blocks:    
Attachments:
Description Flags
cdi-reproducer
none
corrected reproducer none

Description Anton Giertli 2014-01-17 16:23:00 UTC
Description of problem:
When injecting an @ApplicationScoped bean, which extends a class that does not have a no-arg constructor it fails with the exception.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Either test it through this test case https://github.com/weld/core/pull/448
or use reproducer attached, simple war application which fails during the deployment with the following error:

16:38:08,265 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."jboss-as-servlet-async.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."jboss-as-servlet-async.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean class org.jboss.as.quickstarts.servlet.async.NotSimpleConstructorClass is not proxyable because it has no no-args constructor - Managed Bean [class org.jboss.as.quickstarts.servlet.async.SimpleBean] with qualifiers [@Any @Default].
	at org.jboss.weld.util.Proxies.getUnproxyableClassException(Proxies.java:214)
	at org.jboss.weld.util.Proxies.getUnproxyableTypeException(Proxies.java:180)
	at org.jboss.weld.util.Proxies.getUnproxyableTypesExceptionInt(Proxies.java:195)
	at org.jboss.weld.util.Proxies.getUnproxyableTypesException(Proxies.java:169)
	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:148)
	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
	at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:383)
	at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:368)
	at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
	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]
	... 3 more

16:38:08,479 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "jboss-as-servlet-async.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"jboss-as-servlet-async.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jboss-as-servlet-async.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean class org.jboss.as.quickstarts.servlet.async.NotSimpleConstructorClass is not proxyable because it has no no-args constructor - Managed Bean [class org.jboss.as.quickstarts.servlet.async.SimpleBean] with qualifiers [@Any @Default]."}}

Actual results:

When injecting an @ApplicationScoped bean, which extends a class that does not have a no-arg constructor it fails with the org.jboss.weld.exceptions.UnproxyableResolutionException

Expected results:

Injection is done without issues.


Additional info:

Comment 2 Anton Giertli 2014-01-17 16:25:10 UTC
Created attachment 851699 [details]
cdi-reproducer

Comment 4 Anton Giertli 2014-07-17 08:48:06 UTC
Created attachment 918640 [details]
corrected reproducer

Comment 8 JBoss JIRA Server 2014-07-22 13:04:17 UTC
Jozef Hartinger <jharting> updated the status of jira WELD-1708 to Resolved

Comment 9 Jozef Hartinger 2014-07-23 13:45:02 UTC
https://github.com/jbossas/jboss-eap/pull/1535

Comment 10 Ron Šmeral 2014-09-17 11:03:21 UTC
Verified in EAP 6.4.0.DR1.1.