2 Replies Latest reply on Sep 21, 2012 3:25 AM by sfcoy

    Failed to deploy ear that contains web service

    burgosjc

      I have the following error when deploying an EAR which contains a jar with the following simple web service

       

       

      @Stateless
      @WebService(serviceName="MensajeService")
      public class MensajeService {
      
         @WebMethod
         public String hola(String nombre){
            return "Hola "+nombre;
         }
      }
      

       

      The error is generated by the following

       

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component MensajeService
                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 interface MensajeService
                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
      
      
      

       

      If I remove the jar from the web service, deployed without problem and the strange thing is that I have another application that also uses web services and deploy no errors.

        • 1. Re: Failed to deploy ear that contains web service
          eocampos

          Could not find default constructor for interface MensajeService

           

          The error says that your implementing class needs a default constructor, try with:

           

          @Stateless
          @WebService(serviceName="MensajeService")
           public class MensajeService {
                public void MensajeService() {}
                @WebMethod
               public String hola(String nombre) {
                   return "Hola " + nombre;     }
          }
          
          

           

           

          • 2. Re: Failed to deploy ear that contains web service
            sfcoy

            Indeed. The EJB spec actually makes this a requirement:

             

            {quote}4.9.2 Session Bean Class

            ...

            • The class must have a public constructor that takes no parameters. The container uses this constructor to create instances of the session bean class.

            {quote}