I've raised an issue in Google-cloud-eclipse but the situation is as follows.
I can run a spring-boot application in google appengine standard using the java8 profile, to do this however requires removing the embedded tomcat engine.
If I add a SpringBootServletInitializer then the project never shows as started in eclipse. (despite having started).
Is there a convenient flow for developing against Google app engine including spring boot, that allows for code changes on the fly?
Issue raised against google-cloud-eclipse
Related
Tried
Subscribed trial for GoogleAppEngine.
1. INSTALLED GOOGLE APP ENGINE SDK
2. Downloaded the sample Java started code and deployed it. Working fine.
3. Used $appcfg.sh -A <appname> update target/appengine-try-java-1.0 to deploy
4. In this case, its a folder with all the webapp related stuffs
Question
In my case, I have a spring boot application which generates a jar file. It runs with a embedded container and I believe Google may have an alternate to deploy using Docker or some other way. But how?
There is no pointer or any details on how to run this in Google managed platform as far as I searched.
Any help or reference to documentation!! Alternates??
You can now use Google App Engine Java Flexible Environment - Java 8 Runtime:
https://cloud.google.com/appengine/docs/flexible/java/dev-java-only
It is Docker based
UPDATE:
You can now use Java 8 in App Engine Standard Environment:
Tutorial:
https://codelabs.developers.google.com/codelabs/cloud-app-engine-springboot/index.html
Example:
https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/springboot-appengine-standard
Blog post:
https://cloudplatform.googleblog.com/2017/09/Java-8-on-App-Engine-Standard-environment-is-now-generally-available.html
Google App Engine still uses Servlet 2.5 that is below the requirements of Spring Boot (i.e. Servlet 3.0).
There is a way to workaround that, check the documentation for more details
Spring Boot requires Servlet 3.0 which GAE does not have. WorkAround is to have a "spring-boot-legacy" dependency. You can check further how to implement: https://github.com/scratches/spring-boot-sample-gae
I have been using App Engine since last three years and recently started exploring AngularJS and Cloud Endpoints for creating web apps.
I started with this recipe given on Google developer's website and facing following problems since last three days. I am using Eclipse with GAE plugin - App Engine SDK 1.8.9. Used the plugin for generating the APIs.
Why it stops working on localhost when it was running fine just a few minutes ago? I get proxy html error now and then. Situation is like - sometimes it works, sometimes it doesn't!!
Why the same code when uploaded on GAE does not work at all (no data fetching or adding ) though things are working absolutely fine in API explorer?
Not posting my code since I am using the same code given in the above recipe.
My question is : why this surprising behavior - no consistency? Am I missing anything?
SOLVED:
We have to use https and not http. Working fine for me now.
I Have an GWT+GAE application with nosql database that runs fine in Google App Engine and in eclipse + gwt plugin with embedded jetty server on development environment.
Now in production environment, for many causes, i have to deploy this application on an external self managed server like Tomcat or JBoss.
I follow with no luck many tutorials and tips&tricks like:
https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT%27s
https://groups.google.com/forum/?fromgroups=#!topic/google-appengine-java/LYySmvqdbO8
or Link1 Link2 Link3 Link4 Link5
When I deploy my application on an external server (i.e. tomcat or jetty) it starts correctly but when I do a call that uses database connection it gives this error:
Caused by: java.lang.NullPointerException: No API environment is registered for this thread.
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:86)
at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:96)
at com.google.appengine.api.datastore.Query.<init>(Query.java:171)
at com.google.appengine.api.datastore.Query.<init>(Query.java:102)
at com.googlecode.objectify.impl.QueryImpl.<init>(QueryImpl.java:69)
at com.googlecode.objectify.impl.AsyncObjectifyImpl.query(AsyncObjectifyImpl.java:354)
at com.googlecode.objectify.impl.ObjectifyImpl.query(ObjectifyImpl.java:207)
at com.beoui.geocell.ObjectifyGeocellQueryEngine.query(ObjectifyGeocellQueryEngine.java:52)
at com.beoui.geocell.GeocellManager.proximitySearch(GeocellManager.java:381)
How can I deploy to external servers like Tomcat, JBOSS or Jetty?
Or it isn't possible at all?
My opinion is: whether the application runs correctly on eclipse embedded jetty, in some way is possible to configure an external jetty distribution to run the application
GAE comes with a set of services which are basically big external systems hidden behind an API. Local dev server is just a Jetty with an embedded database and an API layer mimicking the production GAE. You can not use the dev server for production purposes - it was not made for this and has no concurrency and reliability features of production system.
If you want to run GAE code somewhere else then production GAE service, take a look at AppScale or CapeDwarf.
Also, most links that you provided deal with running GWT app on Tomcat/Jetty, but you have problems with AppEngine. GWT and AppEngine are two separate technologies (which can work together, but it's not required).
I'm trying to read a sqlite db from the server side code in my gwt project. It throws AccessControlException. I looked a lot on the web and all solutions seems to be disabling Google App Engine, but when I do this, I can't run my project. I'm new to GWT and I have no idea where it runs when Google App Engine is shut down. I look for possibly this two solutions: Any setting that Google App Engine is set to be able to read any file, or other engine that I run my application on. Thanks
The problem is that Google App Engine (GAE) does not support sqlite (I assume you are reading it using JDBC).
If your intention is to make a GWT project that will not be deployed on GAE, you should create the project disabling this feature from the very beginning, because afterwards its a nightmare as you are experiencing right now.
If your intention is to deploy in GAE, you must use the google's persistence mechanisms (JDO) to store your data. SqlLite is off the table here.
The getting started tutorial for Google App Engine / GWT describes a very simple application using a single eclipse project (module). I'm porting a JPA / Hibernate based project to GAE and have a service layer module. It all compiles but when I attempt to run as a web-app from eclipse, obviously it doesn't have access to the service layer.
How do I get Eclipse to build a Jar, and include it (with the src) in the GWT project module - i.e. deployed to the WEB-INF/lib directory?
I can't believe that Google are not addressing this and seem to have just skimmed over this gaping hole.
You should use Ant and setup an Ant Builder that executes when you save your java classes to create the Jar
This should accomplish what you are looking for.