0

I am deploying a Spring 3.2.9 based web app within WildFly 8.2.0 using the following runtime descriptor

<jboss-deployment-structure>
     <deployment>
    <exclude-subsystems>
             <subsystem name="jaxrs" />
             <subsystem name="weld" />
         </exclude-subsystems>
         <exclusions>
             <module name="org.apache.commons.logging" />
             <module name="org.apache.log4j" />
             <module name="org.hibernate"/>
             <module name="org.jboss.logging.jul-to-slf4j-stub" />
             <module name="org.jboss.logmanager" />
             <module name="org.jboss.logmanager.log4j" />
             <module name="org.slf4j" />
             <module name="org.slf4j.impl"/>
         </exclusions>
         <dependencies>
             <module name="org.javassist"/>
             <module name="org.antlr"/>
             <module name="org.jboss.jboss-transaction-spi"/>
             <module name="org.jboss.marshalling"/>
             <module name="org.jboss.marshalling.river"/>
             <module name="org.dom4j"/>
             <module name="org.scannotation.scannotation"/>
             <module name="org.mariadb"/>
         </dependencies>
     </deployment>
</jboss-deployment-structure>

My expectation was that Spring instead of Weld (the default with WildFly) will be used as the DI engine

However when deploying our webapp, I am hitting the following error

The JobGridLiveListServiceImpl class has a single constructor that receives another bean via injection

2016-02-18 12:27:49,040 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."dfm-app.war".INSTALL:  org.jboss.msc.service.StartException in service jboss.deployment.unit."dfm-app.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "dfm-app.war" at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
[wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
[jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
[jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0_51]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51] Caused by: 
org.jboss.as.server.deployment.DeploymentUnitProcessingException: 
JBAS011030: Could not configure component com.netapp.dfm.webui.server.job.JobGridLiveListServiceImpl
at
org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:95)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
[wildfly-server-8.2.0.Final.jar:8.2.0.Final]
... 5 more


Caused by: 
org.jboss.as.server.deployment.DeploymentUnitProcessingException: 
JBAS011054: Could not find default constructor for class com.netapp.dfm.webui.server.job.JobGridLiveListServiceImpl
at
org.jboss.as.ee.component.DefaultInterceptorConfigurator.configure(DefaultInterceptorConfigurator.java:92)
at
org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
... 6 more

The same code was works fine on Jboss AS 6.1.

Any inputs on the probable reasons this exception is thrown?

Sirish Renukumar
  • 1,509
  • 2
  • 13
  • 16
  • By default, CDI is enabled in your archive. You may want to remove the weld subsystem if you're not using it. With that said, Wildfly 8.2 is pretty old, and you may want to use a newer version. In Java EE 7, you can disable bean discovery completely with a `bean-discovery-mode=none` – John Ament Feb 20 '16 at 01:06
  • @JohnAment: Are you sure? Is a `beans.xml` not needed for CDI to be active? – user140547 Feb 20 '16 at 09:58
  • @JohnAment, I have excluded the weld subsystem completely as in the jboss-deployment-structure.xml. Hence bit confused as to how it is still active. There is no beans.xml as well (since I am using Spring with a application-xxx.xml – Sirish Renukumar Feb 21 '16 at 07:01

1 Answers1

0

I faced the same error on JBOSS EAP 7, in order to resolve I added a default constructor without parameters in the mentioned class, however this is only possible when the issue occurs for a cusom jar or external dependency which has been developed by us.

dev_2014
  • 321
  • 3
  • 6