I am using Tomcat/10.1.16 on Ubuntu 24.04
My web.xml file defines a servlet :
<!-- Servlets -->
<servlet>
<servlet-name>servlet_general</servlet-name>
<servlet-class>packagedebate.server.Info_desde_servidorServiceImpl</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>servlet_general</servlet-name>
<url-pattern>/Debate/url_a_servlet_general</url-pattern>
</servlet-mapping>
GWT 2.11 compiles my /client/java files to a js file that eventually calls https://www.myweb.com/tomcat_app/Debate/url_a_servlet_general
My apache2.conf contains :
JkMount /tomcat_app* worker1
JkMount /tomcat_app*/* worker1
My worker.properties files contains :
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.secret=password
My /etc/tomcat10/server.xml file contains
<Connector protocol="AJP/1.3"
address="::1"
secretRequired="true"
secret="password"
port="8009"
redirectPort="8081" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
The servlet is defined in my server side java file :
public class Info_desde_servidorServiceImpl extends RemoteServiceServlet implements info_desde_servidorService {
...
public void init() {
System.out.println("I see this in catalina.out");
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.println("<!DOCTYPE html>");
out.println("<html><head>");
out.println("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
out.println("<title>To the world</title></head>");
out.println("<body>");
out.println("<h1>Hello world</h1>");
out.println("<p>Request URI: " + request.getRequestURI() + "</p>");
out.println("<p>PathInfo: " + request.getPathInfo() + "</p>");
out.println("<p>Remote Address: " + request.getRemoteAddr() + "</p>");
out.println("</body>");
out.println("</html>");
} finally {
out.close(); // Always close the output writer
}
}
Public Boolean a_useful_method_accessed_by_client(int sent_by_client) {
return true;
}
The extended RemoteServiceServlet is com.google.gwt.user.server.rpc.jakarta.RemoteServiceServlet
On client side, the interface info_desde_servidorService contains the list of methods:
@RemoteServiceRelativePath("url_a_servlet_general")
public interface info_desde_servidorService extends RemoteService {
a_useful_method_accessed_by_client(int sent_by_client)throws DelistedException;
...
The servlet is initiated correctly (init is ran)
When I access https://www.myweb.com/tomcat_app/Debate/url_a_servlet_general
I am expecting to see “Hello world”.
Then, the client js methods (created by GWT) should be able to access the other methods of class Info_desde_servidorServiceImpl and exchange information client-server.
This setup has been working during years on my old server using tomcat9 instead of tomcat10, and javax instead of jakarta.
But on the new server (tomcat10 + jakarta) when I access “https://www.myweb.com/tomcat_app/Debate/url_a_servlet_general” the browser downloads a json file containing the line:
"//OK[0,1,["java.util.Vector/3057315478"],0,7]".
When the client (js file) tries to call a_useful_method_accessed_by_client method of Info_desde_servidorServiceImpl, the browser pops up the following message:
mywebsite says:
Error: from info_desde_servidorService_Proxy.a_useful_method_accessed_by_client
I tried to be as detailled as possible. It is apparently not a ssl issue.
I do not know why the error mentions “info_desde_servidorService_Proxy” (not a text in my code). The “//OK” is not a text in my code either.
catalina.out does not report anything. Tomcat log files does not show any revelant information.
Any suggestion to track this error would be appreciated.
Should I downgrade to tomcat9? If yes, why did it not work?