title: java.lang.NoClassDefFoundError: org/apache/cxf/service/invoker/Invoker
body: <p>Does anyone know how to fix this?
  I created a client to consume a webservice. The client code is:</p>
  
  <pre><code>package cliente;
  
  import java.util.List;
  
  import handler.HeaderHandler;
  import webservice.BoletinOficial;
  import webservice.BoletinOficialService;
  import petanuncio.PeticionAnuncio;
  import respanuncio.RespuestaAnuncio;
  
  import org.apache.cxf.jaxws.binding.DefaultBindingImpl;
  
  import javax.xml.ws.BindingProvider;
  import javax.xml.ws.handler.Handler;
  import java.util.ArrayList;
  
  
  public class Cliente {
  
  /**
   * Main
   * @param args
   */
   @SuppressWarnings("rawtypes")
  public static void main(String[] args) {
  
    String endpointURL = "";
    try {
  
  
         BoletinOficialService service = new BoletinOficialService();
  
         BoletinOficial proxy = service.getBoletinOficialSoap11();
  
  
  //rest of code
  
    } catch (Exception e) {
     e.printStackTrace();
    }
   }
  </code></pre>
  
  <p>The problem is when running the program and get the following error anc cannot even create "service":</p>
  
  <pre><code> Exception in thread "main" java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider org.apache.cxf.jaxws.spi.ProviderImpl could not be instantiated
      at java.util.ServiceLoader.fail(Unknown Source)
      at java.util.ServiceLoader.access$100(Unknown Source)
      at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
      at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
      at java.util.ServiceLoader$1.next(Unknown Source)
      at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Unknown Source)
      at javax.xml.ws.spi.Provider.provider(Unknown Source)
      at javax.xml.ws.Service.&lt;init&gt;(Unknown Source)
      at webservice.BoletinOficialService.&lt;init&gt;(BoletinOficialService.java:46)
      at cliente.Cliente.main(Cliente.java:35)
  Caused by: java.lang.NoClassDefFoundError: org/apache/cxf/service/invoker/Invoker
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      ... 8 more
  Caused by: java.lang.ClassNotFoundException: org.apache.cxf.service.invoker.Invoker
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 12 more
  </code></pre>
  
  <p>This class and others were created via wsimport from a wsdl file, althoug I don't think this is related to the error I am getting.
  The class org.apache.cxf.jaxws.spi.ProviderImpl is in cxf-rt-frontend-jaxws-3.1.1.jar file whis is added as referece to the project.</p>
  
  <p><a href="https://i.stack.imgur.com/K3qSb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K3qSb.png" alt="This is the project structure"></a></p>
  
  <p><a href="https://i.stack.imgur.com/k5dhz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k5dhz.png" alt="These are the libraries"></a></p>
  
  <p>Is there anything I am missing? Thank you in advance.</p>