> I am trying to implement a Comet process.
> > Tomcat 6.0.36
> > Red Hat Enterprise Linux Server release 6.2 (Santiago)
> > Java 7u11 (32 bit)
> >
> > I have implemented CometProcessor.  I am using the NIO connector.
> > When I try the servlet I get: HTTP method GET is not supported by this
> URL
> > Am I doing something wrong?
> >
> > Thanks!
> >
> > Code snippet:
> >
> > public class ConsolidatedActionCenterPush extends HttpServlet  implements
> > CometProcessor,CAC{
> >
> >   private static MessageSender messageSender = null;
>
> static ??
>

> >   private static final Integer TIMEOUT = 600 * 1000;
> >
> >   @Override
> >   public void destroy() {
> >     messageSender.stop();
> >     messageSender = null;
>
> This would break if there is more than 1 instance of your servlet.
>

Thank you for drawing my attention to this potential issue.  Perhaps I need
to verify an assumption of mine: I am thinking that since I am not using a
distributed environment there will only be one instance of this servlet.
 If you want the long story: This is an intranet application and this piece
is used for sending messages to the users. As such there are other threads
that use the static methods to add messages.  In the past when I had the
clients polling on an interval it would not have mattered if an instance
came or went. I will reconsider what I have done here.


> What filters do you have in the request processing chain for this
> servlet? Do they support Comet? (I do not remember whether it is
> important for Comet. Just guessing).
>
> You can use "new Exception().printStackTrace()" to check what valves
> and filters are active for you.
>

Thank you so much!  Looking at my stack trace I saw something that made me
suspicious.  The invoker servlet.  I needed this as we have an mountain of
servlets that have always been called via the package name in the URL.
 Once I removed this the Comet functionality worked!  So I guess I will be
mapping a lot of servlets in the days to come, but it works so cool.

Reply via email to