title: java.io.FileNotFoundException when running on server
body: <p>I am using Java 8 with Spring 4.3.1.RELEASE.</p>
  
  <p>I have the following code, that works when I run the <code>main</code> as a java application. However, when I deploy it to a Tomcat server, and a thread calls it, I get the following error:</p>
  
  <p><strong>error</strong></p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: src/main/resources/certificates/apns-prod-cert.p12 (No such file or directory)</p>
  </blockquote>
  
  <p><strong>code</strong></p>
  
  <pre><code>private static String PATH_TO_P12_CERT = "src/main/resources/certificates/apns-prod-cert.p12";
  
  private String sendIOSPushNotification(String device_token, String topics, String title, String message)
          throws Exception {
      ApnsServiceBuilder serviceBuilder = APNS.newService();
          serviceBuilder.withCert(PATH_TO_P12_CERT, CERT_PASSWORD)
                  .withProductionDestination();
      ApnsService service = serviceBuilder.build();
      String payload = APNS.newPayload()
              .alertBody(message)
              .alertTitle(title)
              .sound("default")
              .customField("custom", "custom value").build();
      service.push(device_token, payload);
  
      return "iOS Push Notification: " + title + " " + message;
  }
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>How do I define the path to the <code>apns-prod-cert.p12</code>?</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><a href="https://i.stack.imgur.com/xAJR5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xAJR5.png" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><a href="https://i.stack.imgur.com/DROWI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DROWI.png" alt="enter image description here"></a></p>