Tuesday, December 26, 2023

Re: Deploy to Google App Engine (GAE)

Maybe this thread is gettig a bit off-topic for gwt ? maybe more suitable for Stackoverflow
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 tim_mac...@yahoo.co.uk wrote:
Looks like Cloud CLI provides a dev server if  using the legacy bundled services (App Engine API JAR)?
If 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_flexibility
The 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.
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. 
says 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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/7a0e597d-da6d-4583-b504-9e8d18aa7e6bn%40googlegroups.com.

Monday, December 25, 2023

Re: Deploy to Google App Engine (GAE)

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 tim_mac...@yahoo.co.uk wrote:
Looks like Cloud CLI provides a dev server if  using the legacy bundled services (App Engine API JAR)?
If 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_flexibility
The 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.
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. 
says 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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/1d958b8c-9fee-4c7f-9387-cf7aca3a6e22n%40googlegroups.com.

Sunday, December 24, 2023

Re: Deploy to Google App Engine (GAE)

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/access
If 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_flexibility
The 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.
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. 
says 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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/3efb5967-695f-4939-9986-2a35353f9606n%40googlegroups.com.

Saturday, December 23, 2023

Re: Deploy to Google App Engine (GAE)

Thanks again Tim!

> Afaik gwt:devmode is launching  a GWT Jetty, rather than the GAE Jetty.
> The latter requires appengine:run

This is no longer an option.  appengine:run no longer works with Java17.  You have to provide your own web server.  See https://cloud.google.com/appengine/migration-center/standard/migrate-to-second-gen/java-differences#key-differences

I'm still trying to figure out if I can just use the bundled GWT Jetty server, or do I include my own Jetty / Embedded Tomcat / ... server.

> As you say: for IDE debugging: we need a Remote Java Application & jvmFlags, discussed at length here:

Thank you!  Those options work much better.  In IntelliJ, I've now setup a "compound" launcher that launches both the gwt:devmode and the remote JVM debug at the same time.

> With this setup the dev GAE server uses the cloud datastore (& blobstore I think).
> To fix, in the gloud CLI app run:
> gcloud components install cloud-datastore-emulator
> before launch of GAE server run:
> gcloud beta emulators datastore start --project='prjname' --host-port=localhost:8081 --data-dir=C:\Users\tim_m\eclipse-workspace\Snptn\Snptn-server\src\main\webapp

I tried this, and the emulator starts no problem.  However, I still get the "No API environment is registered for this thread.".

I might switch to use SpringBoot, then it'll use its Jetty server, and I'll switch away from the GWT Jetty server (and just use the GWT code server), and then it'll hopefully magically work.

> Re  copying src/main/webapp files to the target folder: afaik that is done by
> maven-jar-plugin jar goal (jar:jar) which is invoked by calling package (phase)

I figured it out.  It's because GAE wants an executable JAR ( https://cloud.google.com/appengine/docs/standard/testing-and-deploying-your-app?tab=java#other_deployment_options ), however, the src/main/webapp files are only copied when creating a war with the maven-war-plugin.

I'll need to figure out how to include the static files with an executable JAR, or if I switch to SpringBoot, I think SpringBoot handles this for me.

> Btw I often read that the tbroyer multi-project pattern is better because it keeps server & client dependencies separated, but its a more complex pattern.

I might end up changing to this structure.  I wanted to keep it as simple as possible, as my project isn't complicated, but might still be a better option.

Cheers!

On Sunday 24 December 2023 at 5:28:35 am UTC+11 tim_mac...@yahoo.co.uk wrote:
Afaik gwt:devmode is launching  a GWT Jetty, rather than the GAE Jetty.
The latter requires appengine:run
with a launch profile env property & name
appengine:run -Denv=haslistener

As you say: for IDE debugging: we need a Remote Java Application & jvmFlags, discussed at length here:
https://stackoverflow.com/questions/138511/what-are-java-command-line-options-to-set-to-allow-jvm-to-be-remotely-debugged
someone says:
For Java 5 and above, run it with:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044
rather than
Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n
I havent tried this yet.

With this setup the dev GAE server uses the cloud datastore (& blobstore I think).
To fix, in the gloud CLI app run:
gcloud components install cloud-datastore-emulator
If you didnt install beta commands, it will prompt for that.
cloud-datastore-emulator 2.3.1
before launch of GAE server run:
gcloud beta emulators datastore start --project='prjname' --host-port=localhost:8081 --data-dir=C:\Users\tim_m\eclipse-workspace\Snptn\Snptn-server\src\main\webapp

Set environment variable in the eclipse launch to attach this DATASTORE_EMULATOR environment
Last time I looked: the local datastore viewer cant show objectify entities, only blobstore files.

Re  copying src/main/webapp files to the target folder: afaik that is done by
maven-jar-plugin jar goal (jar:jar) which is invoked by calling package (phase)
 
Btw I often read that the tbroyer multi-project pattern is better because it keeps server & client dependencies separated, but its a more complex pattern.
Re the poms I attached here: 1 problem is inconsistencies in:
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>

    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>

On Saturday, December 23, 2023 at 7:35:42 AM UTC Craig Mitchell wrote:
Managed to get server debugging working by adding:

<jvmArg>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</jvmArg>

to the gwt-maven-plugin.

And then creating a Remote JVM Debug launcher in IntelliJ (on port 5005), that I run after running gwt:devmode.

I'm surprised IntelliJ can't just automatically attach to the running server.  Is this what everyone does that uses gwt:devmode?

On Saturday 23 December 2023 at 3:28:36 pm UTC+11 Craig Mitchell wrote:
Thanks Tim!  Looking at your POM files, I see I missed adding:

<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>

I also needed to:
  • Convert all my servlets to @WebServlet (as the GWT Jetty server didn't pick up my web.xml like the GAE server used to).
  • Give the GWT plugin the JVM arg "--add-opens java.base/java.lang=ALL-UNNAMED" for execeptions to be returned to the client.
Strangely, Maven isn't copying my src/main/webapp files to the target folder, so I'm doing that manually with the maven-resources-plugin.

So now GWT starts, dev compiles (including source maps), and runs beautifully, including RPC calls.  Java17 runtime with a Java11 source level.  Happy days!  New POM attached.

I've switched from using Eclipse to IntelliJ (because I no longer will be using any of the Eclipse plugins, and wanted a fresh start).  However, debugging my server never hits the breakpoints.

Do you use IntelliJ, do we need any special params to enable debug?

debug.png

I'm yet to get Google App Engine to work.  When I try to access any of the GAE calls, I just get "No API environment is registered for this thread.".  I think I need to setup the enviroment somehow now I no longer have a GAE server.

Cheers!

On Friday 22 December 2023 at 4:41:07 am UTC+11 tim_mac...@yahoo.co.uk wrote:
These are my current poms, based on the tbroyer archetype.
Probably best to look at the latter first if youre not familiar with it.

The launch is configured in the server pom:

    <profile>
      <id>env-dev-gae1</id>
      <activation>
        <property>  
          <name>env</name>
          <value>haslistener</value>
...
      <build>                    
        <pluginManagement>
          ...

              <groupId>com.google.cloud.tools</groupId>
              <artifactId>appengine-maven-plugin</artifactId>

A version of Jetty is attached by the appengine-maven-plugin config here (afaik)
The eclipse launch goal is: appengine:run -Denv=haslistener

Re GWT 2.10 : it can use JRE 17 but can only compile Java 11 source, iirc.

Poms are a bit messy but should help if you want to take this approach

On Thursday, December 21, 2023 at 11:36:51 AM UTC Craig Mitchell wrote:
Forgot to mention.  My target is Java 17, but my source is Java 1.8.

So:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

And:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>

I've attached my current POM (which isn't working, so don't copy it 🙂), but if you can see my mistake, please let me know.

Thanks again!
On Thursday 21 December 2023 at 10:27:01 pm UTC+11 Craig Mitchell wrote:
Hi Tim,

I thought GWT 2.10.0 supported Java17.  From the release notes:   https://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0
Tested support for running on Java 17, dropped remaining support for running on Java 7.

I'm also using appengine-maven-plugin 2.5.0.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

Along with GWT plugin:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<packaging>gwt-lib</packaging>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
<warDir>${project.build.directory}/drift-team-1.0-SNAPSHOT</warDir>
<startupUrls>
<startupUrl>index.html</startupUrl>
</startupUrls>
</configuration>
</plugin>

Running: "mvn gwt:devmode" I can get it to start the Jetty server and GWT code server.  It finds my project, but currently, when opening the browser it says:
HTTP ERROR 503 Service Unavailable
URI: /index.html
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -

I put my web assets in  src/main/webapp  and I don't think it's seeing them.  Plus I don't think it's seeing my web.xml that's in  src/main/webapp/WEB-INF/web.xml

Maybe they need to be copied to the target directory or somewhere, or the GWT plugin pointed to where they are somehow.  Not sure.  Any help is greatly appreaciated.


On Thursday 21 December 2023 at 4:06:46 am UTC+11 tim_mac...@yahoo.co.uk wrote:
I havent tried raising the Java level yet, its still  JavaSE-1.8.
Got as far as using latest versions:
JDK 21
gcloud CLI app & cloudSdkVersion  457.0.0
appengine-maven-plugin 2.5.0

To get it to run, so far:
1 I had to remove all DOCTYPE declarations in xml files in the server project (new restrictions on DTD)
2 appengine-maven-plugin 2.5.0 requires:
                <configuration>
                    <jvmFlags>
                        <item>--add-opens</item>
                <item>java.base/java.util=ALL-UNNAMED</item>
This stops 500 Server Error which I've not seen before:
GCLOUD: java.lang.reflect.InaccessibleObjectException:
Unable to make field accessible: module java.base does not "opens java.util" to unnamed module @2c95ac9e

So Craig, you say with Java17 on GAE, there isn't a web server included anymore.
So this has to be defined somewhere in  appengine-maven-plugin ?
The minimum level to avoid being shut down on GAE standard is >8
& 11 is the max for GWT, so that would seem do for now, why Java 17  ?

On Wednesday, December 20, 2023 at 4:46:03 AM UTC Craig Mitchell wrote:
No worries not posting the POMs Tim.

The bit I'm struggling with, the old Java 8 version had its own GAE server.  So I would run that, and a GWT Code Server.  Easy!

btw: I'm talking about GAE Standard.  GAE Flexible you can do whatever you want, but that's more work and more expensive.

Now with the upgrade to Java17 on GAE, there isn't a web server included anymore.  It's up to you to supply one.  I would assume when you deploy it, it doesn't actually use your server, but what setup is GAE expecting for the deploy?

I see there is a SpringBoot GAE example, so it might be easier to use that, and get GWT to work with SpringBoot.  Not sure.  Very interested to hear what you're doing.

Thanks!

On Wednesday 20 December 2023 at 1:51:55 pm UTC+11 tim_mac...@yahoo.co.uk wrote:
For some years I've been deploying GWT 2.8.2 to GAE with Maven & Google Cloud Tools.
I now find GAE is not supporting Java 8 after January, so currently upgrading (rather slowly).
There are 4 long POM files,  probably better to mail them then post a distilled version here ?

On Sunday, December 17, 2023 at 5:20:56 AM UTC Craig Mitchell wrote:
Hi,

The instructions here https://www.gwtproject.org/doc/latest/tutorial/appengine.html are no longer valid, as the Google Plugin for Eclipse is now dead (Google no longer supports Java 1.8, and the Google Plugin for Eclipse doesn't support any Eclipse versions that support anything after Java 1.8).  Ref:  https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/3710

The new approach with GAE is to use Maven or Gradle with Google Cloud Tools.

I've been struggling to work out how this is supposed to happen.  It looks like we now have to provide our own Web Server for GAE, but can we use the Jetty server that GWT uses for development?  I assume the deploy build would not include the Jetty web server?

If anyone has deployed a GWT app to GAE with Maven and the new Google Cloud Tools, it would be great if you could give high level instructions on how it's all supposed to fit together.

An example Maven POM file with both the Google Cloud Tools, and GWT would be even better.  🙂

Thanks!

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/7dd35338-e08b-40b2-ac55-3ca6516033b4n%40googlegroups.com.

Re: Deploy to Google App Engine (GAE)

Afaik gwt:devmode is launching  a GWT Jetty, rather than the GAE Jetty.
The latter requires appengine:run
with a launch profile env property & name
appengine:run -Denv=haslistener

As you say: for IDE debugging: we need a Remote Java Application & jvmFlags, discussed at length here:
https://stackoverflow.com/questions/138511/what-are-java-command-line-options-to-set-to-allow-jvm-to-be-remotely-debugged
someone says:
For Java 5 and above, run it with:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044
rather than
Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n
I havent tried this yet.

With this setup the dev GAE server uses the cloud datastore (& blobstore I think).
To fix, in the gloud CLI app run:
gcloud components install cloud-datastore-emulator
If you didnt install beta commands, it will prompt for that.
cloud-datastore-emulator 2.3.1
before launch of GAE server run:
gcloud beta emulators datastore start --project='prjname' --host-port=localhost:8081 --data-dir=C:\Users\tim_m\eclipse-workspace\Snptn\Snptn-server\src\main\webapp

Set environment variable in the eclipse launch to attach this DATASTORE_EMULATOR environment
Last time I looked: the local datastore viewer cant show objectify entities, only blobstore files.

Re  copying src/main/webapp files to the target folder: afaik that is done by
maven-jar-plugin jar goal (jar:jar) which is invoked by calling package (phase)
 
Btw I often read that the tbroyer multi-project pattern is better because it keeps server & client dependencies separated, but its a more complex pattern.
Re the poms I attached here: 1 problem is inconsistencies in:
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>

    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>

On Saturday, December 23, 2023 at 7:35:42 AM UTC Craig Mitchell wrote:
Managed to get server debugging working by adding:

<jvmArg>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</jvmArg>

to the gwt-maven-plugin.

And then creating a Remote JVM Debug launcher in IntelliJ (on port 5005), that I run after running gwt:devmode.

I'm surprised IntelliJ can't just automatically attach to the running server.  Is this what everyone does that uses gwt:devmode?

On Saturday 23 December 2023 at 3:28:36 pm UTC+11 Craig Mitchell wrote:
Thanks Tim!  Looking at your POM files, I see I missed adding:

<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>

I also needed to:
  • Convert all my servlets to @WebServlet (as the GWT Jetty server didn't pick up my web.xml like the GAE server used to).
  • Give the GWT plugin the JVM arg "--add-opens java.base/java.lang=ALL-UNNAMED" for execeptions to be returned to the client.
Strangely, Maven isn't copying my src/main/webapp files to the target folder, so I'm doing that manually with the maven-resources-plugin.

So now GWT starts, dev compiles (including source maps), and runs beautifully, including RPC calls.  Java17 runtime with a Java11 source level.  Happy days!  New POM attached.

I've switched from using Eclipse to IntelliJ (because I no longer will be using any of the Eclipse plugins, and wanted a fresh start).  However, debugging my server never hits the breakpoints.

Do you use IntelliJ, do we need any special params to enable debug?

debug.png

I'm yet to get Google App Engine to work.  When I try to access any of the GAE calls, I just get "No API environment is registered for this thread.".  I think I need to setup the enviroment somehow now I no longer have a GAE server.

Cheers!

On Friday 22 December 2023 at 4:41:07 am UTC+11 tim_mac...@yahoo.co.uk wrote:
These are my current poms, based on the tbroyer archetype.
Probably best to look at the latter first if youre not familiar with it.

The launch is configured in the server pom:

    <profile>
      <id>env-dev-gae1</id>
      <activation>
        <property>  
          <name>env</name>
          <value>haslistener</value>
...
      <build>                    
        <pluginManagement>
          ...

              <groupId>com.google.cloud.tools</groupId>
              <artifactId>appengine-maven-plugin</artifactId>

A version of Jetty is attached by the appengine-maven-plugin config here (afaik)
The eclipse launch goal is: appengine:run -Denv=haslistener

Re GWT 2.10 : it can use JRE 17 but can only compile Java 11 source, iirc.

Poms are a bit messy but should help if you want to take this approach

On Thursday, December 21, 2023 at 11:36:51 AM UTC Craig Mitchell wrote:
Forgot to mention.  My target is Java 17, but my source is Java 1.8.

So:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

And:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>

I've attached my current POM (which isn't working, so don't copy it 🙂), but if you can see my mistake, please let me know.

Thanks again!
On Thursday 21 December 2023 at 10:27:01 pm UTC+11 Craig Mitchell wrote:
Hi Tim,

I thought GWT 2.10.0 supported Java17.  From the release notes:   https://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0
Tested support for running on Java 17, dropped remaining support for running on Java 7.

I'm also using appengine-maven-plugin 2.5.0.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

Along with GWT plugin:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<packaging>gwt-lib</packaging>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
<warDir>${project.build.directory}/drift-team-1.0-SNAPSHOT</warDir>
<startupUrls>
<startupUrl>index.html</startupUrl>
</startupUrls>
</configuration>
</plugin>

Running: "mvn gwt:devmode" I can get it to start the Jetty server and GWT code server.  It finds my project, but currently, when opening the browser it says:
HTTP ERROR 503 Service Unavailable
URI: /index.html
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -

I put my web assets in  src/main/webapp  and I don't think it's seeing them.  Plus I don't think it's seeing my web.xml that's in  src/main/webapp/WEB-INF/web.xml

Maybe they need to be copied to the target directory or somewhere, or the GWT plugin pointed to where they are somehow.  Not sure.  Any help is greatly appreaciated.


On Thursday 21 December 2023 at 4:06:46 am UTC+11 tim_mac...@yahoo.co.uk wrote:
I havent tried raising the Java level yet, its still  JavaSE-1.8.
Got as far as using latest versions:
JDK 21
gcloud CLI app & cloudSdkVersion  457.0.0
appengine-maven-plugin 2.5.0

To get it to run, so far:
1 I had to remove all DOCTYPE declarations in xml files in the server project (new restrictions on DTD)
2 appengine-maven-plugin 2.5.0 requires:
                <configuration>
                    <jvmFlags>
                        <item>--add-opens</item>
                <item>java.base/java.util=ALL-UNNAMED</item>
This stops 500 Server Error which I've not seen before:
GCLOUD: java.lang.reflect.InaccessibleObjectException:
Unable to make field accessible: module java.base does not "opens java.util" to unnamed module @2c95ac9e

So Craig, you say with Java17 on GAE, there isn't a web server included anymore.
So this has to be defined somewhere in  appengine-maven-plugin ?
The minimum level to avoid being shut down on GAE standard is >8
& 11 is the max for GWT, so that would seem do for now, why Java 17  ?

On Wednesday, December 20, 2023 at 4:46:03 AM UTC Craig Mitchell wrote:
No worries not posting the POMs Tim.

The bit I'm struggling with, the old Java 8 version had its own GAE server.  So I would run that, and a GWT Code Server.  Easy!

btw: I'm talking about GAE Standard.  GAE Flexible you can do whatever you want, but that's more work and more expensive.

Now with the upgrade to Java17 on GAE, there isn't a web server included anymore.  It's up to you to supply one.  I would assume when you deploy it, it doesn't actually use your server, but what setup is GAE expecting for the deploy?

I see there is a SpringBoot GAE example, so it might be easier to use that, and get GWT to work with SpringBoot.  Not sure.  Very interested to hear what you're doing.

Thanks!

On Wednesday 20 December 2023 at 1:51:55 pm UTC+11 tim_mac...@yahoo.co.uk wrote:
For some years I've been deploying GWT 2.8.2 to GAE with Maven & Google Cloud Tools.
I now find GAE is not supporting Java 8 after January, so currently upgrading (rather slowly).
There are 4 long POM files,  probably better to mail them then post a distilled version here ?

On Sunday, December 17, 2023 at 5:20:56 AM UTC Craig Mitchell wrote:
Hi,

The instructions here https://www.gwtproject.org/doc/latest/tutorial/appengine.html are no longer valid, as the Google Plugin for Eclipse is now dead (Google no longer supports Java 1.8, and the Google Plugin for Eclipse doesn't support any Eclipse versions that support anything after Java 1.8).  Ref:  https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/3710

The new approach with GAE is to use Maven or Gradle with Google Cloud Tools.

I've been struggling to work out how this is supposed to happen.  It looks like we now have to provide our own Web Server for GAE, but can we use the Jetty server that GWT uses for development?  I assume the deploy build would not include the Jetty web server?

If anyone has deployed a GWT app to GAE with Maven and the new Google Cloud Tools, it would be great if you could give high level instructions on how it's all supposed to fit together.

An example Maven POM file with both the Google Cloud Tools, and GWT would be even better.  🙂

Thanks!

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/c9aadbf3-532a-4c5c-8072-00e5ad7e9413n%40googlegroups.com.

Friday, December 22, 2023

Re: Deploy to Google App Engine (GAE)

Managed to get server debugging working by adding:

<jvmArg>-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</jvmArg>

to the gwt-maven-plugin.

And then creating a Remote JVM Debug launcher in IntelliJ (on port 5005), that I run after running gwt:devmode.

I'm surprised IntelliJ can't just automatically attach to the running server.  Is this what everyone does that uses gwt:devmode?

On Saturday 23 December 2023 at 3:28:36 pm UTC+11 Craig Mitchell wrote:
Thanks Tim!  Looking at your POM files, I see I missed adding:

<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>

I also needed to:
  • Convert all my servlets to @WebServlet (as the GWT Jetty server didn't pick up my web.xml like the GAE server used to).
  • Give the GWT plugin the JVM arg "--add-opens java.base/java.lang=ALL-UNNAMED" for execeptions to be returned to the client.
Strangely, Maven isn't copying my src/main/webapp files to the target folder, so I'm doing that manually with the maven-resources-plugin.

So now GWT starts, dev compiles (including source maps), and runs beautifully, including RPC calls.  Java17 runtime with a Java11 source level.  Happy days!  New POM attached.

I've switched from using Eclipse to IntelliJ (because I no longer will be using any of the Eclipse plugins, and wanted a fresh start).  However, debugging my server never hits the breakpoints.

Do you use IntelliJ, do we need any special params to enable debug?

debug.png

I'm yet to get Google App Engine to work.  When I try to access any of the GAE calls, I just get "No API environment is registered for this thread.".  I think I need to setup the enviroment somehow now I no longer have a GAE server.

Cheers!

On Friday 22 December 2023 at 4:41:07 am UTC+11 tim_mac...@yahoo.co.uk wrote:
These are my current poms, based on the tbroyer archetype.
Probably best to look at the latter first if youre not familiar with it.

The launch is configured in the server pom:

    <profile>
      <id>env-dev-gae1</id>
      <activation>
        <property>  
          <name>env</name>
          <value>haslistener</value>
...
      <build>                    
        <pluginManagement>
          ...

              <groupId>com.google.cloud.tools</groupId>
              <artifactId>appengine-maven-plugin</artifactId>

A version of Jetty is attached by the appengine-maven-plugin config here (afaik)
The eclipse launch goal is: appengine:run -Denv=haslistener

Re GWT 2.10 : it can use JRE 17 but can only compile Java 11 source, iirc.

Poms are a bit messy but should help if you want to take this approach

On Thursday, December 21, 2023 at 11:36:51 AM UTC Craig Mitchell wrote:
Forgot to mention.  My target is Java 17, but my source is Java 1.8.

So:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

And:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>

I've attached my current POM (which isn't working, so don't copy it 🙂), but if you can see my mistake, please let me know.

Thanks again!
On Thursday 21 December 2023 at 10:27:01 pm UTC+11 Craig Mitchell wrote:
Hi Tim,

I thought GWT 2.10.0 supported Java17.  From the release notes:   https://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0
Tested support for running on Java 17, dropped remaining support for running on Java 7.

I'm also using appengine-maven-plugin 2.5.0.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

Along with GWT plugin:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<packaging>gwt-lib</packaging>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
<warDir>${project.build.directory}/drift-team-1.0-SNAPSHOT</warDir>
<startupUrls>
<startupUrl>index.html</startupUrl>
</startupUrls>
</configuration>
</plugin>

Running: "mvn gwt:devmode" I can get it to start the Jetty server and GWT code server.  It finds my project, but currently, when opening the browser it says:
HTTP ERROR 503 Service Unavailable
URI: /index.html
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -

I put my web assets in  src/main/webapp  and I don't think it's seeing them.  Plus I don't think it's seeing my web.xml that's in  src/main/webapp/WEB-INF/web.xml

Maybe they need to be copied to the target directory or somewhere, or the GWT plugin pointed to where they are somehow.  Not sure.  Any help is greatly appreaciated.


On Thursday 21 December 2023 at 4:06:46 am UTC+11 tim_mac...@yahoo.co.uk wrote:
I havent tried raising the Java level yet, its still  JavaSE-1.8.
Got as far as using latest versions:
JDK 21
gcloud CLI app & cloudSdkVersion  457.0.0
appengine-maven-plugin 2.5.0

To get it to run, so far:
1 I had to remove all DOCTYPE declarations in xml files in the server project (new restrictions on DTD)
2 appengine-maven-plugin 2.5.0 requires:
                <configuration>
                    <jvmFlags>
                        <item>--add-opens</item>
                <item>java.base/java.util=ALL-UNNAMED</item>
This stops 500 Server Error which I've not seen before:
GCLOUD: java.lang.reflect.InaccessibleObjectException:
Unable to make field accessible: module java.base does not "opens java.util" to unnamed module @2c95ac9e

So Craig, you say with Java17 on GAE, there isn't a web server included anymore.
So this has to be defined somewhere in  appengine-maven-plugin ?
The minimum level to avoid being shut down on GAE standard is >8
& 11 is the max for GWT, so that would seem do for now, why Java 17  ?

On Wednesday, December 20, 2023 at 4:46:03 AM UTC Craig Mitchell wrote:
No worries not posting the POMs Tim.

The bit I'm struggling with, the old Java 8 version had its own GAE server.  So I would run that, and a GWT Code Server.  Easy!

btw: I'm talking about GAE Standard.  GAE Flexible you can do whatever you want, but that's more work and more expensive.

Now with the upgrade to Java17 on GAE, there isn't a web server included anymore.  It's up to you to supply one.  I would assume when you deploy it, it doesn't actually use your server, but what setup is GAE expecting for the deploy?

I see there is a SpringBoot GAE example, so it might be easier to use that, and get GWT to work with SpringBoot.  Not sure.  Very interested to hear what you're doing.

Thanks!

On Wednesday 20 December 2023 at 1:51:55 pm UTC+11 tim_mac...@yahoo.co.uk wrote:
For some years I've been deploying GWT 2.8.2 to GAE with Maven & Google Cloud Tools.
I now find GAE is not supporting Java 8 after January, so currently upgrading (rather slowly).
There are 4 long POM files,  probably better to mail them then post a distilled version here ?

On Sunday, December 17, 2023 at 5:20:56 AM UTC Craig Mitchell wrote:
Hi,

The instructions here https://www.gwtproject.org/doc/latest/tutorial/appengine.html are no longer valid, as the Google Plugin for Eclipse is now dead (Google no longer supports Java 1.8, and the Google Plugin for Eclipse doesn't support any Eclipse versions that support anything after Java 1.8).  Ref:  https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/3710

The new approach with GAE is to use Maven or Gradle with Google Cloud Tools.

I've been struggling to work out how this is supposed to happen.  It looks like we now have to provide our own Web Server for GAE, but can we use the Jetty server that GWT uses for development?  I assume the deploy build would not include the Jetty web server?

If anyone has deployed a GWT app to GAE with Maven and the new Google Cloud Tools, it would be great if you could give high level instructions on how it's all supposed to fit together.

An example Maven POM file with both the Google Cloud Tools, and GWT would be even better.  🙂

Thanks!

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/68961a1b-ed04-4e38-b0eb-0ee1f9812881n%40googlegroups.com.

Re: Deploy to Google App Engine (GAE)

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>team.drift</groupId>
<artifactId>drift-team</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<!-- Defines what dependencies can be used -->
<dependencyManagement>
<dependencies>
<!-- GWT -->
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt</artifactId>
<version>2.10.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- GWT and GAE-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>

<!-- Actually uses these dependencies -->
<dependencies>
<!-- GWT -->
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet</artifactId>
</dependency>

<!-- GWT and GAE -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>

<!-- GAE -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>2.0.23</version>
</dependency>

<!-- JSON on the server https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>

<!-- PayPal https://mvnrepository.com/artifact/com.paypal.sdk/checkout-sdk -->
<dependency>
<groupId>com.paypal.sdk</groupId>
<artifactId>checkout-sdk</artifactId>
<version>1.0.3</version>
</dependency>

<!-- PNG compressor https://mvnrepository.com/artifact/com.github.depsypher/pngtastic -->
<dependency>
<groupId>com.github.depsypher</groupId>
<artifactId>pngtastic</artifactId>
<version>1.6</version>
</dependency>

<!-- JUnit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>

<plugins>
<!-- Google App Engine -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

<!-- GWT -->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<launcherDir>${project.build.directory}/${project.artifactId}-${project.version}</launcherDir>
<warDir>${project.build.directory}/${project.artifactId}-${project.version}</warDir>
<startupUrls>
<startupUrl>/</startupUrl>
</startupUrls>
<jvmArgs>
<jvmArg>-Xmx2048M</jvmArg>
<jvmArg>--add-opens</jvmArg>
<jvmArg>java.base/java.lang=ALL-UNNAMED</jvmArg>
</jvmArgs>
</configuration>
</plugin>

<!-- TODO: Manually copy the src/main/webapp files. Maven should do this automatically, but it isn't? -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
<resources>
<resource>
<directory>src/main/webapp</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thanks Tim!  Looking at your POM files, I see I missed adding:

<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>

I also needed to:
  • Convert all my servlets to @WebServlet (as the GWT Jetty server didn't pick up my web.xml like the GAE server used to).
  • Give the GWT plugin the JVM arg "--add-opens java.base/java.lang=ALL-UNNAMED" for execeptions to be returned to the client.
Strangely, Maven isn't copying my src/main/webapp files to the target folder, so I'm doing that manually with the maven-resources-plugin.

So now GWT starts, dev compiles (including source maps), and runs beautifully, including RPC calls.  Java17 runtime with a Java11 source level.  Happy days!  New POM attached.

I've switched from using Eclipse to IntelliJ (because I no longer will be using any of the Eclipse plugins, and wanted a fresh start).  However, debugging my server never hits the breakpoints.

Do you use IntelliJ, do we need any special params to enable debug?

debug.png

I'm yet to get Google App Engine to work.  When I try to access any of the GAE calls, I just get "No API environment is registered for this thread.".  I think I need to setup the enviroment somehow now I no longer have a GAE server.

Cheers!

On Friday 22 December 2023 at 4:41:07 am UTC+11 tim_mac...@yahoo.co.uk wrote:
These are my current poms, based on the tbroyer archetype.
Probably best to look at the latter first if youre not familiar with it.

The launch is configured in the server pom:

    <profile>
      <id>env-dev-gae1</id>
      <activation>
        <property>  
          <name>env</name>
          <value>haslistener</value>
...
      <build>                    
        <pluginManagement>
          ...

              <groupId>com.google.cloud.tools</groupId>
              <artifactId>appengine-maven-plugin</artifactId>

A version of Jetty is attached by the appengine-maven-plugin config here (afaik)
The eclipse launch goal is: appengine:run -Denv=haslistener

Re GWT 2.10 : it can use JRE 17 but can only compile Java 11 source, iirc.

Poms are a bit messy but should help if you want to take this approach

On Thursday, December 21, 2023 at 11:36:51 AM UTC Craig Mitchell wrote:
Forgot to mention.  My target is Java 17, but my source is Java 1.8.

So:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

And:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>

I've attached my current POM (which isn't working, so don't copy it 🙂), but if you can see my mistake, please let me know.

Thanks again!
On Thursday 21 December 2023 at 10:27:01 pm UTC+11 Craig Mitchell wrote:
Hi Tim,

I thought GWT 2.10.0 supported Java17.  From the release notes:   https://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0
Tested support for running on Java 17, dropped remaining support for running on Java 7.

I'm also using appengine-maven-plugin 2.5.0.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

Along with GWT plugin:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<packaging>gwt-lib</packaging>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
<warDir>${project.build.directory}/drift-team-1.0-SNAPSHOT</warDir>
<startupUrls>
<startupUrl>index.html</startupUrl>
</startupUrls>
</configuration>
</plugin>

Running: "mvn gwt:devmode" I can get it to start the Jetty server and GWT code server.  It finds my project, but currently, when opening the browser it says:
HTTP ERROR 503 Service Unavailable
URI: /index.html
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -

I put my web assets in  src/main/webapp  and I don't think it's seeing them.  Plus I don't think it's seeing my web.xml that's in  src/main/webapp/WEB-INF/web.xml

Maybe they need to be copied to the target directory or somewhere, or the GWT plugin pointed to where they are somehow.  Not sure.  Any help is greatly appreaciated.


On Thursday 21 December 2023 at 4:06:46 am UTC+11 tim_mac...@yahoo.co.uk wrote:
I havent tried raising the Java level yet, its still  JavaSE-1.8.
Got as far as using latest versions:
JDK 21
gcloud CLI app & cloudSdkVersion  457.0.0
appengine-maven-plugin 2.5.0

To get it to run, so far:
1 I had to remove all DOCTYPE declarations in xml files in the server project (new restrictions on DTD)
2 appengine-maven-plugin 2.5.0 requires:
                <configuration>
                    <jvmFlags>
                        <item>--add-opens</item>
                <item>java.base/java.util=ALL-UNNAMED</item>
This stops 500 Server Error which I've not seen before:
GCLOUD: java.lang.reflect.InaccessibleObjectException:
Unable to make field accessible: module java.base does not "opens java.util" to unnamed module @2c95ac9e

So Craig, you say with Java17 on GAE, there isn't a web server included anymore.
So this has to be defined somewhere in  appengine-maven-plugin ?
The minimum level to avoid being shut down on GAE standard is >8
& 11 is the max for GWT, so that would seem do for now, why Java 17  ?

On Wednesday, December 20, 2023 at 4:46:03 AM UTC Craig Mitchell wrote:
No worries not posting the POMs Tim.

The bit I'm struggling with, the old Java 8 version had its own GAE server.  So I would run that, and a GWT Code Server.  Easy!

btw: I'm talking about GAE Standard.  GAE Flexible you can do whatever you want, but that's more work and more expensive.

Now with the upgrade to Java17 on GAE, there isn't a web server included anymore.  It's up to you to supply one.  I would assume when you deploy it, it doesn't actually use your server, but what setup is GAE expecting for the deploy?

I see there is a SpringBoot GAE example, so it might be easier to use that, and get GWT to work with SpringBoot.  Not sure.  Very interested to hear what you're doing.

Thanks!

On Wednesday 20 December 2023 at 1:51:55 pm UTC+11 tim_mac...@yahoo.co.uk wrote:
For some years I've been deploying GWT 2.8.2 to GAE with Maven & Google Cloud Tools.
I now find GAE is not supporting Java 8 after January, so currently upgrading (rather slowly).
There are 4 long POM files,  probably better to mail them then post a distilled version here ?

On Sunday, December 17, 2023 at 5:20:56 AM UTC Craig Mitchell wrote:
Hi,

The instructions here https://www.gwtproject.org/doc/latest/tutorial/appengine.html are no longer valid, as the Google Plugin for Eclipse is now dead (Google no longer supports Java 1.8, and the Google Plugin for Eclipse doesn't support any Eclipse versions that support anything after Java 1.8).  Ref:  https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/3710

The new approach with GAE is to use Maven or Gradle with Google Cloud Tools.

I've been struggling to work out how this is supposed to happen.  It looks like we now have to provide our own Web Server for GAE, but can we use the Jetty server that GWT uses for development?  I assume the deploy build would not include the Jetty web server?

If anyone has deployed a GWT app to GAE with Maven and the new Google Cloud Tools, it would be great if you could give high level instructions on how it's all supposed to fit together.

An example Maven POM file with both the Google Cloud Tools, and GWT would be even better.  🙂

Thanks!

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/2a306765-274d-48cb-ab3f-f95261bf6af3n%40googlegroups.com.

Thursday, December 21, 2023

Re: Deploy to Google App Engine (GAE)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.timmacp</groupId>
<artifactId>Snptn</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>

<repositories>
<repository>
<id>sonatype.snapshots</id>
<name>Sonatype snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
</repositories>
<!-- 25/5/19 not actually using any snapshots now.
vaadin-gwt-polymer-elements v 1.9.4.0-SNAPSHOT (seems to be the final version)
was DLing something but not working
sonatype.snapshots probably needs this:
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
-->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mavenVersion>3.0</mavenVersion>

<gae.app.instance.version>0-0-1-snapshot</gae.app.instance.version>
<gae.version> 1.9.71 </gae.version> <!--1.9.89 latest -->
<gae.home>${user.home}/.m2/repository/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk/appengine-java-sdk-${gae.version}</gae.home>
<gae.application.version>1</gae.application.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency> <!-- ensure all GWT deps use the same version (unless overridden) -->
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.8.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${gae.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>6.0.7</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- operates on package, problematic, see findbugs.rtf
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<!-- codeserverWorkDir
where the code server will write compiler output.
defaults to
Snptn\target\gwt\codeserver
see
https://tbroyer.github.io/gwt-maven-plugin/codeserver-mojo.html
-->
<codeserverWorkDir>D:\Documents\codeserverWorkDir</codeserverWorkDir>

<!-- launcherDir
tBroyer: pass -launcherDir then CodeServer generates
*.nocache.js that triggers "compile on load" (with a running CodeServer)
Must recompile your application before deploying,
or use a distinct directory for SDM vs. production compilation output).

prod mode war is at \Snptn\Snptn-server\target

TM afaict not req by Tomcat7 (no idea why)
nb
Snptn-server\src\main\tomcatconf\context.htm has
extraResourcePaths="/=${basedir}/../target/gwt/launcherDir/" />
-->
<launcherDir>Snptn-server/target/Snptn-server-${project.version}</launcherDir>
<codeserverArgs> <!-- export non-native jsinterop methods -->
<arg>-generateJsInteropExports</arg>
</codeserverArgs>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>
-->

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-war-plugin -->
<!-- 27/8/16 seems to get 2.2 without this -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<!--
must use in goal cmd:
-DcompilerArgument=-Xlint:all compile (or package)
-->
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings> <!-- for Xlint afaict -->
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<!-- run dev mode from the parent
so it will notice changes in shared classes.
NB gitter 31/8/20 re running it from client module (not recommended)
-->
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-10</version>
<extensions>true</extensions>
<configuration>
<sourceLevel>auto</sourceLevel>
<failOnError>false</failOnError>
<compilerArgs>
<arg>-generateJsInteropExports</arg>
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
</compilerArgs>
<jvmArgs>
<jvmArg>-Xmx576m</jvmArg>
</jvmArgs>
<!--
limit VM heap, must be multiple of 1024
-Xmx384m crash
768 ok but task mgr says its using 855.7
576 " 762.3 or 780
without this its using 1250.3
-->
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
<!-- 31/7/17 appengine-maven-plugin def not req here,
because Jetty doesn't do reactor builds ? -->
</plugins>
</pluginManagement>
</build>
<modules>
<module>Snptn-client</module>
<module>Snptn-shared</module>
<module>Snptn-server</module>
</modules>
<!--
errors in ecl
Plugin execution not covered by lifecycle configuration: org.bsc.maven:maven-processor-plugin:3.3.2:process (execution: generate-app-code, phase: generate-sources)

srchd it

https://stackoverflow.com/questions/16469315/eclipse-maven-error-plugin-execution-not-covered-by-lifecycle-configuration

Newer versions of m2e complain if a Maven plugin does not provide a m2e lifecycle mapping. Newer plugins provider such a mapping via the file META-INF/m2e/lifecycle-mapping-metadata.xml in their JAR. If this file is not present, then Eclipse complains.

can quiet down these complaints by adding a
lifecycle mapping for older plugins to your POM.

eg
mapping is done inside a profile which is automatically activated when a build is running in Eclipse (m2e.version property is set)
not active when a regular maven build is done.

-->
<profiles>
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<versionRange>[2.1.0,)</versionRange>
<goals>
<goal>format</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>errorprone</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8</version>
</dependency>
<!-- override plexus-compiler-javac-errorprone's dependency on
Error Prone with the latest version -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- NB <configuration> is Optional directory to put findbugs xml report
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<configuration>
</configuration>
</plugin>
</plugins>
</reporting>
-->


</project><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.timmacp</groupId>
<artifactId>Snptn</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>Snptn-shared</artifactId>

<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId> <!--see logs\IAMjul2022\serviceAccountDoesNotNaveAccessFIX.rtf-->
<artifactId>google-cloud-storage</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin> <!-- 29jul22 shouldn't be here ? its <groupId>net.ltgt.gwt.maven nowadays -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.timmacp</groupId>
<artifactId>Snptn</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>Snptn-server</artifactId>
<packaging>war</packaging>

<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Snptn-shared</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Snptn-shared</artifactId>
<version>0.0.1-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>
<!-- cloud storage api -->
<dependency>
<groupId>com.google.cloud</groupId> <!--see logs\IAMjul2022\serviceAccountDoesNotNaveAccessFIX.rtf-->
<artifactId>google-cloud-storage</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev158-1.25.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.8</version> <!-- aug 2018 -->
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId> <!-- using javax.servlet-api:jar:3.1.0 -->
<artifactId>servlet-api</artifactId> <!-- tomcat7 errors without this, gae is ok) -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-logging</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
<build>
<outputDirectory>target/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory> <!-- for HOT RELOAD 16apr22 -->
<plugins>
<plugin> <!-- new plugin c27 June 2021-->
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version> <!--was 2.2.0 latest 2.5.0 -->
<configuration>
<projectId>timmacp-test4</projectId>
<version>1</version>
<cloudSdkVersion>457.0.0</cloudSdkVersion> <!--was 354.0.0 latest 457.0.0 ( else run goal always upgrades to latest-->
<deploy.stopPreviousVersion>false</deploy.stopPreviousVersion> <!-- 31jul22 retain current serving -->
<deploy.promote>false</deploy.promote> <!-- don't promote new version to receive all traffic -->
<jvmFlags>
<item>--add-opens</item>
<item>java.base/java.util=ALL-UNNAMED</item>
</jvmFlags>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<addWarDependenciesInClassloader>false</addWarDependenciesInClassloader>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<!-- XXX: We want to exclude Snptn-client from 'env-dev' profile, Maven
forces us to make a 'env-prod' profile -->
<id>env-prod</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Snptn-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<!-- 04 December 2017 fails to get nolistener profile if I change <value>dev-gae
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
dkdc
-->

<profile>
<id>env-dev-gae1</id>
<activation>
<property>
<name>env</name>
<value>haslistener</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<configuration>
<jvmFlags>
<jvmFlag>-Xdebug</jvmFlag>
<jvmFlag>-Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n</jvmFlag> <!-- apr22 suspend=n easier to use-->
</jvmFlags>
<disableUpdateCheck>true</disableUpdateCheck>
<systemProperties>
<gwt.codeserver.port>9876</gwt.codeserver.port>
</systemProperties>
<automaticRestart>true</automaticRestart> <!-- HOT RELOAD 16apr22 -->
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>env-dev-gae2</id>
<activation>
<property>
<name>env</name>
<value>nolistener</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<configuration>
<disableUpdateCheck>true</disableUpdateCheck>
<systemProperties>
<gwt.codeserver.port>9876</gwt.codeserver.port>
</systemProperties>
<automaticRestart>true</automaticRestart> <!-- HOT RELOAD 16apr22 -->
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>env-dev-tomcat</id>
<activation>
<property>
<name>env</name>
<value>tomcat7sdm</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<contextFile>${basedir}/src/main/tomcatconf/context.xml</contextFile>
<systemProperties>
<gwt.codeserver.port>9876</gwt.codeserver.port>
</systemProperties>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.timmacp</groupId>
<artifactId>Snptn</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>Snptn-client</artifactId>
<packaging>gwt-app</packaging>

<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Snptn-shared</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Snptn-shared</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-core</artifactId>
<version>1.0.0-beta-1</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-dom</artifactId>
<version>1.0.0-beta-1</version>
</dependency>
<dependency>
<groupId>com.vaadin.polymer</groupId>
<artifactId>vaadin-gwt-polymer-elements</artifactId>
<version>1.9.3.1</version>
</dependency>
<!-- v 1.9.4.0-SNAPSHOT wasn't downloading right.
see note in parent pom next to sonatype
see cghst 3113 (pre cut on 23.5.19)
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<!-- don't know why this was here, its in root pom
<version>1.0-rc-8</version>
-->
<configuration>
<moduleName>com.timmacp.Snptn.MainMod</moduleName>
<moduleShortName>mainmod</moduleShortName>
<style>OBFUSCATED</style> <!-- PRETTY -->
</configuration>
</plugin>
</plugins>
<!-- KEEP might need similar
Did have <version>3.1</version> in here, but there's def in root pom
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
-->
</build>
</project>
These are my current poms, based on the tbroyer archetype.
Probably best to look at the latter first if youre not familiar with it.

The launch is configured in the server pom:

    <profile>
      <id>env-dev-gae1</id>
      <activation>
        <property>  
          <name>env</name>
          <value>haslistener</value>
...
      <build>                    
        <pluginManagement>
          ...
              <groupId>com.google.cloud.tools</groupId>
              <artifactId>appengine-maven-plugin</artifactId>

A version of Jetty is attached by the appengine-maven-plugin config here (afaik)
The eclipse launch goal is: appengine:run -Denv=haslistener

Re GWT 2.10 : it can use JRE 17 but can only compile Java 11 source, iirc.

Poms are a bit messy but should help if you want to take this approach

On Thursday, December 21, 2023 at 11:36:51 AM UTC Craig Mitchell wrote:
Forgot to mention.  My target is Java 17, but my source is Java 1.8.

So:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

And:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</pluginManagement>

I've attached my current POM (which isn't working, so don't copy it 🙂), but if you can see my mistake, please let me know.

Thanks again!
On Thursday 21 December 2023 at 10:27:01 pm UTC+11 Craig Mitchell wrote:
Hi Tim,

I thought GWT 2.10.0 supported Java17.  From the release notes:   https://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0
Tested support for running on Java 17, dropped remaining support for running on Java 7.

I'm also using appengine-maven-plugin 2.5.0.
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.5.0</version>
<configuration>
<projectId>headtoheaddrifting</projectId>
<version>GCLOUD_CONFIG</version>
</configuration>
</plugin>

Along with GWT plugin:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>team.drift.DriftTeam</moduleName>
<moduleShortName>dt</moduleShortName>
<packaging>gwt-lib</packaging>
<launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
<warDir>${project.build.directory}/drift-team-1.0-SNAPSHOT</warDir>
<startupUrls>
<startupUrl>index.html</startupUrl>
</startupUrls>
</configuration>
</plugin>

Running: "mvn gwt:devmode" I can get it to start the Jetty server and GWT code server.  It finds my project, but currently, when opening the browser it says:
HTTP ERROR 503 Service Unavailable
URI: /index.html
STATUS: 503
MESSAGE: Service Unavailable
SERVLET: -

I put my web assets in  src/main/webapp  and I don't think it's seeing them.  Plus I don't think it's seeing my web.xml that's in  src/main/webapp/WEB-INF/web.xml

Maybe they need to be copied to the target directory or somewhere, or the GWT plugin pointed to where they are somehow.  Not sure.  Any help is greatly appreaciated.


On Thursday 21 December 2023 at 4:06:46 am UTC+11 tim_mac...@yahoo.co.uk wrote:
I havent tried raising the Java level yet, its still  JavaSE-1.8.
Got as far as using latest versions:
JDK 21
gcloud CLI app & cloudSdkVersion  457.0.0
appengine-maven-plugin 2.5.0

To get it to run, so far:
1 I had to remove all DOCTYPE declarations in xml files in the server project (new restrictions on DTD)
2 appengine-maven-plugin 2.5.0 requires:
                <configuration>
                    <jvmFlags>
                        <item>--add-opens</item>
                <item>java.base/java.util=ALL-UNNAMED</item>
This stops 500 Server Error which I've not seen before:
GCLOUD: java.lang.reflect.InaccessibleObjectException:
Unable to make field accessible: module java.base does not "opens java.util" to unnamed module @2c95ac9e

So Craig, you say with Java17 on GAE, there isn't a web server included anymore.
So this has to be defined somewhere in  appengine-maven-plugin ?
The minimum level to avoid being shut down on GAE standard is >8
& 11 is the max for GWT, so that would seem do for now, why Java 17  ?

On Wednesday, December 20, 2023 at 4:46:03 AM UTC Craig Mitchell wrote:
No worries not posting the POMs Tim.

The bit I'm struggling with, the old Java 8 version had its own GAE server.  So I would run that, and a GWT Code Server.  Easy!

btw: I'm talking about GAE Standard.  GAE Flexible you can do whatever you want, but that's more work and more expensive.

Now with the upgrade to Java17 on GAE, there isn't a web server included anymore.  It's up to you to supply one.  I would assume when you deploy it, it doesn't actually use your server, but what setup is GAE expecting for the deploy?

I see there is a SpringBoot GAE example, so it might be easier to use that, and get GWT to work with SpringBoot.  Not sure.  Very interested to hear what you're doing.

Thanks!

On Wednesday 20 December 2023 at 1:51:55 pm UTC+11 tim_mac...@yahoo.co.uk wrote:
For some years I've been deploying GWT 2.8.2 to GAE with Maven & Google Cloud Tools.
I now find GAE is not supporting Java 8 after January, so currently upgrading (rather slowly).
There are 4 long POM files,  probably better to mail them then post a distilled version here ?

On Sunday, December 17, 2023 at 5:20:56 AM UTC Craig Mitchell wrote:
Hi,

The instructions here https://www.gwtproject.org/doc/latest/tutorial/appengine.html are no longer valid, as the Google Plugin for Eclipse is now dead (Google no longer supports Java 1.8, and the Google Plugin for Eclipse doesn't support any Eclipse versions that support anything after Java 1.8).  Ref:  https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/3710

The new approach with GAE is to use Maven or Gradle with Google Cloud Tools.

I've been struggling to work out how this is supposed to happen.  It looks like we now have to provide our own Web Server for GAE, but can we use the Jetty server that GWT uses for development?  I assume the deploy build would not include the Jetty web server?

If anyone has deployed a GWT app to GAE with Maven and the new Google Cloud Tools, it would be great if you could give high level instructions on how it's all supposed to fit together.

An example Maven POM file with both the Google Cloud Tools, and GWT would be even better.  🙂

Thanks!

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/cab30028-3dde-4cdf-b4a0-316b7e97aa17n%40googlegroups.com.