Wednesday, April 9, 2025

Re: GWT Starter Project not working

Solved. Had to deploy on Tomcat 9 and not Tomcat 10.

On Wednesday, April 9, 2025 at 8:54:23 PM UTC+10 bryan wrote:
I think the problem might be Tomcat expecting jakarta namespace not javax namespace.

09-Apr-2025 20:36:56.025 FINE [main] org.apache.catalina.util.Introspection.loadClass Failed to load class [com.webbtide.test.server.GreetingServiceImpl]
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet

In Tomcat lib directory:
/opt/java/bin/jar -tvf servlet-api.jar | grep HttpServlet
   223 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$1.class
  1235 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyAsyncContextListener.class
  3491 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyOutputStream.class
  4233 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyPrintWriter.class
  4058 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyResponse.class
  1860 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$TomcatHack.class
  9778 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet.class
   297 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletMapping.class
  1052 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequest$1.class
  3086 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequest.class
  5783 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequestWrapper.class
  3708 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletResponse.class

Not sure what to do ?
On Wednesday, April 9, 2025 at 7:12:16 PM UTC+10 bryan wrote:
Using Eclipse 2025-03 (4.35.0)
OpenJDK 21.0.2

I created a GWT Web Application and deployed it on Tomcat 10.0.22, listening on port 8081.

Tomcat is deployed behind nginx. The relevant lines of the conf are:
    location /  {
      expires -1;

      add_header Cache-Control "no-store, no-cache, must-revalidate";

      proxy_pass      http://127.0.0.1:8081;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header X-Real-IP $remote_addr;

      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

When I point myself are https:[my weburl]/ the GWT Web Application Starter Project loads. When I click on the "Send" button the browser debug console says:
POST https://[my web url]/gwttest/greet 500 (Internal Server Error)

Any help greatly appreciated.
 

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/1cc066e1-8909-4d7e-a439-a9c7f84df34an%40googlegroups.com.

Re: GWT Starter Project not working

I think the problem might be Tomcat expecting jakarta namespace not javax namespace.

09-Apr-2025 20:36:56.025 FINE [main] org.apache.catalina.util.Introspection.loadClass Failed to load class [com.webbtide.test.server.GreetingServiceImpl]
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet

In Tomcat lib directory:
/opt/java/bin/jar -tvf servlet-api.jar | grep HttpServlet
   223 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$1.class
  1235 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyAsyncContextListener.class
  3491 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyOutputStream.class
  4233 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyPrintWriter.class
  4058 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$NoBodyResponse.class
  1860 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet$TomcatHack.class
  9778 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServlet.class
   297 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletMapping.class
  1052 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequest$1.class
  3086 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequest.class
  5783 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletRequestWrapper.class
  3708 Fri Feb 01 00:00:00 AEST 1980 jakarta/servlet/http/HttpServletResponse.class

Not sure what to do ?
On Wednesday, April 9, 2025 at 7:12:16 PM UTC+10 bryan wrote:
Using Eclipse 2025-03 (4.35.0)
OpenJDK 21.0.2

I created a GWT Web Application and deployed it on Tomcat 10.0.22, listening on port 8081.

Tomcat is deployed behind nginx. The relevant lines of the conf are:
    location /  {
      expires -1;

      add_header Cache-Control "no-store, no-cache, must-revalidate";

      proxy_pass      http://127.0.0.1:8081;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header X-Real-IP $remote_addr;

      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

When I point myself are https:[my weburl]/ the GWT Web Application Starter Project loads. When I click on the "Send" button the browser debug console says:
POST https://[my web url]/gwttest/greet 500 (Internal Server Error)

Any help greatly appreciated.
 

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/dad99b7a-831b-4697-9306-0f2c99406f76n%40googlegroups.com.

GWT Starter Project not working

Using Eclipse 2025-03 (4.35.0)
OpenJDK 21.0.2

I created a GWT Web Application and deployed it on Tomcat 10.0.22, listening on port 8081.

Tomcat is deployed behind nginx. The relevant lines of the conf are:
    location /  {
      expires -1;

      add_header Cache-Control "no-store, no-cache, must-revalidate";

      proxy_pass      http://127.0.0.1:8081;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header X-Real-IP $remote_addr;

      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

When I point myself are https:[my weburl]/ the GWT Web Application Starter Project loads. When I click on the "Send" button the browser debug console says:
POST https://[my web url]/gwttest/greet 500 (Internal Server Error)

Any help greatly appreciated.
 

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/aed1dff8-b3a6-4689-9f99-f74afe47108bn%40googlegroups.com.

Tuesday, April 8, 2025

Re: Possible to access list of included methods from Linker?

Depending on what exactly you're after, you're right Craig. After a fashion, the existing symbolmaps and sourcemaps also have this information.

Linkers aren't the right place to _collect_ what you need here Alex - unlike a conventional C linker, GWT linkers are more about taking already "linked" (using C's definition) application code and packaging it (and other required strings/bytes) into files for use at runtime. With that said, the SymbolMapLinker shows how to _read_ the symbol map data from the compiler - you could consider customizing this to do additional logic at link time, or you could read the existing symbol data after the compile+link is complete.

If all you need is the java method names and their corresponding js name, that data is probably enough - take a look at CompilationResult.getSymbolMap() (or the generated symbolMap output). If you want call tree info, I think the compiler report output will have what you need (in giant gzipped files), and if you want more detail about the class or methods themselves and what was pruned from the original, the sourcemap should be able to help here by letting you read which lines were actually retained from a given source file.


On Monday, April 7, 2025 at 8:33:01 PM UTC-5 ma...@craig-mitchell.com wrote:
Isn't that what the SoycReportLinker does?  Ie. It creates a report telling you what has been used:  https://www.gwtproject.org/doc/latest/DevGuideCompileReport.html

On Sunday, 6 April 2025 at 6:29:05 am UTC+10 Alexander Bertram wrote:
Hi all,

I'm implementing a custom linker as a subclass of AbstractLinker. Is it possible to determine from the set of Artifacts, or other information, if specific Java methods were included in the final emitted build?

Thanks!

Alex

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/4a8121d4-6031-42dc-8e8b-e3e35172996bn%40googlegroups.com.

Monday, April 7, 2025

Re: Possible to access list of included methods from Linker?

Isn't that what the SoycReportLinker does?  Ie. It creates a report telling you what has been used:  https://www.gwtproject.org/doc/latest/DevGuideCompileReport.html

On Sunday, 6 April 2025 at 6:29:05 am UTC+10 Alexander Bertram wrote:
Hi all,

I'm implementing a custom linker as a subclass of AbstractLinker. Is it possible to determine from the set of Artifacts, or other information, if specific Java methods were included in the final emitted build?

Thanks!

Alex

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/0a6d662e-a839-4020-ae9d-2ed65249b297n%40googlegroups.com.

Saturday, April 5, 2025

Possible to access list of included methods from Linker?

Hi all,

I'm implementing a custom linker as a subclass of AbstractLinker. Is it possible to determine from the set of Artifacts, or other information, if specific Java methods were included in the final emitted build?

Thanks!

Alex

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/05751bbe-46e7-4cad-af39-6fbb2dfba926n%40googlegroups.com.

Friday, April 4, 2025

Re: Converging efforts for Maven Plugin (tbroyer) and GWT Plugin (Eclipse)

Thanks Thomas.  That makes sense.  Good to get some more knowledge about the plugin (which is fantastic btw.  If it didn't exist, I would be in a lot of trouble, so thank you for creating it!).

And yes, I'm definately in the 95% not proficient with Maven.  😁

On Saturday, 5 April 2025 at 3:22:15 am UTC+11 Thomas Broyer wrote:
On Friday, April 4, 2025 at 5:33:04 AM UTC+2 ma...@craig-mitchell.com wrote:
Maybe my situation was different.  Google App Engine required an executable war / jar.  Ie:  It must run like this  "java -jar my-app.war".  The GWT Eclipse Plugin couldn't build this, thus I switched to the GWT Maven plugin.

But I admit, the GWT Maven plugin is a little confusing.

If you're not proficient with Maven (like 95% of its users), mostly poking at it until things work (nobody will blame you, documentation is really lacking), I admit it can certainly be. Maven's design is broken in many ways (Maven 4 goes into the right direction, but it's been years in the making and still not there yet) but it has much more to offer than how most people (try to) use it.
 
Right now, my top level pom has "<packaging>pom</packaging>".  My client module has "<packaging>gwt-app</packaging>".  And my server module has "<packaging>war</packaging>".  Why is the client packaging called "gwt-app", why not just called it "war" like the server.

Because it's not a WAR per se, it's just some ZIP archive that contains the output of the GWT compilation. The only reason the output file is named .war rather than .zip is such that it can easily be used as an "overlay" by a the maven-war-plugin (technically it could be a ZIP, but the maven-war-plugin requires them to be declared in the plugin configuration, which means there's no dependency from the server to the client, so Maven doesn't know that it has to build the client before the server). IIRC, this also was before "webjars" were widely supported (and a few years before Spring Boot); and webjars have other issues: you don't want any of the dependencies from your "client" POM to be resolved when depending on it from the "server" module, which a war gives you "for free": https://maven.apache.org/ref/3.9.9/maven-core/artifact-handlers.html

But as Elias said, the "packaging" in a Maven POM opts in to a build "lifecycle", and this actually is the only reason for that <packaging>gwt-app</packaging>: https://tbroyer.github.io/gwt-maven-plugin/lifecycles.htmlhttps://maven.apache.org/ref/3.9.9/maven-core/default-bindings.html
In other words, this is just how Maven works.
 
And why does it need to know how the server will be packaged at all,

It doesn't (nowhere in the plugin will you see it look at the server module and/or how it's packaged). You're free to use the produced .war archive the way you want. Use the maven-resources-plugin to extract its content if you prefer, it's not a real WAR, it's just a ZIP archive with a .war name, due to Maven's way of resolving things and other limitations.

--
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 visit https://groups.google.com/d/msgid/google-web-toolkit/ad4bf9a3-49ce-49c4-a233-0153a8cf8917n%40googlegroups.com.