1

I'm absolutely in stuck with the subject..

My environment:

  • Tomcat 8.5.23

  • Intellij IDEA CE 2017.2.6

  • Simple as possible Java web app (One servlet 3.0 that returns JSP)

  • Using Gradle as a build tool (just apply plugins, and declare provided servlet-api dependency)

  • Application is packaged into WAR and deployed to Tomcat

I run Tomcat with catalina jpda start, connect to it in IDEA, toggle breakpoint in doGet method (red circle with tick appears), open the application and.. nothing happens. It seems that this breakpoint is ingored.

I've checked all related topics, have tried to assign options from IDEA debug configuration window to setenv.bat file to JAVA/CATALINA_OPTS, have tried to run Tomcat with startup.bat, catalina start, but it doesn't help.

prozac631
  • 57
  • 1
  • 2
  • 7
  • 1
    IntelliJ IDEA Community does not provide dedicated Run/Debug Configuration to deploy and debug tomcat server, but it still can be set up. See https://stackoverflow.com/a/27655979/2000323 – Andrey Nov 29 '17 at 13:43

1 Answers1

0

And.. now it works. Only thing that is changed is Tomcat version. Now I use 7.0.82.

Tomcat was started with catalina jpda start

Probably it will be useful for someone:

@WebServlet(
        name = "bar_servlet",
        urlPatterns = "/",
        description = "BarServlet",
        loadOnStartup = 1
)
public class BarServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponseresp) throws ServletException, IOException {
        req.getRequestDispatcher("jsp/index.jsp")
                .forward(req, resp);
    }
}

Working breakpoint

prozac631
  • 57
  • 1
  • 2
  • 7