Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

Reply
Contributor
budiman_lai
Posts: 21
Registered: ‎03-09-2011
My Device: Not Specified

net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

i'm a new developer in push notification. I already install Push SDK for WinXP and can run successfully. But I have some trouble:

  1. My app (client side) successfully instal in my BB 9650 and success register BIS PUSH. But when I check in "Subscriber by Application" (in Blackberry Debug Portal https://localhost:8443/debug-portal/subscriber_query.do, menu "Subscriber Management > Query by Application", Number of subscribers found is 0 user. Why?
  2. When I want to try send push data to device (in menu Push Management > Push and select application, in Subscriber field I fill "push_all"). but when I click "Send Push" I got error message "Unrecoverable error occurred. Please check application log files for more information." In log file I see "
    ERROR - [net.rim.pushsdk.debugportal.push.PushDataPushController.processSubmit()] - PushSDKException caught: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address: https://cpXXX.pushapi.eval.blackberry.com/mss/PD_pushRequest". why?

Please advice and sorry for my bad english :smileyhappy:

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

For #1 do you actually subscribe from the client-side? Is your server-side accessible from the Internet anc can you check that it received the registration from the device?

 

For #2, is there any other info in the log?

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
budiman_lai
Posts: 21
Registered: ‎03-09-2011
My Device: Not Specified

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

For 1#: do you actually subscribe from the client-side?

I'm using source code PushAgent.java and PushMessageReader.java from here http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample... to test Push Notification. Application runs fine until it comes out the message "Registered successfully for BIS push". So I assume has been successfully registered. Please correct me if i'm worng.

 

Is your server-side accessible from the Internet anc can you check that it received the registration from the device?

You mean is I must have IP static (public)? I use laptop with dynamic ip and push server install in localhost, not real server.

 

for 2#: this is full log:

ERROR - [net.rim.pushsdk.debugportal.push.PushDataPushController.processSubmit()] - PushSDKException caught:
net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address: https://cpXXX.pushapi.eval.blackberry.com/mss/PD_pushRequest
at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapServiceImpl.java:424)
at net.rim.pushsdk.pap.PapServiceImpl.pushToPpg(PapServiceImpl.java:387)
at net.rim.pushsdk.pap.PapServiceImpl.push(PapServiceImpl.java:152)
at net.rim.pushsdk.push.PushServiceImpl.push(PushServiceImpl.java:233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy10.push(Unknown Source)
at net.rim.pushsdk.debugportal.push.PushDataPushController.processSubmit(PushDataPushController.java:94)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
at sun.security.ssl.InputRecord.read(InputRecord.java:350)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:850)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at net.rim.pushsdk.commons.http.HttpClientImpl.transmitPOST(HttpClientImpl.java:92)
at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapServiceImpl.java:407)
... 49 more

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Could you try pushing again today? There were some issues with sending Push Messages through the EVAL server yesterday which have since been resolved.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
budiman_lai
Posts: 21
Registered: ‎03-09-2011
My Device: Not Specified

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Could you try pushing again today? There were some issues with sending Push Messages through the EVAL server yesterday which have since been resolved.

Yes, today I can send push message to my client app and my client-app can receive . Thank you for you help.

 

Next question is:

  1. If user not using or run client-app (not active), whatever it can receive push notification? Like facebook or twitter notification. If can't how to make it possible?
  2. I see this article about how to make application indicator icon in home screen. http://supportforums.blackberry.com/t5/Java-Development/Application-Indicators-and-Home-Screen-Integ... But the explanation is not complete, where I put the code? in public static void main(String[] args) {}? inside thread? Can you give me a complete sample?
  3. How to see my subscriber who using my application? I try in https://localhost:8443/debug-portal/subscriber_query.do in menu Subscriber Management > Query By Application, but my subscriber number still 0

Sorry if I ask many question :smileyhappy: because I'm a newbie in Push Notification development.

 

Regards & Thanks

Budiman

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

1. Both samples included with the Push Service SDK will receive pushes even when the app is closed or minimized by the user

2. The code should be used where you process the push data. For furtehr help with this I would suggest porting to the Java board.

3. Ideally you should have the client-side application perform a registration to your server. The subscriber query you mention is really only to synchronize subscribers on a periodic basis, not meant to be a means to check who is subscribed for every push.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Budiman if you are using the Push Service SDK Debug Portal helper application, as Garett mentioned, you need to subscribe from your device side application to the Debug Portal helper application. The Debug Portal helper application saves subscriptions in its persistent store - it keeps a subscriber id(username) -> PIN mapping. If you do subscribe with the Debug Portal then you can use the Subscriber Management -> Query Status in PPG menu option to find out if the subscriber id(username) you specify is subscribed with the RIM push server.

Please use plain text.
Regular Contributor
mdicesare
Posts: 78
Registered: ‎04-28-2010
My Device: BlackBerry 10 Dev Alpha
My Carrier: Rogers

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Also if you are looking how to set the application icon the Push SDK comes with hand held sample applications that demonstrate how to do this. Look at:

 

push-sdk-install-dir\sample-push-enabled-app\sample-push-enabled-app-1.0.1.10-sources.jar/pushdemo\com\rim\samples\device\push\PushController.java

 

private static void updateIndicator( int inc ) {
        //#ifndef HANDHELD_VERSION_42
        // update indicator if device software is 4.6 or greater
        ApplicationIndicatorRegistry indicatorRegistry = ApplicationIndicatorRegistry.getInstance();
        ApplicationIndicator indicator = indicatorRegistry.getApplicationIndicator();
        boolean refresh;
        if( indicator == null ) {
            ApplicationIcon icon = new ApplicationIcon( EncodedImage.getEncodedImageResource( "app_icon_small.png" ) );
            indicator = indicatorRegistry.register( icon, false, true );
            refresh = true;
        } else {
            refresh = inc == 0;
        }

        int unreadCount = 0;
        if( refresh ) {
            PushMessage[] messages = PersistentStorage.getMessages();
            for( int i = messages.length - 1; i >= 0; i-- ) {
                if( messages[ i ].isUnread() ) {
                    unreadCount++;
                }
            }
        } else {
            unreadCount = indicator.getValue() + inc;
        }

        indicator.setValue( unreadCount );
        if( unreadCount > 0 ) {
            indicator.setVisible( true );
        } else {
            indicator.setVisible( false );
        }
        //#endif
    }

 

Please use plain text.
Contributor
budiman_lai
Posts: 21
Registered: ‎03-09-2011
My Device: Not Specified

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Merry Christmas 2012 and Happy New Year 2013 all. Wish you all the best and dream come true in 2013. Sorry for late reply because i'm in holiday.

 

@gbeukeboom

Thank you for you help :smileywink: 

 

@mdicesare

Thank you very much for your code. I will test it in my application.

 

Please use plain text.
Contributor
budiman_lai
Posts: 21
Registered: ‎03-09-2011
My Device: Not Specified

Re: net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address

Hi gbeukeboom,

 

After i install PUSH SDK in my server, when i hit https://my_ip_server:8443/sample-push-initiator

I got error:

 

ERROR: Was unable to add a push application for the Sample Push Initiator due to the following reason:
DataAccessException caught finding application by id: 3xxx-8l1xxxxxxxxxxxxxx
The logs should be consulted for a full stack trace.

 

but I can open https://localhost:8443/sample-push-initiator correctly.

Note: I'm install PUSH SDK in 2 different machine. For Development I install in virtual box and for production I install in server (Fedora) and server can access from public, but for development can't.

 

Please advice.

Please use plain text.