title: Failed to create service exception javax.xml.ws.WebServiceException:
body: <p>I need desperate help to figure out why my application is not creating a webservice.</p>
  
  <p>Here's my webservice Java class:</p>
  
  <pre><code>  @WebService
    @Component
    public class LoginWs extends AbstractWs
  {
  private static final Logger logger=MiscUtils.getLogger();
  
  @Autowired
  private PersonDao personDao = null;
  
  /**
   * Returns PersonTransfer on valid login
   * @throws NotAuthorisedException if password is incorrect
   */
  public PersonTransfer login(String userNameOrEmailAddress, String password) throws NotAuthorisedException
  {
      Person person=personDao.findByUserNameOrEmailAddress(userNameOrEmailAddress, true);
  
      if (person != null &amp;&amp; person.checkPassword(password))
      {
          PersonTransfer personTransfer = PersonTransfer.getTransfer(person);
  
          personDao.setLastLogin(person.getId(), new GregorianCalendar());
  
          EventLogDao.logEvent(ActionType.READ_DATA.name(), "LoginWs.login()", "personId=" + person.getId());         
  
          return(personTransfer);
      }
  
      logger.debug("Login failed : u/p="+userNameOrEmailAddress+"/"+password);
  
      throw(new NotAuthorisedException("Invalid Username/Password"));
  }
  }
  </code></pre>
  
  <p>The code that is calling this service is:</p>
  
  <pre><code>  public static LoginWs getLoginWs()
  {
  
      LoginWsService service = new LoginWsService(buildURL("LoginService"));
  
      LoginWs port = service.getLoginWsPort();
  
      CxfClientUtils.configureClientConnection(port);
  
      return(port);
  }
  </code></pre>
  
  <p>The exception is thrown at : </p>
  
  <pre><code>   LoginWsService service = new LoginWsService(buildURL("LoginService"));
  </code></pre>
  
  <p>Here is the full exception:</p>
  
  <pre><code>    Error
      javax.xml.ws.WebServiceException:  org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
  at org.apache.cxf.jaxws.ServiceImpl.&lt;init&gt;(ServiceImpl.java:149)
  at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
  at javax.xml.ws.Service.&lt;init&gt;(Service.java:56)
  at org.websr.my_server.ws.LoginWsService.&lt;init&gt;(Unknown Source)
  
      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'https://192.168.2.184:8443/my_server/ws/LoginService?wsdl'.: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
  </code></pre>
  
  <p>Can someone tell me why it is failing at creating Service itself. In LoginWs method, this line       </p>
  
  <pre><code>   CxfClientUtils.configureClientConnection(port);
  </code></pre>
  
  <p>configures the SSL connection but my code is not even getting there. It's trying to connect at
      LoginWsService service = new LoginWsService(buildURL("LoginService"));
  and failing.</p>
  
  <p>Can someone please tell me what's going on here? Thanks!</p>
  
  <p>cert.pem:</p>
  
  <pre><code>        MIID1DCCArygAwIBAgIJAPAlC2JvlPsZMA0GCSqGSIb3DQEBBQUAMIGSMQswCQYD
  VQQGEwJDQTEQMA4GA1UECBMHT250YXJpbzEQMA4GA1UEBxMHVG9yb250bzERMA8G
  A1UEChMISW5kaXZpY2ExETAPBgNVBAsTCEluZGl2aWNhMRYwFAYDVQQDEw0xOTIu
  MTY4LjIuMTg0MSEwHwYJKoZIhvcNAQkBFhJkaXZ5YUBpbmRpdmljYS5jb20wHhcN
  MTIwMTA2MTYxMTQwWhcNMTMwMTA1MTYxMTQwWjCBkjELMAkGA1UEBhMCQ0ExEDAO
  BgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xETAPBgNVBAoTCEluZGl2
  aWNhMREwDwYDVQQLEwhJbmRpdmljYTEWMBQGA1UEAxMNMTkyLjE2OC4yLjE4NDEh
  MB8GCSqGSIb3DQEJARYSZGl2eWFAaW5kaXZpY2EuY29tMIIBIjANBgkqhkiG9w0B
  AQEFAAOCAQ8AMIIBCgKCAQEAxY8+fsw2pP4ToHN6XFNli4vOGbt+O/ANsr1A8iJh
  nCb6cpQ58xF4pvYmETHrAUpv4zpi31SzZvWYI1tMaCEv9IpcX6Kc1B8NB9sLUnhR
  gyblF37rZ7eMmSAXXeDS0CTtDEJoHOkGxoUdCN6N+vZjJ5+ZONiiuLqZ4x4HwBFr
  ucIlwl2FkMMSxylg90tttSIyUHGz/p2DvNA2goYih4d89c/FLNpqwku+G3/gnL7U
  l0OmNuFwJa/qMjy/V1orfpT8egxxh8DMp+fLAv1gjbeoizUs2bHo9kQSbUSp9Cwb
  VDCol9jGI14cBuuEpWSANx2gTekN1ktoxztFPCh7H3OK/wIDAQABoyswKTAPBgNV
  HREECDAGhwTAqAK4MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMA0GCSqGSIb3DQEB
  BQUAA4IBAQALvpU0/5gQedlET2+r2MV0oksTmM2hV677yVsrOnGCOnTcgMZHp5i4
  A0B24Ed2iDesX60OAViIocQkOiwYTRnubg5SoWyL1nhmaa/98U6M/re8R/bvq6OK
  qrzEO6hHOtunJg1HcZDiJZop7R/pM52yRhRoXU6upZEhbPr6Eh+zfysA0TD6uMs7
  9k2VeJo++XUvbG3dkVJ9kYhqfx2vC0HiMI4H2eomzl2ymS+R9Kg/9o29K8oCYjDI
  jWPbl2hmf2cQuC4gG8GUDZi7zJkFsBuJpD6XgpIVK9zNhg1e89eP0nABupIFqBOI
  iz0C+tRB4z4TezPL6yC7BDMY2nJ/Cg5e
  </code></pre>
  
  <p>vs what the server is actually using:</p>
  
  <pre><code>MIICVTCCAb6gAwIBAgIETr3AxTANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJD
  QTEQMA4GA1UECBMHT250YXJpbzEQMA4GA1UEBxMHVG9yb250bzERMA8GA1UEChMI
  SW5kaXZpY2ExETAPBgNVBAsTCEluZGl2aWNhMRYwFAYDVQQDEw0xOTIuMTY4LjIu
  MTg0MB4XDTExMTExMjAwNDE0MVoXDTIxMTEwOTAwNDE0MVowbzELMAkGA1UEBhMC
  Q0ExEDAOBgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xETAPBgNVBAoT
  CEluZGl2aWNhMREwDwYDVQQLEwhJbmRpdmljYTEWMBQGA1UEAxMNMTkyLjE2OC4y
  LjE4NDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzvnBMOM2YpM4Ch0MkesA
  ryqX3YD8O22kJJrpRuOMyqgt6fKEDxkcGjiEZ7qLfWbzv3eX9DE0nVeS4m65Ucr2
  LLZN6iZoqP8J+AmkSXKapIQpX7tZM5UuTDy82vUdOiYJELB3NSJc/4nkZkTaN8Uj
  h3Ph366kRUP+QWiq2y97KKMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBFeOQOKq9u
  4nq/IUgNpILrhcpiAP5LB49bCXeTCi8Ls51qUCaezceUQKrWM60a6w8FxQF+yopB
  PSqGMrUBHnvewkThgZbS12t5vOEoXnWjOwiXhMhRsk5i9YUh1QCYfOFF23aXNfRu
  NLL5svksUHm1IzBJJANnL/YdJHRrR0IEQg==
  </code></pre>