[jboss-jira] [JBoss JIRA] (WFLY-1097) relax the requirement for having EJB bean class no-arg constructor

Rafael Vanderlei de Souza (JIRA) jira-events at lists.jboss.org
Mon Aug 26 12:50:26 EDT 2013


    [ https://issues.jboss.org/browse/WFLY-1097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799285#comment-12799285 ] 

Rafael Vanderlei de Souza commented on WFLY-1097:
-------------------------------------------------

Hi, since which AS version, this started being validated? I'm asking this because I have an application (which contains a EJB with a 'protected' non-args constructor) that was first developed to run on JBoss 4.2.2 and I'm currently migrating it to AS 7.. first I deployed to 7.1.1-Final, then deploy to EAP 6.0.0 and now I'm trying o deploy on 6.1.0.GA .. using the 3 first AS versions I was able to deploy the application, but EAP 6.1.0 is requiring the public non-args constructor.
                
> relax the requirement for having EJB bean class no-arg constructor
> ------------------------------------------------------------------
>
>                 Key: WFLY-1097
>                 URL: https://issues.jboss.org/browse/WFLY-1097
>             Project: WildFly
>          Issue Type: Feature Request
>          Components: EE
>            Reporter: Cheng Fang
>            Assignee: David Lloyd
>
> Currently AS7 requires all EJB bean class to have a public no-arg
> constructor, even when cdi is enabled and there is a @Inject constructor.
> The deployment of EJB with no default constructor will fail
> validation. I understand this is a EJB spec requirement, but I guess it's
> more of legacy from pre-CDI days.
> I'm wondering if we can relax it, to support EJB bean classes with
> only @Inject constructor and no default constructor. This is currently supported in GlassFish/RI. 
> The stacktrace from validation:
> {noformat}
> 10:13:36,354 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-9) MSC00001: Failed to start service jboss.deployment.unit."test.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "test.war"
>         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
>         at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
>         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_35]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_35]
>         at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_35]
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component TestBean
>         at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:91)
>         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
>         ... 5 more
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014227: EJB TestBean of type test.TestBean must have public default constructor
>         at org.jboss.as.ejb3.component.EJBValidationConfigurator.configure(EJBValidationConfigurator.java:59)
>         at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)
>         ... 6 more
> 10:13:36,360 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "test.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"test.war\"
>     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component TestBean
>     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014227: EJB TestBean of type test.TestBean must have public default constructor"}}
> 10:13:36,379 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment test.war in 19ms
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list