1 Reply Latest reply on Oct 1, 2013 1:31 AM by Stephen Coy

    JBAS011054: Could not find default constructor for class

    Tiago Valerio Newbie

      I'm trying to deploy a web application on jboss as 7 and the following erro ocurres:

      00:47:56,327 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.subunit."erp-app.ear"."erp-core-business-1.0.0-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."erp-app.ear"."erp-core-business-1.0.0-SNAPSHOT.jar".INSTALL: Failed to process phase INSTALL of subdeployment "erp-core-business-1.0.0-SNAPSHOT.jar" of deployment "erp-app.ear"

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

        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:895) [rt.jar:1.6.0_43]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_43]

        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_43]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component ClienteManagerImpl

        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:92)

        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

        ... 5 more

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class br.com.erp.manager.impl.ClienteManagerImpl

        at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)

        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

        ... 6 more

       

       

      The class java that is mentioned in the log is as follow:

       

      package br.com.erp.manager.impl;
      
      
      import javax.ejb.Stateless;
      import javax.inject.Inject;
      
      
      import br.com.erp.dao.ClienteDAO;
      import br.com.erp.manager.ClienteManager;
      import br.com.erp.modelo.Cliente;
      import br.com.wcj.pattern.util.manager.CdiAbstractManager;
      
      
      @Stateless
      public class ClienteManagerImpl extends CdiAbstractManager<Cliente, Long>
        implements ClienteManager {
      
      
        private static final long serialVersionUID = 3306211336966349833L;
      
        @Inject
        private ClienteDAO clienteDAO;
      
      
        @Inject
        public ClienteManagerImpl(ClienteDAO clienteDAO) {
        super(clienteDAO);
        }
      
      
        @Override
        protected ClienteDAO getDAO() {
        return (ClienteDAO) super.getDAO();
        }
      
      
      
      
      }
      
      
      
      
      
      
      
      
      
      
      
      
      

       

      I've tryed to change lots of things in the project, but with no sucess. Can anyone please try to help and give me a clue of what could be wrong? Thanks!

        • 1. Re: JBAS011054: Could not find default constructor for class
          Stephen Coy Master

          ClienteManagerImpl is an EJB which is required to have a public no-args constructor. There's no point in declaring the ClienteManagerImpl(ClienteDAO clienteDAO) constructor because this object is created by the EJB container, which has no way of knowing how to call it.

           

          If you need to pass the ClienteDAO to the superclass then you should add a method that is marked up with @PostConstruct and do it there.

           

          Your design looks somewhat suspect though...