tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Walker" <...@getahead.org>
Subject Re: CometProcessor and DWR
Date Thu, 17 Jul 2008 09:39:08 GMT
Thanks for the help Philip.

So I was hoping to use the normal Servlet processing for all requests, and
then do something special to drop a thread when doing comet.
My event method looks like this:

public void event(CometEvent event) throws IOException, ServletException {
    if (event.getEventType() == CometEvent.EventType.BEGIN) {
        event.getHttpServletRequest().setAttribute(ATTRIBUTE_EVENT, event);
    }
    else if (event.getEventType() == CometEvent.EventType.ERROR) {
        event.close();
    }
    else if (event.getEventType() == CometEvent.EventType.END) {
        event.close();
    }
    else if (event.getEventType() == CometEvent.EventType.READ) {
        // Does this handle blocking reads if we just carry on reading?
        service(event.getHttpServletRequest(),
event.getHttpServletResponse());
    }
}

The effect that I'm seeing is a call to event() with event.getEventType() ==
CometEvent.EventType.BEGIN as expected, but I'm expecting some READ events,
but nothing until an ERROR(TIMEOUT) event a bit later.

When Tomcat starts it says:
Jul 17, 2008 10:35:31 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Jul 17, 2008 10:35:35 AM org.apache.coyote.http11.Http11NioProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 17, 2008 10:35:35 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 8828 ms
Jul 17, 2008 10:35:35 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 17, 2008 10:35:35 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14

Do I need to fire up a C compiler to get this to work?

Joe.


On Thu, Jul 17, 2008 at 4:04 AM, Filip Hanik - Dev Lists <devlists@hanik.com>
wrote:

> for your connector element you must have
>
> protocol="org.apache.coyote.http11.Http11NioProtocol"
> or
> protocol="org.apache.coyote.http11.Http11AprProtocol"  (and the APR and
> tcnative libraries in your PATH/LD_LIBRARY_PATH)
>
> Filip
> Joe Walker wrote:
>
>> Hi,
>>
>> It looks like servlet spec 3 is waaaay off. So I'm creating a
>> implementation
>> of CometProcessor in DWR.
>> I've created a new CometProcessor like this:
>>
>> public class DwrCometProcessor extends DwrServlet implements
>> CometProcessor
>>
>> But the event() method is not called. It just leaps straight to service().
>> Is there anything else I need to be doing (clearly I've changed web.xml to
>> point at the new 'servlet' using <servlet-class>
>> org.directwebremoting.servers.tomcat.DwrCometProcessor</servlet-class>)?
>>
>> Joe.
>>
>>  ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG. Version: 7.5.526 / Virus Database: 270.4.11/1554 - Release
>> Date: 7/15/2008 6:03 PM
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message