Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

GWT Starter Project not working

84 views
Skip to first unread message

bryan

unread,
Apr 9, 2025, 5:12:16 AMApr 9
to GWT Users
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.
 

bryan

unread,
Apr 9, 2025, 6:54:23 AMApr 9
to GWT Users
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 ?

bryan

unread,
Apr 9, 2025, 7:35:30 AMApr 9
to GWT Users
Solved. Had to deploy on Tomcat 9 and not Tomcat 10.

Craig Mitchell

unread,
Apr 10, 2025, 5:26:55 AMApr 10
to GWT Users
You can use Tomcat 10 if you like, you just need to add the GWT Jakarta lib:  https://mvnrepository.com/artifact/org.gwtproject/gwt-servlet-jakarta

bryan

unread,
Apr 10, 2025, 7:43:47 AMApr 10
to GWT Users
Thanks, I'll check it out.
Reply all
Reply to author
Forward
0 new messages