You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "mrs.nospam" <mr...@gmail.com> on 2014/03/21 14:28:42 UTC

Debugging Tomcat 7 Cors Filter

I'm using Eclipse to remote debug a Tomcat 7.0.47 instance.  I'm trying to
figure out why a request isn't going through the
org.apache.cataline.filters.CorsFilter.   It's a complex web app with a lot
of filters configured. Some requests hit the filter and I can debug them
properly and others are not.

My CorsFilter in tomcat/conf/web.xml is set to use

  <url-pattern>/*</url-pattern>

I know they are hitting tomcat because I see them in the access_log:

157.166.175.129 - - [21/Mar/2014:09:20:16 -0400] "OPTIONS
/bonita/API/bpm/humanTask?p=0&c=10&f=state=ready HTTP/1.1" 401 -

Will someone point me in the right direction of where to put a breakpoint
to track this down?

Re: Debugging Tomcat 7 Cors Filter

Posted by "mrs.nospam" <mr...@gmail.com>.
Great thanks, that helped me track it down.


On Fri, Mar 21, 2014 at 9:46 AM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2014-03-21 17:28 GMT+04:00 mrs.nospam <mr...@gmail.com>:
> > I'm using Eclipse to remote debug a Tomcat 7.0.47 instance.  I'm trying
> to
> > figure out why a request isn't going through the
> > org.apache.cataline.filters.CorsFilter.   It's a complex web app with a
> lot
> > of filters configured. Some requests hit the filter and I can debug them
> > properly and others are not.
> >
> > My CorsFilter in tomcat/conf/web.xml is set to use
> >
> >   <url-pattern>/*</url-pattern>
> >
> > I know they are hitting tomcat because I see them in the access_log:
> >
> > 157.166.175.129 - - [21/Mar/2014:09:20:16 -0400] "OPTIONS
> > /bonita/API/bpm/humanTask?p=0&c=10&f=state=ready HTTP/1.1" 401 -
> >
> > Will someone point me in the right direction of where to put a breakpoint
> > to track this down?
>
> 401 = Authentication required.
>
> That is usually sent by a valve performing authentication such as
> BasicAuthenticator, DigestAuthenticator. See references to
> HttpServletResponse.SC_UNAUTHORIZED
>
> You can always put a breakpoint in CoyoteAdapter.service().
>
> You may put one at Response.sendError(), Response.setStatus().
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: Debugging Tomcat 7 Cors Filter

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-03-21 17:28 GMT+04:00 mrs.nospam <mr...@gmail.com>:
> I'm using Eclipse to remote debug a Tomcat 7.0.47 instance.  I'm trying to
> figure out why a request isn't going through the
> org.apache.cataline.filters.CorsFilter.   It's a complex web app with a lot
> of filters configured. Some requests hit the filter and I can debug them
> properly and others are not.
>
> My CorsFilter in tomcat/conf/web.xml is set to use
>
>   <url-pattern>/*</url-pattern>
>
> I know they are hitting tomcat because I see them in the access_log:
>
> 157.166.175.129 - - [21/Mar/2014:09:20:16 -0400] "OPTIONS
> /bonita/API/bpm/humanTask?p=0&c=10&f=state=ready HTTP/1.1" 401 -
>
> Will someone point me in the right direction of where to put a breakpoint
> to track this down?

401 = Authentication required.

That is usually sent by a valve performing authentication such as
BasicAuthenticator, DigestAuthenticator. See references to
HttpServletResponse.SC_UNAUTHORIZED

You can always put a breakpoint in CoyoteAdapter.service().

You may put one at Response.sendError(), Response.setStatus().

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org