The moose likes Testing and the fly likes JUnit doesn't stop on breakpoints in my Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUnit doesn Watch "JUnit doesn New topic

JUnit doesn't stop on breakpoints in my Servlet

Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
Hi everyone,

I'm running a JUnit test on a servlet and according to logs the execution does reach my servlet but it doesn't stop at the breakpoints that I set there. It does stop at breakpoints in my test class.
Does anyone know why?

Thanks in advance.

Here's my Test class:

And here's what tomcat's log file says:

[2011-10-14 09:55:13,567] [080-Processor24] DEBUG [eu.liquix.smsservice.tmobile.DeliveryServlet ] : > process()
[2011-10-14 09:55:13,567] [080-Processor24] DEBUG [eu.liquix.smsservice.tmobile.DeliveryServlet ] : It contains [1] message(s)
[2011-10-14 09:55:13,567] [080-Processor24] ERROR [eu.liquix.smsservice.tmobile.DeliveryServlet ] : Failed to process SMS message.
java.lang.NumberFormatException: For input string: "TO"
at java.lang.NumberFormatException.forInputString(
at java.lang.Integer.parseInt(
at eu.liquix.smsservice.tmobile.DeliveryServlet.convertToASCII(
at eu.liquix.smsservice.tmobile.DeliveryServlet.process(
at eu.liquix.smsservice.tmobile.DeliveryServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
at org.apache.tomcat.util.threads.ThreadPool$

J2EE Architect/Developer
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
I'm debugging from MyEclipse and I started up tomcat from the command line with "mvn cargo:start", so maybe that's the problem.
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
Yep, alright, I started a remote app debug configuration and it worked.

Sorry about that, thanks anyway.
I agree. Here's the link:
subject: JUnit doesn't stop on breakpoints in my Servlet
jQuery in Action, 3rd edition