I've been trying this app engine sample for Java 11+ which uses a JAR packaged
artifact that is installed locally:it provides a Main class to instantiate an
HTTP server to run an embedded web application WAR
file.github.com/GoogleCloudPlatform/java-docs-samples/tree/main/appengine-java11/appengine-simple-jetty-main
It has explicit jetty 11 dependencies.
The WAR project
isgithub.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine-java11/helloworld-servlet
The WAR is run in a local server with:
mvn exec:java -Dexec.args="../helloworld-servlet/target/helloworld.war"
The problem I have is when I include GWT in the WAR project this draws in Jetty
9 & other dependencieswhich get copied to the cloud-deployment dependencies
directory. I tried to prevent this with exclusions & explicit dependencies in
the WAR project but the final dependencies are always at least sightly affected
& cloud-deployfails with some kind of 503.
Currently I'm trying to use tomcat-embed-core but now the problem is locally
installed maven dependencies seem to be inaccessible at runtime. Is anyone
aware of any samples that can help ? Thanks
On Wednesday, 21 February 2024 at 11:17:19 GMT, Thomas Broyer
<[email protected]> wrote:
Fwiw, I haven't used WARs for years (and by years I mean more than a decade),
but the archetype is only there to help you get started with cleanly separated
client/shared/server modules, and I don't want to impose my own opinionated way
of building apps to others (or possibly start bikeshedding wars (sic!)), so I
chose a WAR target and tried to find a plugin to make it easy to run the app,
so Jetty it was (there used to be a Tomcat plugin that worked really well,
better than Jetty even, but it's been un maintained for years so…)Of course if
you want something that scaffolds everything for you, then go with Spring (I
personally can't stand this ecosystem but YMMV)
(also fwiw, I haven't really used Maven for years either, and never used
archetypes other than for quickly building bug repros/MCVEs or as
examples/inspiration for projects, that I always start from scratch)On
Wednesday, February 21, 2024 at 1:20:03 AM UTC+1 [email protected] wrote:
Now I have it all working. This is what I found:
Google App Engine Standard no longer gives you a web server, so you need to
provide your own.
- If you use https://github.com/tbroyer/gwt-maven-archetypes you get Jetty
when running in dev, but nothing when doing a mvn package (just a war file that
can be deployed to an existing web server - no good for Google App Engine).
- If you use https://github.com/NaluKit/gwt-maven-springboot-archetype you
get Embedded Tomcat, both in dev, and also when packaging to a war. So you can
run java -jar myapp.war and it'll start using the embedded Tomcat web server.
If you want to run on the cheap F1 Google App Engine instances, Tomcat is too
heavy, and you'll run out of memory. You can easily switch Spring Boot to use
Undertow, which is a lightweight web server, and runs great on the F1 instances.
Cheers.On Wednesday 27 December 2023 at 4:15:34 am UTC+11
[email protected] wrote:
Maybe this thread is gettig a bit off-topic for gwt ? maybe more suitable for
Stackoverflowor
https://groups.google.com/g/google-appengine
& https://groups.google.com/g/google-cloud-devnow superceded
byhttps://www.googlecloudcommunity.com/gc/Serverless/bd-p/cloud_serverless.
On Tuesday, December 26, 2023 at 12:21:05 AM UTC Craig Mitchell wrote:
Odd, my message was deleted. Maybe it was too boring. :-D
The highlights:
- I'm not sure if you get a Jetty server bundled or not if you use the
legacy bundled services. The documentation is a little ambiguous to me.
- You do get a stand alone server "dev server" that you can deploy a war to.
Great for final testing, but it's unclear if you'll be able to debug on it.
- Your static files worked because the legacy version allows a war file, and
you have the maven-war-plugin in your POM.
- If I switch to SpringBoot, I'll move my static files to either a /public
or /static directory.
Personally, I'm going to skip the legacy bundled services, and just use the
second-generation Java runtime with my own web server.
Cheers!
On Monday 25 December 2023 at 3:48:23 am UTC+11 [email protected] wrote:
Looks like Cloud CLI provides a dev server if using the legacy bundled
services (App Engine API JAR)?
https://cloud.google.com/appengine/docs/standard/java-gen2/services/accessIf
you are using the legacy bundled services, the second-generation Java runtimes
provide the Jetty web-serving
framework.https://cloud.google.com/appengine/migration-center/standard/migrate-to-second-gen/java-differences#framework_flexibilityThe
Google Cloud CLI for Java includes a local development server for testing your
application on your computer. The local development server emulates the App
Engine Java runtime environment and all of its services, including Datastore.
https://cloud.google.com/appengine/docs/standard/tools/using-local-server?tab=java
What do you think ?
Re. static files: in my setup appengine:deploy at base directory server project
deploys SNAPSHOT.war. Static files in \src\main\webapp end up in its root
directory. This:
https://stackoverflow.com/questions/71673962/while-running-as-a-jar-application-not-able-to-access-static-files-in-springboosays
in the case of a JAR-file, src/main/webapp has no special meaning and goes on
about jar directories that work with Springboot.
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit/bf837675-5a64-4cc5-8b1d-f4884be1a773n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit/1208567564.8230218.1708524673299%40mail.yahoo.com.