URLFetchServiceStreamHandler extends HttpURLConnection, not 
HttpsURLConnection. You can use HttpURLConnection to connect to https:// 
URLs though. 

The issue is that zendesk-java-client relies on Ning's AsyncHttpClient 
1.9.x which is doing things like this 
<https://github.com/AsyncHttpClient/async-http-client/blob/1.9.x/src/main/java/com/ning/http/client/providers/jdk/JDKAsyncHttpProvider.java#L184>
:

      if (request.getUri().getScheme().equals("https")) {
            HttpsURLConnection secure = (HttpsURLConnection) urlConnection;

It would not work on App Engine without some modifications to the source 
code to not try to cast java.net.URL to HttpsUrlConnection. Not all 
libraries will work on App Engine out of the box due to some quirks such as 
these

On Tuesday, February 14, 2017 at 4:03:28 PM UTC-5, Shachar Grembek wrote:
>
> Hi,
>
>
> I am using the Zendesk java client (
> https://github.com/cloudbees/zendesk-java-client) on my Google App Engine 
> server and I have a runtime issue that prevents me from using the SDK. Can 
> you please advise:
>
> When I call the Zendesk SDK, I get on the server:
>
>
> I am using JDK 7 with App Engine SDK 1.9.49
>
>
> Uncaught exception from servlet java.lang.ClassCastException: com.google.
> apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection 
> cannot be cast to javax.net.ssl.HttpsURLConnection 
> at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.
> createUrlConnection(JDKAsyncHttpProvider.java:184)
> at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(
> JDKAsyncHttpProvider.java:147)
> at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(
> JDKAsyncHttpProvider.java:118)
> at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.
> java:506) 
> at org.zendesk.client.v2.Zendesk.submit(Zendesk.java:1751) 
> at org.zendesk.client.v2.Zendesk.access$1300(Zendesk.java:90)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/b4a2c9e1-d230-4a29-8f40-56b49c98580b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to