Atmosphere- Comet - Chat application not working

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Atmosphere- Comet - Chat application not working

prashanth n
Hi,

I have created an application (running it in Tomcat server ) exactly as you have mentioned in your blog "http://weblogs.java.net/blog/jfarcand/archive/2009/03/getting_started_1.html" but for some reason i am getting the error message as

After deploying the war to the latest version of Tomcat when I try to login it returns with the following 500 error.
javax.servlet.ServletException: Tomcat failed to detect this is a Comet application
Please add the following content under your META-INF/context.xml of your war file.


This is already there. Any ideas?

your help is greately appreciated.

Thanks
Prashanth N
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

Jeanfrancois Arcand
Salut,

prashanth n wrote:

> Hi,
>
> I have created an application (running it in Tomcat server ) exactly as
> you have mentioned in your blog
> "http://weblogs.java.net/blog/jfarcand/archive/2009/03/getting_started_1.html"
> but for some reason i am getting the error message as
>
> After deploying the war to the latest version of Tomcat when I try to
> login it returns with the following 500 error.
> javax.servlet.ServletException: Tomcat failed to detect this is a Comet
> application
> Please add the following content under your META-INF/context.xml of your
> war file.
>

Have you enabled the Tomcat AIO Connector:

http://tomcat.apache.org/tomcat-6.0-doc/aio.html

Is your application have the context.xml file under META-INF/

<Context>        <Loader delegate="true"/>    </Context>

Thanks

-- Jeanfrancois


>
> This is already there. Any ideas?
>
> your help is greately appreciated.
>
> Thanks
> Prashanth N

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

钟摆
Hi Jeanfrancois Arcand,
I have download atmosphere-chat-0.1-20090406.151656-2.war from Atmosphere Site,appear 2 errors:
1. web.xml error:
tomcat log segment:
Parse error in application web.xml file at jndi:/localhost/atmosphere-chat/WEB-INF/web.xml
        java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name Atmosphere Chat
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2726)


cause:
    <servlet>
        <servlet-name>AtmosphereServlet</servlet-name>
        <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet> 
   <servlet-mapping>
       <servlet-name>Atmosphere Chat</servlet-name>
        <url-pattern>/ChatAtmosphereHandler</url-pattern>
   </servlet-mapping>
 
this servlet name Atmosphere Chat not exist,modify Atmosphere Chat to AtmosphereServlet OK.

2.Invalid AtmosphereHandler
this error Invalid AtmosphereHandler same.
tomcat log segment:
javax.servlet.ServletException: Invalid AtmosphereHandler
 at org.atmosphere.cpr.WebContainer.map(WebContainer.java:134)
 at org.atmosphere.cpr.WebContainer.action(WebContainer.java:107)


I have modify tomcat/conf/server.xml,:
<Connector protocol="<b>HTTP/1.1" .../> TO  
<Connector protocol="<b>org.apache.coyote.http11.Http11NioProtocol" .../>

Enabled the Tomcat AIO Connector。

following error log:error_log.zip

your help is greately appreciated.
Tanks
Ram
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

Jeanfrancois Arcand
Salut,

钟摆 wrote:

> Hi Jeanfrancois Arcand,
> I have download atmosphere-chat-0.1-20090406.151656-2.war from Atmosphere Site ,appear 2 errors:
> 1. web.xml error:
> tomcat log segment:
> Parse error in application web.xml file at jndi:/localhost/atmosphere-chat/WEB-INF/web.xml
> java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name Atmosphere Chat
> at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2726)
>
> cause:
>     <servlet>
>         <servlet-name>AtmosphereServlet</servlet-name>
>         <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
>         <load-on-startup>0</load-on-startup>
>     </servlet>  
>    <servlet-mapping>
>        <servlet-name>Atmosphere Chat</servlet-name>
>         <url-pattern>/ChatAtmosphereHandler</url-pattern>
>    </servlet-mapping>
>  
> this servlet name Atmosphere Chat not exist,modify Atmosphere Chat to AtmosphereServlet OK.

ah! My bad. I've commited the fix.


>
> 2.Invalid AtmosphereHandler
> this error Invalid AtmosphereHandler  same.
> tomcat log segment:
> javax.servlet.ServletException: Invalid AtmosphereHandler
>  at org.atmosphere.cpr.WebContainer.map(WebContainer.java:134)
>  at org.atmosphere.cpr.WebContainer.action(WebContainer.java:107)
>
> I have modify tomcat/conf/server.xml,:
> <Connector protocol="HTTP/1.1" .../> TO  
> <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" .../>
>
> Enabled the Tomcat AIO Connector。
>
> following error log: error_log.zip

Can you send me the ZIp file directly as the mail filtered it: jfarcand
at apache dot org.

Also which request are you typing?

>
> your help is greately appreciated.

You are welcome. Please feel free to ask questions and thanks for the help!

--Jeanfrancois

> Tanks
> Ram

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

ncornag
Hi!

Any news with the issue? I have the same problem...

Regards,
Niko.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

Jeanfrancois Arcand
Salut,

can you download the following:

https://grizzly.dev.java.net/issues/show_bug.cgi?id=527

deploy and send me the localhostXX .log from Tomcat? For me it works
fine with Tomcat 6.0.16.

Thanks!

-- Jeanfrancois

ncornag wrote:
> Hi!
>
> Any news with the issue? I have the same problem...
>
> Regards,
> Niko.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

ncornag
Jeanfrancois,

If I put
    context-root="/ChatAtmosphereHandler"
in the atmosphere.xml file, I get rid of the
    "javax.servlet.ServletException: Invalid AtmosphereHandler"
error.

But I have now a:

java.lang.UnsupportedOperationException
        at org.apache.catalina.connector.CometEventImpl.setTimeout(CometEventImpl.java:120)
        at org.atmosphere.container.TomcatCometSupport.service(TomcatCometSupport.java:115)
        at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:355)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:470)
        at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:363)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
        at java.lang.Thread.run(Thread.java:619)

The error disappear if I not use the APR library (tcnative-1.dll in win32), but in that case I have a:
    WARNING: Tomcat failed to detect this is a Comet application because context.xml is missing or the     Http11NioProtocol Connector is not enabled.
    Enable it or if enabled add the following content under your META-INF/context.xml of your war file.
    <Context>        <Loader delegate="true"/>        </Context>
    Apr 8, 2009 10:54:13 AM org.atmosphere.cpr.AtmosphereServlet service
    WARNING: Using the BlockingIOCometSupport.

I verified, and I positively have the context.xml file with that lines...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

ncornag
After re-rechecking, I have the Http11NioProtocol, with APR and the context-root="/ChatAtmosphereHandler" in atmosphere.xml, all working well.
But it only works in Firefox. With IE7 and Chrome I have a NPE in the line:
    String action = req.getParameterValues("action")[0];

ncornag wrote
Jeanfrancois,

If I put
    context-root="/ChatAtmosphereHandler"
in the atmosphere.xml file, I get rid of the
    "javax.servlet.ServletException: Invalid AtmosphereHandler"
error.

But I have now a:

java.lang.UnsupportedOperationException
        at org.apache.catalina.connector.CometEventImpl.setTimeout(CometEventImpl.java:120)
        at org.atmosphere.container.TomcatCometSupport.service(TomcatCometSupport.java:115)
        at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:355)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:470)
        at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:363)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
        at java.lang.Thread.run(Thread.java:619)

The error disappear if I not use the APR library (tcnative-1.dll in win32), but in that case I have a:
    WARNING: Tomcat failed to detect this is a Comet application because context.xml is missing or the     Http11NioProtocol Connector is not enabled.
    Enable it or if enabled add the following content under your META-INF/context.xml of your war file.
    <Context>        <Loader delegate="true"/>        </Context>
    Apr 8, 2009 10:54:13 AM org.atmosphere.cpr.AtmosphereServlet service
    WARNING: Using the BlockingIOCometSupport.

I verified, and I positively have the context.xml file with that lines...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

ncornag
Another update! :)

After removing the following lines of "application.js" it works on IE7:
    requestHeaders: ['Content-Type',
    'application/x-www-form-urlencoded; charset=UTF-8'],

Chrome still fails, sending the messages ok, but failing showing them in its own window.

Done for me!
Nico.

ncornag wrote
After re-rechecking, I have the Http11NioProtocol, with APR and the context-root="/ChatAtmosphereHandler" in atmosphere.xml, all working well.
But it only works in Firefox. With IE7 and Chrome I have a NPE in the line:
    String action = req.getParameterValues("action")[0];
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

Jeanfrancois Arcand
Salut,

ncornag wrote:
> Another update! :)
>
> After removing the following lines of "application.js" it works on IE7:
>     requestHeaders: ['Content-Type',
>     'application/x-www-form-urlencoded; charset=UTF-8'],
>
> Chrome still fails, sending the messages ok, but failing showing them in its own window.

Thanks for the hint! I will go ahead and fix the issue you reported with
APR (haven't tested) and also fix the sample.


>
> Done for me!

I hope not!!! I like feedback like that!!

THANKS!

-- Jeanfrancois


> Nico.
>
>
> After re-rechecking, I have the Http11NioProtocol, with APR and the context-root="/ChatAtmosphereHandler" in atmosphere.xml, all working well.
> But it only works in Firefox. With IE7 and Chrome I have a NPE in the line:
>     String action = req.getParameterValues("action")[0];
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Atmosphere- Comet - Chat application not working

Jeanfrancois Arcand
Salut,

FYI I've filled 3 issues based on your feedback:

Tomcat APR
https://atmosphere.dev.java.net/issues/show_bug.cgi?id=1

IE 7
https://atmosphere.dev.java.net/issues/show_bug.cgi?id=2

Chrome
https://atmosphere.dev.java.net/issues/show_bug.cgi?id=3

Thanks!

-- Jeanfrancois

Jeanfrancois Arcand wrote:

> Salut,
>
> ncornag wrote:
>> Another update! :)
>>
>> After removing the following lines of "application.js" it works on IE7:
>>     requestHeaders: ['Content-Type',
>>     'application/x-www-form-urlencoded; charset=UTF-8'],
>>
>> Chrome still fails, sending the messages ok, but failing showing them
>> in its own window.
>
> Thanks for the hint! I will go ahead and fix the issue you reported with
> APR (haven't tested) and also fix the sample.
>
>
>>
>> Done for me!
>
> I hope not!!! I like feedback like that!!
>
> THANKS!
>
> -- Jeanfrancois
>
>
>> Nico.
>>
>>
>> After re-rechecking, I have the Http11NioProtocol, with APR and the
>> context-root="/ChatAtmosphereHandler" in atmosphere.xml, all working
>> well.
>> But it only works in Firefox. With IE7 and Chrome I have a NPE in the
>> line:
>>     String action = req.getParameterValues("action")[0];
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...