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
Highlighted
New Contributor
Posts: 5
Registered: ‎02-26-2013
My Device: Developer - Curve 9360 and others
My Carrier: Orange
Accepted Solution

Sending a push with the SDK's high-level sample results in a timeout

Hi,

 

I am trying to send a push with high-level sample. I have registered my App to the Blackberry Push Service Evaluation, deployed the SDK in Tomcat on my computer, added my app to the high-level sample's application list, and tried to send a simple push with a plain text message in broadcast (to the "push_all" subscriber).

This resulted in an IOException caused by a timeout : "IOException caught sending message to PPG URL address: https://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest".

 

I did some test :

 

1. I send a simple GET request in Forefox on https://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest which resulted in 401, so I can reach this adress.

 

2. I tried to reproduce the request with a Firefox plugin. Here is the content of  my request :

 

Headers :

 

Authorization: myBase64encodedcredentials

boundary: QfgeRDy0bk3pYpCMeL8Q

multipart/related

 

Content :

 

--QfgeRDy0bk3pYpCMeL8Q
Content-Type: application/xml; charset=UTF-8

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">
<pap>
<push-message push-id="bgsCVVfx6AD-1361888782229" deliver-before-timestamp="2013-02-26T15:26:22Z" source-reference="myApplicationID">
<address address-value="push_all"/>
<quality-of-service delivery-method="unconfirmed"/>
</push-message>
</pap>
--QfgeRDy0bk3pYpCMeL8Q
Content-Type: text/plain; charset=UTF-8
Push-Message-ID: bgsCVVfx6AD-1361888782229

test
--QfgeRDy0bk3pYpCMeL8Q--

 

 

This resulted in a timeout.

 

3. I tried the same request without the "multipart/related" header, and I received this response :

 

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"><pap><badmessage-response code="2000" desc="Received content type is not &apos;application/xml&apos;" bad-message-fragment="Received content type is not &apos;application/xml&apos;"/></pap>

 

So I guess it is not an authentication problem.

 

 

Do you know what could prevent the response to be sent ?

Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

Hi,

 

Hmm, nothing stands out at first glance.  And, number 3, seems to show that your requests can make it through to the PPG and get a response back.

 

Can you find the full stack trace in the logs and provide it here.

In your SDK install, look under the logs directory and in the PushSDK.log file specifically for it.

 

Thanks,

 

Matt

New Contributor
Posts: 5
Registered: ‎02-26-2013
My Device: Developer - Curve 9360 and others
My Carrier: Orange

Re: Sending a push with the SDK's high-level sample results in a timeout

[ Edited ]

Hi Matt,

 

Thank you for your reply. I tried to send an other push, here are the logs :

 

févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.pushappmgmt.PushAppMemoryDAOImpl.findById()] - id=3520-s90a94695e8r6tt8M620407im515e0a1302
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.pushappmgmt.PushApplicationServiceImpl.findByIdAndValidate()] - Push Application from persistent store: PushApplication ( net.rim.pushsdk.pushappmgmt.PushApplication@f17e83bb    id = 3520-s90a94695e8r6tt8M620407im515e0a1302    name = Business Lounge    version = BIS    username = null    enterpriseUsername = null    bdsUsername = null    publicPassword = @mypassword@    enterprisePassword = null    bdsPassword = null    description = Business Lounge is the Orange application dedicated to the professional customers. It offers B2B news, application recommendations and B2B customer care and services.    maxDailyQuota = 2000    status = ACTIVE    pushPort = 33298    publicNotifyUrl = null    enterpriseNotifyUrl = null    bdsNotifyUrl = null    storePushRequests = false    bypassSubscription = false    startDate = Wed Feb 20 11:28:28 CET 2013    expiryDate = Sun Jun 23 00:00:00 CEST 2013    createdDate = Tue Feb 26 11:30:44 CET 2013    modifiedDate = Tue Feb 26 15:26:17 CET 2013    modifiedBy = @mymail@    defaultPushLiveTime = 3600    isApplicationReliable = false    serviceLevel = Push Essentials    lastNotificationEnabled = false    autoDeleteRequests = false    type = Public Push     )
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.push.PushServiceImpl.validatePush()] - PushParameters ( net.rim.pushsdk.push.PushParameters@121ec8f    applicationId = 3520-s90a94695e8r6tt8M620407im515e0a1302    pushId = MkfNCemhYgd-1361891415194    deliverBeforeTimestamp = Thu Feb 28 17:10:15 CET 2013    isApplicationReliable = false    addresses = [push_all]    content = TextContent ( Content ( net.rim.pushsdk.commons.content.TextContent@ba8dfd    contentType = ContentType ( net.rim.pushsdk.commons.content.ContentType@1c00779    contentType = text/plain    parameters = {charset=UTF-8}     )    headers = HttpHeaderList ( net.rim.pushsdk.commons.http.HttpHeaderList@2ac4ea    headers = {}    upperCaseHeaders = {}     )     )    content = test     )     )
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.pushappmgmt.PushAppMemoryDAOImpl.findById()] - id=3520-s90a94695e8r6tt8M620407im515e0a1302
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.pushappmgmt.PushApplicationServiceImpl.findByIdAndValidate()] - Push Application from persistent store: PushApplication ( net.rim.pushsdk.pushappmgmt.PushApplication@f17e83bb    id = 3520-s90a94695e8r6tt8M620407im515e0a1302    name = Business Lounge    version = BIS    username = null    enterpriseUsername = null    bdsUsername = null    publicPassword = @mypassword@    enterprisePassword = null    bdsPassword = null    description = Business Lounge is the Orange application dedicated to the professional customers. It offers B2B news, application recommendations and B2B customer care and services.    maxDailyQuota = 2000    status = ACTIVE    pushPort = 33298    publicNotifyUrl = null    enterpriseNotifyUrl = null    bdsNotifyUrl = null    storePushRequests = false    bypassSubscription = false    startDate = Wed Feb 20 11:28:28 CET 2013    expiryDate = Sun Jun 23 00:00:00 CEST 2013    createdDate = Tue Feb 26 11:30:44 CET 2013    modifiedDate = Tue Feb 26 15:26:17 CET 2013    modifiedBy = @mymail@    defaultPushLiveTime = 3600    isApplicationReliable = false    serviceLevel = Push Essentials    lastNotificationEnabled = false    autoDeleteRequests = false    type = Public Push     )
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.push.PushServiceImpl.performSubscriptionValidation()] - Number of doNotExistSubscriberIds: 0
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.push.PushServiceImpl.performSubscriptionValidation()] - Number of inactiveSubscriberIds: 0
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.push.PushServiceImpl.performSubscriptionValidation()] - Number of suspendedSubscriberIds: 0
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.push.PushServiceImpl.performSubscriptionValidation()] - Number of activeAddresses: 1
févr. 26,2013 18:29:18 DEBUG - [net.rim.pushsdk.pap.PapServiceImpl.sendToPpg()] - 
Request content type header:
multipart/related; boundary=bACOY4tiOBcxvZdE85cm; type=application/xml
Request body: 
--bACOY4tiOBcxvZdE85cm
Content-Type: application/xml; charset=UTF-8

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">
<pap>
<push-message push-id="MkfNCemhYgd-1361891415194" deliver-before-timestamp="2013-02-28T16:10:15Z" source-reference="3520-s90a94695e8r6tt8M620407im515e0a1302">
<address address-value="push_all"/>
<quality-of-service delivery-method="unconfirmed"/>
</push-message>
</pap>
--bACOY4tiOBcxvZdE85cm
Content-Type: text/plain; charset=UTF-8
Push-Message-ID: MkfNCemhYgd-1361891415194

test
--bACOY4tiOBcxvZdE85cm--

févr. 26,2013 18:29:40 ERROR - [net.rim.pushsdk.pap.PapServiceImpl.push()] - PushSDKException caught: 
net.rim.pushsdk.commons.PushSDKException: IOException caught sending message to PPG URL address: https://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest
	at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapServiceImpl.java:487)
	at net.rim.pushsdk.pap.PapServiceImpl.pushToPpg(PapServiceImpl.java:446)
	at net.rim.pushsdk.pap.PapServiceImpl.push(PapServiceImpl.java:174)
	at net.rim.pushsdk.push.PushServiceImpl.push(PushServiceImpl.java:237)
	at net.rim.pushsdk.highlevelsample.push.PushDataPushController.processSubmit(PushDataPushController.java:167)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
	at sun.net.NetworkClient.doConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
	at net.rim.pushsdk.commons.http.HttpClientImpl.getUrlConnection(HttpClientImpl.java:295)
	at net.rim.pushsdk.commons.http.HttpClientImpl.transmitPOST(HttpClientImpl.java:119)
	at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapServiceImpl.java:466)
	... 37 more

 

PS : I removed my credentials from the logs.

Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

It looks like it's timing out for you:

Caused by: java.net.ConnectException: Connection timed out: connect

 

But, it's unclear why.  Could it be a firewall issue on your end that is preventing the request from going out somehow?

 

If you send me a private message with your application ID and password, I can try it myself and let you know if I get the same behaviour.

 

Thanks,

 

Matt

Retired
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

Is it possible you have firewall rules in place blocking your outgoing request?
New Contributor
Posts: 5
Registered: ‎02-26-2013
My Device: Developer - Curve 9360 and others
My Carrier: Orange

Re: Sending a push with the SDK's high-level sample results in a timeout

I use a proxy for HTTP and HTTPS, but it is properly configured in the internet configuration and I launched tomcat with the proper -Dhttp.proxyHost, -Dhttps.proxyHost, -Dhttp.proxyPort and -Dhttps.proxyPort options.

 

Matt, I sent you my credentials in a private message.

 

Thanks,

 

 

Julien

Retired
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

I am fairly confident the issue is with the firewall/proxy settings. Unfortunately, I can't be more specific than that. It seems that the HttpClientImpl that the Push Service SDK uses for some reason may not be picking up the -Dhttps.proxyHost and -Dhttps.proxyPort options.

Matthew will look at our server logs to see why some of your requests are making it in and others are timing out but I suspect we won't see anything in our server logs for those that are timing out.

The HttpClientImpl class uses the standard Java URL and HttpURLConnection classes so I am not sure what the exact problem is. But we tried sending numerous push requests and they are being accepted successfully so it's definitely something environmental with your system.
Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

I looked up two of your pushes above (bgsCVVfx6AD-1361888782229 and MkfNCemhYgd-1361891415194) in the eval logs and they don't show up.  So, it appears that the request is not even making it out to the BIS PPG.

 

New Contributor
Posts: 5
Registered: ‎02-26-2013
My Device: Developer - Curve 9360 and others
My Carrier: Orange

Re: Sending a push with the SDK's high-level sample results in a timeout

Hi,

 

I finally solved the problem !

Actually when I tried to reproduce the request I made a mistake in the headers, I put two different one instead of "Content-Type: multipart/related; boundary=QfgeRDy0bk3pYpCMeL8Q; type=application/xml". I tried again with the firefox plugin and obtain the same response as Matt told me in his private message, when he tested with my credentials :

 

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"><pap><push-response push-id="av6VIDIn2sQ-1361955166425" sender-address="http://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2013-02-27T10:48:40Z"><response-result code="2000" desc="No Active Subscribers for the Push Service"></response-result></push-response></pap>

 

For the serevr part I think it was due to a proxy issue as you said. I wasn't able to download the SDK linux installer on the Blackberry website so I installed the Windows SDK on my Windows computer, and I think the Java options were not used by the server (which is strange because I put it in the Java options of the Tomcat service). I copied the SDK's folder on my Linux computer, added the Java options in catalina.sh and everything worked fine with the high-level sample. So I guess the problem comes from my Java configuration in Windows.

 

The tricky thing I don't really understand is the timeout for the request with the wrong headers.

 

Now I have to find out why the app doesn't subscribe to the push service, but this is another problem.

 


Thanks to all !

 

 

Julien

Retired
Posts: 311
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Sending a push with the SDK's high-level sample results in a timeout

Glad to hear you're making progress Julien.  Just curious, why weren't you able to download the SDK's Linux installer?  It wasn't compatible with the version of Linux you run?

 

Matt