Question

This is my first run at getting app engine working so maybe I just missed a step somewhere but I am trying to insert stuff into the app engine database like this

Builder endpointBuilder = new Manufacturerendpoint.Builder(AndroidHttp.newCompatibleTransport(),new JacksonFactory()
    , new HttpRequestInitializer() {
        public void initialize(HttpRequest httpRequest) { }
    });

    Manufacturerendpoint manufacturer = CloudEndpointUtils.updateBuilder(endpointBuilder).build();



    String[] manufacturers = this.getResources().getStringArray(R.array.manufacturers);
    ContentValues v = new ContentValues();
    ContentValues val = new ContentValues();
    for(int i = 0; i < manufacturers.length; i++){
        Manufacturer manu = new Manufacturer();
        manu.setManufacturerName(manufacturers[i]);
        manu.setManufacturerID(i);
        try{
            Manufacturer result = manufacturer.insertManufacturer(manu).execute();
            Log.d("TAG", "TAG");
        }catch(Exception e){
            e.printStackTrace();
        }

When I run this on the local server through the emulator it works fine but when I uploaded the code to app engine I get a response error

12-01 12:06:16.019: W/System.err(2589): com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
12-01 12:06:16.019: W/System.err(2589): Not Found
12-01 12:06:16.029: W/System.err(2589):     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:114)
12-01 12:06:16.029: W/System.err(2589):     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
12-01 12:06:16.029: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:417)
12-01 12:06:16.039: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:328)
12-01 12:06:16.039: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:449)
12-01 12:06:16.039: W/System.err(2589):     at com.tyczj.bowling.Bowlers.tables(Bowlers.java:716)
12-01 12:06:16.039: W/System.err(2589):     at com.tyczj.bowling.Bowlers.run(Bowlers.java:859)
12-01 12:06:16.039: W/System.err(2589):     at java.lang.Thread.run(Thread.java:856)
12-01 12:24:21.989: W/System.err(2589): javax.net.ssl.SSLException: Read error: ssl=0x670d1160: I/O error during system call, Connection reset by peer
12-01 12:24:22.029: W/System.err(2589):     at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
12-01 12:24:22.029: W/System.err(2589):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:664)
12-01 12:24:22.039: W/System.err(2589):     at libcore.io.Streams.readSingleByte(Streams.java:41)
12-01 12:24:22.039: W/System.err(2589):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:648)
12-01 12:24:22.039: W/System.err(2589):     at libcore.io.Streams.readAsciiLine(Streams.java:201)
12-01 12:24:22.049: W/System.err(2589):     at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
12-01 12:24:22.049: W/System.err(2589):     at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
12-01 12:24:22.049: W/System.err(2589):     at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
12-01 12:24:22.059: W/System.err(2589):     at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
12-01 12:24:22.059: W/System.err(2589):     at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
12-01 12:24:22.059: W/System.err(2589):     at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
12-01 12:24:22.059: W/System.err(2589):     at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:101)
12-01 12:24:22.059: W/System.err(2589):     at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
12-01 12:24:22.069: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:399)
12-01 12:24:22.069: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:328)
12-01 12:24:22.069: W/System.err(2589):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:449)
12-01 12:24:22.069: W/System.err(2589):     at com.tyczj.bowling.Bowlers.tables(Bowlers.java:716)
12-01 12:24:22.069: W/System.err(2589):     at com.tyczj.bowling.Bowlers.run(Bowlers.java:859)
12-01 12:24:22.079: W/System.err(2589):     at java.lang.Thread.run(Thread.java:856)

was there something else I was suppose to do? I was using this example as reference

Was it helpful?

Solution

While Google Cloud Endpoints is in the trusted tester phase, you will need to have your application whitelisted before you can deploy it. To be whitelisted, you must apply to the trusted tester program and be accepted. Currently, we've slowed the rate of acceptance, so you may not be accepted, or may be accepted after a long delay.

Local development, as you've seen, should work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top