Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:33:14+00:00 2026-06-11T23:33:14+00:00

Using the awesome Java APNS by notnoop. https://github.com/notnoop/java-apns For some reason when I want

  • 0

Using the awesome Java APNS by notnoop. https://github.com/notnoop/java-apns

For some reason when I want to pull in my keystore the entire object that houses the APNS just blows up. Here it is below:

object Notification {
 val iosApnsDist = 
        APNS.newService()
        .withCert("/ipush.dist.p12", "password")
        .withSandboxDestination()
        .build()
}

For those that are familiar with Play!, files added to the conf folder are supposed to be available on the classpath. So I was a little confused as to why my reference would crash the app.

Below is a snippet from the APNS java source where the keystore is pulled in. Any thoughts?

public ApnsServiceBuilder withCert(String fileName, String password)
    throws RuntimeIOException, InvalidSSLConfig {
        FileInputStream stream = null;
        try {
            stream = new FileInputStream(fileName);
            return withCert(stream, password);
        } catch (FileNotFoundException e) {
            throw new RuntimeIOException(e);
        } finally {
            Utilities.close(stream);
        }
    }

Update

I was able to extract an error message while running a try/catch during bootup. Basically, it can’t find the file:

Caused by: com.notnoop.exceptions.RuntimeIOException: java.io.FileNotFoundException: \ipush.dev.p12 (The system cannot find the file specified)
        at com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:116)
        at engine.logic.notification.Notification$.<init>(Notification.scala:61)

I can confirm the file is indeed in the /conf folder, so what’s the cause?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:33:15+00:00Added an answer on June 11, 2026 at 11:33 pm

    Found the cause of this. Take note that Play! adds files to the classpath but FileInputStream actually does not refer to paths directly on the classpath. Instead, it uses paths on the file system.

    This previous StackOverflow will give the basics about getResourceAsStream vs. FileInputStream: getResourceAsStream() vs FileInputStream

    So going back to the original problem…it helped to have a look at the source code for the APNS. Notice that it uses FileInputStream but since Play! only adds it to the classpath then the source needs to be modified to use ClassLoader.class.getResourceAsStream(fileName).

    I suspect this will also apply to other open-source libraries out there as well.

    So why did the object crash? Because without a little error-catching it never would have initialized properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the awesome_nested_set gem located here https://github.com/collectiveidea/awesome_nested_set . I would like to
i'm building some components using iPOJO 's awesome EventAdmin handlers . the documentation requires
I'm using Ariel Flesler's awesome scrollto plugin . But I want to determine when
I've been using the CodeIgniter framework, however after learning Java and awesome features like
I'm using an awesome plugin to validate my form on the front-end: http://docs.jquery.com/Plugins/Validation .
I am using the awesome datatables jquery plugin, but I am having some issues
I'm using awesome_nested_set for my central website structure. I want to be able to
I'm using Font Awesome for icons in my website. I'm pretty new to HTML
I'm using font-awesome in a rails 3 app, and everything is ok in development
I am using the really awesome ruby ffi library to access functions in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.