How to get requests for a servlet that implements the CometProcessor interface through a filter

I have a servlet that implements CometProcessor and I am trying to get the requests coming into this servlet to get through the filter. Specifying a servlet in the web.xml file does not make requests to the servlet go through the filter. I also tried to implement CometFilter and specified a servlet implementing CometProcessor in web.xml file. I am getting the following error:

Jan 29, 2013 12:10:04 PM org.apache.catalina.connector.CoyoteAdapter service - SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:430)
    at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

      

+3


source to share


1 answer


Thanks for your submissions, I found out where I am going wrong. I was wrong about the CometFilter implementation. I read the documentation present in the CometFilter class itself and found that I need to implement the doFilterEvent method, not the doFilter method. Now its working tone and requests for a servlet that implements CometProcessor are passed to this filter.



+1


source







All Articles