spring-mvcamazon-ec2apple-push-notificationsjavapns

Where to upload keystore.p12 file for apple push notification on ec2 spring ( javapns)


I am trying to implement apple push notification (dev sandbox) within my spring project, using ( javapns ). I have created all the certificates & private key correctly ( and have checked the same from my local machine). Now when I upload "myck.p12" at the root of my spring project on ec2 instance and then when my code calls Push.alert(msg,"location of .p12 under root","password",token) - the program directly jumps into finally ( without giving any error ).

I also checked connection from my ec2 instance with telnet to apple's sandbox gateway and the connection is also fine.

Any help is appreciated. Could the issue be in locating keystore (.p12 file) ?

Code:

import javapns.Push;
import javapns.devices.Device;
import javapns.notification.PushNotificationPayload; 
import javapns.notification.PushedNotification;
import javapns.notification.ResponsePacket;

@Override
public void executePush () throws NetworkIOException {

try {

     List<PushedNotification>  notifications = Push.alert(message,"/env/tomcat/apache-tomcat-6.0.32/webapps/tapcliqweb/pushtestq.p12","mads",false,"fc382beb521a43859bdc8ce8ed9f636f3b2f20972c712d58f15e15704fe153f7");                 
 }
 catch(Exception e) {
        e.printStackTrace();
        e.getMessage();
 }
 finally {

        logger.debug("push attempt completed: finally");
  }

}

Solution

  • It turned out that I was missing required jar file : bcprov-jdk15-146.jar