Jetty Error : ServletHandler : java.io.IOException: Missing 'message' request parameter

70 views
Skip to first unread message

John

unread,
Sep 4, 2014, 1:50:23 AM9/4/14
to cometd...@googlegroups.com
Hey,


I am using CometD 3 with Jetty. Sometimes, I get error shown below in my logs, This error is infrequent:

I am not sure what is causing this? Can someone help me understand what should be done in order to avoid this ? Is this harmful ?  




2014-09-02 10:59:29.483:WARN:oejs.ServletHandler:qtp607635164-602: /cometd/disconnect
java.io.IOException: Missing 'message' request parameter
        at org.cometd.server.transport.AbstractStreamHttpTransport.parseMessages(AbstractStreamHttpTransport.java:112)
        at org.cometd.server.transport.JSONTransport.parseMessages(JSONTransport.java:66)
        at org.cometd.server.transport.AbstractStreamHttpTransport.process(AbstractStreamHttpTransport.java:78)
        at org.cometd.server.transport.AbstractStreamHttpTransport.handle(AbstractStreamHttpTransport.java:61)
        at org.cometd.server.CometDServlet.service(CometDServlet.java:103)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
        at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:172)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
        at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:248)
        at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:211)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:485)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:290)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:606)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:535)
        at java.lang.Thread.run(Thread.java:745)

Simone Bordet

unread,
Sep 5, 2014, 3:59:24 AM9/5/14
to cometd-users
Hi,

On Thu, Sep 4, 2014 at 7:50 AM, John <bingj...@gmail.com> wrote:
> Hey,
>
>
> I am using CometD 3 with Jetty. Sometimes, I get error shown below in my
> logs, This error is infrequent:
>
> I am not sure what is causing this? Can someone help me understand what
> should be done in order to avoid this ? Is this harmful ?
>
>
>
>
> 2014-09-02 10:59:29.483:WARN:oejs.ServletHandler:qtp607635164-602:
> /cometd/disconnect
> java.io.IOException: Missing 'message' request parameter

CometD clients should send POST with content-type
"application/json;charset=UTF-8".

For historical reasons, CometD allows also POST with content-type
"application/x-www-form-urlencoded", provided that a "message"
parameter is sent with the JSON representing the message.

So what you're getting here is someone doing the latter, but without
the "message" parameter.

The missing parameter may be due to the fact that the client is bad
(are you using CometD clients ?), or someone is doing a POST to the
wrong URL, or someone is attacking you by sending random POSTs.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

John

unread,
Sep 8, 2014, 6:38:40 AM9/8/14
to cometd...@googlegroups.com

> For historical reasons, CometD allows also POST with content-type
> "application/x-www-form-urlencoded", provided that a "message"
> parameter is sent with the JSON representing the message.

Thanks Simon.
This warning is coming for "/cometd/disconnect" channel. So does it mean that disconnect was not successful? What is the effect on client side from this?

I was not aware of this, Is this check has been added as part of CometD-3 ?


- John

Simone Bordet

unread,
Sep 8, 2014, 6:50:08 AM9/8/14
to cometd-users
Hi,

On Mon, Sep 8, 2014 at 12:38 PM, John <bingj...@gmail.com> wrote:
>
>> For historical reasons, CometD allows also POST with content-type
>> "application/x-www-form-urlencoded", provided that a "message"
>> parameter is sent with the JSON representing the message.
>
> Thanks Simon.
> This warning is coming for "/cometd/disconnect" channel.

I have doubts. Do you have proof ?

> So does it mean
> that disconnect was not successful? What is the effect on client side from
> this?
>
> I was not aware of this, Is this check has been added as part of CometD-3 ?

Been there since CometD 1.

John

unread,
Sep 8, 2014, 7:19:41 AM9/8/14
to cometd...@googlegroups.com
> I have doubts. Do you have proof ?

Yes. Below is the warning coming in logs (I have highlighted /cometd/disconnect):
 

2014-09-07 10:59:29.483:WARN:oejs.ServletHandler:qtp607635164-602: /cometd/disconnect
java.io.IOException: Missing 'message' request parameter

Simone Bordet

unread,
Sep 8, 2014, 7:35:41 AM9/8/14
to cometd-users
Hi,

On Mon, Sep 8, 2014 at 1:19 PM, John <bingj...@gmail.com> wrote:
>> I have doubts. Do you have proof ?
>
> Yes. Below is the warning coming in logs (I have highlighted
> /cometd/disconnect):
>
>
> 2014-09-07 10:59:29.483:WARN:oejs.ServletHandler:qtp607635164-602:
> /cometd/disconnect
> java.io.IOException: Missing 'message' request parameter

Ok, who's sending this disconnect() ?

The CometD libraries do not, to my knowledge, send messages without
using the correct Content-Type.

What JS toolkit are you using, what version ?

Anuj Khandelwal

unread,
Sep 8, 2014, 7:46:48 AM9/8/14
to cometd...@googlegroups.com
Actually I have lot of clients connecting to the CometD server in my setup. Most of them are using CometD JS libraries from the cometd package only (cometd.js, jquery.cometd.js etc.) but some of them might be using old versions of jquery. I will recommend them to upgrade to latest jquery-2.1.1 and with all latest configuration. After that we should not see this warning hopefully.

Just want to confirm that this warning which I am getting for "/cometd/disconnect" is not harmful and should not cause any communication failure (like message is lost etc) ?


 


--
--
You received this message because you are subscribed to the Google Groups "cometd-users" group.
To post to this group, send email to cometd...@googlegroups.com
To unsubscribe from this group, send email to cometd-users...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cometd-users

Visit the CometD website at http://www.cometd.org

---
You received this message because you are subscribed to the Google Groups "cometd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cometd-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anuj Khandelwal

unread,
Sep 8, 2014, 7:49:05 AM9/8/14
to cometd...@googlegroups.com
Posting above message on behalf on John (my colleague)

Simone Bordet

unread,
Sep 8, 2014, 7:52:44 AM9/8/14
to cometd-users
Hi,

On Mon, Sep 8, 2014 at 1:46 PM, Anuj Khandelwal
<khandelw...@gmail.com> wrote:
> Actually I have lot of clients connecting to the CometD server in my setup.
> Most of them are using CometD JS libraries from the cometd package only
> (cometd.js, jquery.cometd.js etc.) but some of them might be using old
> versions of jquery. I will recommend them to upgrade to latest jquery-2.1.1
> and with all latest configuration. After that we should not see this warning
> hopefully.
>
> Just want to confirm that this warning which I am getting for
> "/cometd/disconnect" is not harmful and should not cause any communication
> failure (like message is lost etc) ?

I am not sure what you mean by this last paragraph.
If you are disconnecting, you *are* causing a communication failure,
that's what you want.
Messages lost are an orthogonal issue. They may be lost, they may not,
depending on a number of factors.
Reply all
Reply to author
Forward
0 new messages