Bug 1054876 - [GSS] (6.4) Proxy creation fails when a superclass does not have a no-arg constructor
Summary: [GSS] (6.4) Proxy creation fails when a superclass does not have a no-arg con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld
Version: 6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR1
: EAP 6.4.0
Assignee: Jozef Hartinger
QA Contact: Matej Novotny
URL:
Whiteboard:
Depends On: 1111092
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-17 16:23 UTC by Anton Giertli
Modified: 2019-08-19 12:42 UTC (History)
4 users (show)

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.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
cdi-reproducer (18.90 KB, application/zip)
2014-01-17 16:25 UTC, Anton Giertli
no flags Details
corrected reproducer (45.24 KB, application/zip)
2014-07-17 08:48 UTC, Anton Giertli
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 694293 None None None Never
JBoss Issue Tracker WELD-1708 Major Resolved (1.1) Proxy creation fails when a superclass does not have a no-arg constructor 2015-07-30 12:51:48 UTC

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@redhat.com> 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.


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