Deploy Spring Boot to Tomcat

The chapter Packaging executable jar and war files in the Spring Boot reference documentation states: To build a war file that is both executable and deployable into an external container you need to mark the embedded container dependencies as “provided”, e.g: <?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”> <!– … –> <packaging>war</packaging> <!– … … Read more

Error 404: The requested resource is not available using HelloWorld servlet [duplicate]

Try this (if the Java EE V6) package crunch; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; @WebServlet(name=”hello”,urlPatterns={“/hello”}) // added this line public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(“Hello World”); } } now reach the servlet by http://127.0.0.1:8080/yourapp/hello where 8080 is default Tomcat … Read more

Where do I have to place the JDBC driver for Tomcat’s connection pool?

The JDBC driver has to be visible to the same classloader as the data source factory itself. The data source factory library is placed in Tomcat’s own /lib folder and thus loaded by Tomcat’s “common” classloader. Your problem sounds much like that you dropped the JDBC driver in webapp’s /WEB-INF/lib. The webapp’s /WEB-INF/lib is invisible … Read more

Debugging Tomcat in Docker container

This is the command I use for this: docker run -it –rm \ -e JPDA_ADDRESS=8000 \ -e JPDA_TRANSPORT=dt_socket \ -p 8888:8080 \ -p 9000:8000 \ -v D:/tc/conf/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml \ tomcat:8.0 \ /usr/local/tomcat/bin/catalina.sh jpda run Explanation -e JPDA_ADDRESS=8000debugging port in container, passed as environment variable -e JPDA_TRANSPORT=dt_sockettransport type for debugging as socket, passed as environment variable -p … Read more

Spring boot 3 – Jakarta and Javax

The answer will really depend on which specific libraries you’re using and how they interact with each other, but generally speaking trying to mix Java EE and Jakarta EE them would be a bad idea. As an example, if you’re writing a Spring MVC application then you’ll be using the DispatcherServlet. In Spring Framework 6 … Read more

Is anyone using SpringSource tc server as a Tomcat replacement?

As I see it, the primary advantage of tcServer is in managing large clusters of load-balanced tomcats. Aside from the management/monitoring layer (which is very cool, by the way), it also has a faster database connection pooling mechanism, and a generally tweaked configuration optimised for high volume. Other than that, it’s just Tomcat.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)