Endpoints work fine in local server, not when deployed

57 views
Skip to first unread message

Steve P

unread,
Jan 31, 2015, 1:30:54 PM1/31/15
to google-a...@googlegroups.com

Note: I'll use the terms "back end" and "front end" as practical concepts, as I don't profess know the subtleties of the definitions. I'm an advanced hobbyist programmer, not a professional. I'm using Eclipse Juno for development. Minimum Target is Android 2.3.3

I built a android app which I collect data on. I've deployed the android app to my phone and it's worked fine for a few years.

I generated an app-engine back end so I could store the data externally, as well as request the data from the datastore from time to time. All that works fine in the local development app engine environment.

I built a Google web app separately with which I access the web, google tools, etc and generate data which I store in datastore. Couple servlets, couple jsp pages. This application works fine. It is deployed to Google App Engine.

Next I wanted to get the data that the web app generated to my phone. After researching, experimenting with, and glazing over with Maven, modules, and more documentation overload to wade through and not understand, I found that if I just copied the endpoints from my originally generated app-engine back end to the Google web application, I could communicate with the web app from the android app in the local development server environment - running the android app on the emulator.

I then deployed the web application updated with the cloud endpoints to Google App Engine. The "front end" works as before.  I've tried to communicate with the deployed Web app from the android app running in the emulator and get the below error stream in the log.

It looks to me like the android app tries to connect and the app engine refuses the connection.

I realize there's not much concrete stuff to look at here, what should I post?

Thanks for your time and interest.

Steve

01-31 11:07:30.488: W/System.err(370): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) 01-31 11:07:30.498: W/System.err(370): at java.lang.Thread.run(Thread.java:1019) 01-31 11:07:37.328: W/System.err(370): javax.net.ssl.SSLException: Connection closed by peer 01-31 11:07:37.338: W/System.err(370): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method) 01-31 11:07:37.347: W/System.err(370): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:474) 01-31 11:07:37.347: W/System.err(370): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:328) 01-31 11:07:37.358: W/System.err(370): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.setupSecureSocket(HttpConnection.java:185) 01-31 11:07:37.368: W/System.err(370): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:433) 01-31 11:07:37.378: W/System.err(370): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:387) 01-31 11:07:37.378: W/System.err(370): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205) 01-31 11:07:37.387: W/System.err(370): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:152) 01-31 11:07:37.399: W/System.err(370): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:93) 01-31 11:07:37.399: W/System.err(370): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:965) 01-31 11:07:37.417: W/System.err(370): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410) 01-31 11:07:37.417: W/System.err(370): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343) 01-31 11:07:37.428: W/System.err(370): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460) 01-31 11:07:37.468: W/System.err(370): at com.topcaddiemobile.CourseGAEWebActivity$CheckListTask.doInBackground(CourseGAEWebActivity.java:181) 01-31 11:07:37.468: W/System.err(370): at com.topcaddiemobile.CourseGAEWebActivity$CheckListTask.doInBackground(CourseGAEWebActivity.java:1) 01-31 11:07:37.468: W/System.err(370): at android.os.AsyncTask$2.call(AsyncTask.java:185) 01-31 11:07:37.478: W/System.err(370): at

Kristopher Giesing

unread,
Feb 2, 2015, 4:32:24 AM2/2/15
to google-a...@googlegroups.com
As far as I know, the local development server doesn't support https/SSL.  So it's fairly understandable that you'd see differences between the dev server and a deployed server if you're communicating over SSL.  It's hard to say exactly what's going wrong here, but I would start from scratch and make sure you've configured SSL the way you intended.

Hope this helps,

- Kris

Vinny P

unread,
Feb 3, 2015, 3:44:18 AM2/3/15
to google-a...@googlegroups.com
On Sat, Jan 31, 2015 at 12:30 PM, Steve P <stevenp...@gmail.com> wrote:

I've tried to communicate with the deployed Web app from the android app running in the emulator and get the below error stream in the log.

It looks to me like the android app tries to connect and the app engine refuses the connection.

W/System.err(370): javax.net.ssl.SSLException: Connection closed by peer 01-31 11:07:37.338: W/System.err(370): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method) 01-31 11:07:37.347: W/System.err(370): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake


Just to be clear, your Endpoints app is deployed to production App Engine and you're attempting to connect via your emulator, correct?

It looks like your android emulator may have trouble connecting with SSL-enabled sites. Can you connect to another random site using SSL through the Android emulator? For instance, try going to https://www.ssllabs.com/ssltest/viewMyClient.html - do all the tests pass?


On Sat, Jan 31, 2015 at 12:30 PM, Steve P <stevenp...@gmail.com> wrote:

I realize there's not much concrete stuff to look at here, what should I post?


 
A full stack trace would be nice - I notice your error message seems to be cut off. 

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

Reply all
Reply to author
Forward
0 new messages