1

I'm trying to create a Valve to gather some information of every server req.

I'm following this example: http://goo.gl/9wwylq

I followed these steps:

  • Create a Maven Java Application. Add the tomcat-catalina dependency
  • Create your Java class and extend it from ValveBase.
  • Implement invoke(Request request, Response response)
  • Build your library (.jar) file
  • Install the library in the ${tomcat.home}/lib directory.
  • Configure server.xml to use your new Valve. For example:

    valve className="com.bluelotussoftware.tomcat.ProcessingValve"

I tried to put that in the host Tag and in the engine one.. but nothing seems to work, I can't get nor any loggin nor a stop in the debug mode..

anything you guys think i could be missing?

pepepapa82
  • 167
  • 2
  • 10
  • Please check that your Tomcat maps at least to one context.http://stackoverflow.com/questions/26975994/why-is-my-tomcat-valve-not-being-invoked/34208983 – Boris Treukhov Dec 10 '15 at 18:31

2 Answers2

1

If it is not working, maybe the name is wrong. Try checking the name of your valve in the server.xml It should be the exact package and name you used in your java file.

Hope this helps, I had same issue with filters and servlets some time ago.

Ger

germanio
  • 861
  • 1
  • 17
  • 27
1

Thanks, it was actually simpler.

The valve tag in the server.xml is case sensitive!

should be:

<Valve and not <valve
pepepapa82
  • 167
  • 2
  • 10