title: Apache CXF - Null Pointer Exception in WSDLServiceFactory
body: <p>When I execute a jar I receive this error:</p>
  
  <pre><code>java.lang.NullPointerException
  at org.apache.cxf.wsdl11.WSDLServiceFactory.&lt;init&gt;(WSDLServiceFactory.java:85)
  at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:218)
  at org.apache.cxf.jaxws.ServiceImpl.initialize(ServiceImpl.java:161)
  at org.apache.cxf.jaxws.ServiceImpl.&lt;init&gt;(ServiceImpl.java:129)
  at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:82)
  at javax.xml.ws.Service.&lt;init&gt;(Service.java:77)
  at it.finanze.dogane.domest.otello.accesspoint.wsdl.Otello_Service.&lt;init&gt;(Otello_Service.java:44)
  at it.sknt.truckonesender.App.main(App.java:70)
  </code></pre>
  
  <p>Inside the generated service class I have:</p>
  
  <pre><code>@WebServiceClient(name = "Otello",
                wsdlLocation = "classpath:Otello.wsdl",
                targetNamespace = "http://accessPoint.otello.domest.dogane.finanze.it/wsdl/")
  </code></pre>
  
  <p>public class Otello_Service extends Service {</p>
  
  <pre><code>public final static URL WSDL_LOCATION;
  
  public final static QName SERVICE = new QName("http://accessPoint.otello.domest.dogane.finanze.it/wsdl/", "Otello");
  public final static QName Otello = new QName("http://accessPoint.otello.domest.dogane.finanze.it/wsdl/", "Otello");
  static {
      URL url = Otello_Service.class.getClassLoader().getResource("Otello.wsdl");
      if (url == null) {
          java.util.logging.Logger.getLogger(Otello_Service.class.getName())
              .log(java.util.logging.Level.INFO,
                   "Can not initialize the default wsdl from {0}", "classpath:Otello.wsdl");
      }
      WSDL_LOCATION = url;
  } .....
  </code></pre>
  
  <p>Inside my POM file I have:</p>
  
  <pre><code>            &lt;plugin&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.2.6&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;generate-sources&lt;/id&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;sourceRoot&gt;${project.build.directory}/generated-sources/cxf&lt;/sourceRoot&gt;
                          &lt;wsdlOptions&gt;
                              &lt;wsdlOption&gt;
                                  &lt;wsdl&gt;classpath:Otello.wsdl&lt;/wsdl&gt;
                              &lt;/wsdlOption&gt;
                          &lt;/wsdlOptions&gt;
                      &lt;/configuration&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;wsdl2java&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>And these are the cxf packages added to project</p>
  
  <pre><code>        &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
          &lt;version&gt;3.2.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
          &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
          &lt;version&gt;3.2.6&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Everithing works fine if I execute the program from netbeans.</p>
  
  <p>The wdsl file is under src/main/resources. The wsdl implementation is automatically generated and are place under target/generated-sources/cxf</p>
  
  <p>Anyone can help me?</p>