0 Replies Latest reply on Mar 13, 2013 1:33 PM by Deibys Quintero

    Error on ear deployment

    Deibys Quintero Newbie

      Hi guys,

       

      I hope someone could help me out.  I am getting the bellow excepcion while trying to deploy a ear file in JBOSS 7

       

      12:27:54,296 WARN  [org.jboss.modules] (MSC service thread 1-8) Failed to define class org.colfuturo.util.web.validator.UrlValidator in Module "deployment.Perfil.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/colfuturo/util/web/validator/UrlValidator (Module "deployment.Perfil.ear:main" from Service Module Loader)
                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.as.web.deployment.jsf.JsfAnnotationProcessor.deploy(JsfAnnotationProcessor.java:111)
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [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(Unknown Source) [rt.jar:1.6.0_33]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
                at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
      Caused by: java.lang.NoClassDefFoundError: javax/faces/validator/Validator
                at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_33]
                at java.lang.ClassLoader.defineClassCond(Unknown Source) [rt.jar:1.6.0_33]
                at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_33]
                at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_33]
                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA]
                ... 15 more
      Caused by: java.lang.ClassNotFoundException: javax.faces.validator.Validator from [Module "deployment.Perfil.ear:main" from Service Module Loader]
                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
                ... 21 more
      
      
      12:27:54,309 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."Perfil.ear".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."Perfil.ear".INSTALL: Failed to process phase INSTALL of deployment "Perfil.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(Unknown Source) [rt.jar:1.6.0_33]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_33]
                at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_33]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018045: Failed to load annotated class: org.colfuturo.util.web.validator.UrlValidator
                at org.jboss.as.web.deployment.jsf.JsfAnnotationProcessor.deploy(JsfAnnotationProcessor.java:113)
                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
      
      

       

       

      My URLValidator class is in a jar file in the lib directory of the ear file. 

       

      package org.colfuturo.util.web.validator;
      
      
      import javax.faces.application.FacesMessage;
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.FacesValidator;
      import javax.faces.validator.Validator;
      import javax.faces.validator.ValidatorException;
      
      
      import org.apache.commons.lang3.StringUtils;
      
      
      /**
       * Validador de URL para JSF
       * @author manrique_alejandro
       * @version 1.0, 10/11/2009
       */
      @FacesValidator(value = "urlValidator")
      public class UrlValidator implements Validator {
      
      
          /**
           * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext,
           *      javax.faces.component.UIComponent, java.lang.Object)
           */
          public void validate(FacesContext facesContext, UIComponent uIComponent, Object object) throws ValidatorException {
                // Get the url
                String url = (String) object;
      
      
                if (!StringUtils.isEmpty(url) && url.indexOf("http://") != 0 && url.indexOf("http://") != 0) {
                    url = "http://" + url;
                }
      
      
                // Get an UrlValidator
                org.apache.commons.validator.routines.UrlValidator validator = new org.apache.commons.validator.routines.UrlValidator();
      
      
                // Validate the url
                if (!StringUtils.isEmpty(url) && !validator.isValid(url)) {
                    FacesMessage message = new FacesMessage();
                    message.setDetail("Url no válido");
                    message.setSummary("Url no válido");
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    throw new ValidatorException(message);
                }
          }
      }
      
      

       

       

      Why the excepcion ? should I specify the Faces dependency ? how ? It did not occur when I was trying to deploy a war file.