Unable to launch in GAE












0














I'm trying to use the codebase to test connect a Google Cloud SQL instance with a GAE Application. I was able to run it successfully in local, but it seems that it gets deployed successfully also in AppEngine, but when I try to access myproject.appspot.com, I get a 404.



Following are the steps I followed (skipping the successful local related steps).




  1. Created a project myproject

  2. Created a Google Cloud SQL 2nd Generation instance, myproject-db

  3. Created a root user with a password.

  4. Used the connection string as indicated in Google Cloud Console "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&password=PASSWORD;"


  5. appengine-web.xml looks like below



    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>myproject</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
    <use-google-connector-j>true</use-google-connector-j>

    <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    <property name="cloudsql.url" value="jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"/>
    <property name="cloudsql.url.dev" value="jdbc:mysql://localhost/demo?user=root&amp;useSSL=false"/>
    </system-properties>
    </appengine-web-app>



  6. The following code snippet is embedded in HibernateJPAServlet



    if (System.getProperty("com.google.appengine.runtime.version")
    .startsWith("Google App Engine/")) {
    Class.forName("com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.driver",
    "com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.url",
    System.getProperty("cloudsql.url"));
    }



  7. I've uploaded the code from my local to default myproject repository



    https://source.developers.google.com/p/myproject/r/default



  8. I launched the Google Cloud Platform Console from the "Development" view.


  9. Successfully ran mvn clean package and mvn appengine:update. I cannot perform a appengine:update from my local due to firewall/proxy restrictions.

  10. So, at this point, my understanding is, I am running a GAE application and GAE Cloud SQL instance for the same project. So http://myproject.appspot.com/ should host the application I uploaded Step 8. But when I access it says "404" - "The requested URL / was not found on this server."


Just in case the problem is we can't deploy it from Cloud Console, then what other alternative do I have? I absolutely can't change network/proxy rules.



Edit



I tried running and deploying the application with mvn gcloud:run and mvn gcloud:deploy from outside proxy/firewall restrictions. At the end it clearly stated "Deployed URL: [https://myproject.appspot.com]". But the same issue remains when I access the same Url through browser.



Edit 2



I am able to see the error trace from App Engine dashboard. It is saying



" org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."


My connection string is "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&password=PASSWD123&"










share|improve this question
























  • Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
    – Eric Simonton
    Aug 6 '16 at 13:18










  • Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
    – Divs
    Aug 6 '16 at 18:25
















0














I'm trying to use the codebase to test connect a Google Cloud SQL instance with a GAE Application. I was able to run it successfully in local, but it seems that it gets deployed successfully also in AppEngine, but when I try to access myproject.appspot.com, I get a 404.



Following are the steps I followed (skipping the successful local related steps).




  1. Created a project myproject

  2. Created a Google Cloud SQL 2nd Generation instance, myproject-db

  3. Created a root user with a password.

  4. Used the connection string as indicated in Google Cloud Console "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"


  5. appengine-web.xml looks like below



    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>myproject</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
    <use-google-connector-j>true</use-google-connector-j>

    <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    <property name="cloudsql.url" value="jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"/>
    <property name="cloudsql.url.dev" value="jdbc:mysql://localhost/demo?user=root&amp;useSSL=false"/>
    </system-properties>
    </appengine-web-app>



  6. The following code snippet is embedded in HibernateJPAServlet



    if (System.getProperty("com.google.appengine.runtime.version")
    .startsWith("Google App Engine/")) {
    Class.forName("com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.driver",
    "com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.url",
    System.getProperty("cloudsql.url"));
    }



  7. I've uploaded the code from my local to default myproject repository



    https://source.developers.google.com/p/myproject/r/default



  8. I launched the Google Cloud Platform Console from the "Development" view.


  9. Successfully ran mvn clean package and mvn appengine:update. I cannot perform a appengine:update from my local due to firewall/proxy restrictions.

  10. So, at this point, my understanding is, I am running a GAE application and GAE Cloud SQL instance for the same project. So http://myproject.appspot.com/ should host the application I uploaded Step 8. But when I access it says "404" - "The requested URL / was not found on this server."


Just in case the problem is we can't deploy it from Cloud Console, then what other alternative do I have? I absolutely can't change network/proxy rules.



Edit



I tried running and deploying the application with mvn gcloud:run and mvn gcloud:deploy from outside proxy/firewall restrictions. At the end it clearly stated "Deployed URL: [https://myproject.appspot.com]". But the same issue remains when I access the same Url through browser.



Edit 2



I am able to see the error trace from App Engine dashboard. It is saying



" org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."


My connection string is "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&password=PASSWD123&"










share|improve this question
























  • Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
    – Eric Simonton
    Aug 6 '16 at 13:18










  • Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
    – Divs
    Aug 6 '16 at 18:25














0












0








0







I'm trying to use the codebase to test connect a Google Cloud SQL instance with a GAE Application. I was able to run it successfully in local, but it seems that it gets deployed successfully also in AppEngine, but when I try to access myproject.appspot.com, I get a 404.



Following are the steps I followed (skipping the successful local related steps).




  1. Created a project myproject

  2. Created a Google Cloud SQL 2nd Generation instance, myproject-db

  3. Created a root user with a password.

  4. Used the connection string as indicated in Google Cloud Console "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"


  5. appengine-web.xml looks like below



    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>myproject</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
    <use-google-connector-j>true</use-google-connector-j>

    <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    <property name="cloudsql.url" value="jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"/>
    <property name="cloudsql.url.dev" value="jdbc:mysql://localhost/demo?user=root&amp;useSSL=false"/>
    </system-properties>
    </appengine-web-app>



  6. The following code snippet is embedded in HibernateJPAServlet



    if (System.getProperty("com.google.appengine.runtime.version")
    .startsWith("Google App Engine/")) {
    Class.forName("com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.driver",
    "com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.url",
    System.getProperty("cloudsql.url"));
    }



  7. I've uploaded the code from my local to default myproject repository



    https://source.developers.google.com/p/myproject/r/default



  8. I launched the Google Cloud Platform Console from the "Development" view.


  9. Successfully ran mvn clean package and mvn appengine:update. I cannot perform a appengine:update from my local due to firewall/proxy restrictions.

  10. So, at this point, my understanding is, I am running a GAE application and GAE Cloud SQL instance for the same project. So http://myproject.appspot.com/ should host the application I uploaded Step 8. But when I access it says "404" - "The requested URL / was not found on this server."


Just in case the problem is we can't deploy it from Cloud Console, then what other alternative do I have? I absolutely can't change network/proxy rules.



Edit



I tried running and deploying the application with mvn gcloud:run and mvn gcloud:deploy from outside proxy/firewall restrictions. At the end it clearly stated "Deployed URL: [https://myproject.appspot.com]". But the same issue remains when I access the same Url through browser.



Edit 2



I am able to see the error trace from App Engine dashboard. It is saying



" org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."


My connection string is "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&password=PASSWD123&"










share|improve this question















I'm trying to use the codebase to test connect a Google Cloud SQL instance with a GAE Application. I was able to run it successfully in local, but it seems that it gets deployed successfully also in AppEngine, but when I try to access myproject.appspot.com, I get a 404.



Following are the steps I followed (skipping the successful local related steps).




  1. Created a project myproject

  2. Created a Google Cloud SQL 2nd Generation instance, myproject-db

  3. Created a root user with a password.

  4. Used the connection string as indicated in Google Cloud Console "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"


  5. appengine-web.xml looks like below



    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>myproject</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
    <use-google-connector-j>true</use-google-connector-j>

    <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    <property name="cloudsql.url" value="jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&amp;password=PASSWORD;"/>
    <property name="cloudsql.url.dev" value="jdbc:mysql://localhost/demo?user=root&amp;useSSL=false"/>
    </system-properties>
    </appengine-web-app>



  6. The following code snippet is embedded in HibernateJPAServlet



    if (System.getProperty("com.google.appengine.runtime.version")
    .startsWith("Google App Engine/")) {
    Class.forName("com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.driver",
    "com.mysql.jdbc.GoogleDriver");
    properties.put("javax.persistence.jdbc.url",
    System.getProperty("cloudsql.url"));
    }



  7. I've uploaded the code from my local to default myproject repository



    https://source.developers.google.com/p/myproject/r/default



  8. I launched the Google Cloud Platform Console from the "Development" view.


  9. Successfully ran mvn clean package and mvn appengine:update. I cannot perform a appengine:update from my local due to firewall/proxy restrictions.

  10. So, at this point, my understanding is, I am running a GAE application and GAE Cloud SQL instance for the same project. So http://myproject.appspot.com/ should host the application I uploaded Step 8. But when I access it says "404" - "The requested URL / was not found on this server."


Just in case the problem is we can't deploy it from Cloud Console, then what other alternative do I have? I absolutely can't change network/proxy rules.



Edit



I tried running and deploying the application with mvn gcloud:run and mvn gcloud:deploy from outside proxy/firewall restrictions. At the end it clearly stated "Deployed URL: [https://myproject.appspot.com]". But the same issue remains when I access the same Url through browser.



Edit 2



I am able to see the error trace from App Engine dashboard. It is saying



" org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost."


My connection string is "jdbc:google:mysql://myproject:us-central1:myproject-db/demo?user=root&password=PASSWD123&"







java hibernate maven google-app-engine google-cloud-sql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 21:56









halfer

14.3k758109




14.3k758109










asked Aug 5 '16 at 8:32









Divs

6311823




6311823












  • Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
    – Eric Simonton
    Aug 6 '16 at 13:18










  • Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
    – Divs
    Aug 6 '16 at 18:25


















  • Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
    – Eric Simonton
    Aug 6 '16 at 13:18










  • Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
    – Divs
    Aug 6 '16 at 18:25
















Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
– Eric Simonton
Aug 6 '16 at 13:18




Where do you see this 404 error? In a log? In your browser? Also, in step 8 you say you successfully ran mvn appengine:update, but then you say you cannot perform appengine:update. Which is it? Does that command succeed or fail?
– Eric Simonton
Aug 6 '16 at 13:18












Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
– Divs
Aug 6 '16 at 18:25




Hi Eric, I can't do mvn appengine:update from my local... However I can do the same from Google Cloud Console, but after the deployment is over, when I try to access myproject.appspot.com through a browser, I see the 404 error.
– Divs
Aug 6 '16 at 18:25












1 Answer
1






active

oldest

votes


















0














It was my Bad (also partially Documentation gap and I've given feedback too). Everytime we deploy the app through appengine or gcloud, the newly deployed version should be visible through the "App Engine > Versions" Tab. We should "Split Traffic" and give "100%" (for testing) to the Newly deployed version and then launch "https://myproject.appspot.com" to see the results we want to see.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38784723%2funable-to-launch-in-gae%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It was my Bad (also partially Documentation gap and I've given feedback too). Everytime we deploy the app through appengine or gcloud, the newly deployed version should be visible through the "App Engine > Versions" Tab. We should "Split Traffic" and give "100%" (for testing) to the Newly deployed version and then launch "https://myproject.appspot.com" to see the results we want to see.






    share|improve this answer


























      0














      It was my Bad (also partially Documentation gap and I've given feedback too). Everytime we deploy the app through appengine or gcloud, the newly deployed version should be visible through the "App Engine > Versions" Tab. We should "Split Traffic" and give "100%" (for testing) to the Newly deployed version and then launch "https://myproject.appspot.com" to see the results we want to see.






      share|improve this answer
























        0












        0








        0






        It was my Bad (also partially Documentation gap and I've given feedback too). Everytime we deploy the app through appengine or gcloud, the newly deployed version should be visible through the "App Engine > Versions" Tab. We should "Split Traffic" and give "100%" (for testing) to the Newly deployed version and then launch "https://myproject.appspot.com" to see the results we want to see.






        share|improve this answer












        It was my Bad (also partially Documentation gap and I've given feedback too). Everytime we deploy the app through appengine or gcloud, the newly deployed version should be visible through the "App Engine > Versions" Tab. We should "Split Traffic" and give "100%" (for testing) to the Newly deployed version and then launch "https://myproject.appspot.com" to see the results we want to see.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 10 '16 at 9:52









        Divs

        6311823




        6311823






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38784723%2funable-to-launch-in-gae%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Full-time equivalent

            Bicuculline

            さくらももこ