Cometd on Tomcat 6.0.2 and HTTPS

84 views
Skip to first unread message

Sudeep Pradhan

unread,
Jun 21, 2011, 1:58:59 PM6/21/11
to cometd...@googlegroups.com
Hi,

I am a newbie in cometd and bayeux. I am trying out a sample chatService (From here) and tried to add SSL using this. I have also used spring integration. The server I am using is Tomcat 6.0.2 and it starts up correctly. When I try to connect to it using my client I get

2011-06-21 10:50:32.465:INFO:org.cometd.client.BayeuxClient@6997089:
java.net.ProtocolException: Unexpected response 302: TransportExchange@23328673=POST//localhost:8443/cometd/handshake#7
    at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:969)
    at org.cometd.client.transport.LongPollingTransport$TransportExchange.onResponseComplete(LongPollingTransport.java:291)
    at org.eclipse.jetty.client.HttpExchange$Listener.onResponseComplete(HttpExchange.java:920)
    at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:263)
    at org.eclipse.jetty.client.HttpConnection$Handler.messageComplete(HttpConnection.java:622)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:602)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
    at org.eclipse.jetty.client.HttpConnection.handle(HttpConnection.java:269)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:515)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
    at java.lang.Thread.run(Thread.java:619)

I used the following code for authentication:

Map<String, Object> authData = new HashMap<String, Object>();
        authData.put("username", "username");
        authData.put("password", "password");
        client.handshake(authData);


Any help is greatly appreciated.

Thanks.

Simone Bordet

unread,
Jun 21, 2011, 2:33:32 PM6/21/11
to cometd...@googlegroups.com
Hi,

The server is sending a 302 that is unexpected.
Either you are not hitting the CometdServlet, or you have a filter
that redirects before, or something like that.

Simon
--
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz

Sudeep Pradhan

unread,
Jun 21, 2011, 2:44:46 PM6/21/11
to cometd...@googlegroups.com
Simon,

I have added the following to my web.xml

    <filter>
        <filter-name>continuation</filter-name>
        <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>continuation</filter-name>
        <url-pattern>/cometd/*</url-pattern>
    </filter-mapping>

I also checked that there are no other filters. How can I check if the CometdServlet is loaded and the cometd services are up and running?

Thanks.

Simone Bordet

unread,
Jun 21, 2011, 2:53:22 PM6/21/11
to cometd...@googlegroups.com
Hi,

Sorry if I ask, but are you pointing to the correct URL ?
Sure you are using "https" and not "http" as scheme ?

Nothing in CometD sends a 302 so it must be something else that is
being hit before... perhaps the redirection to the confidential port
by Tomcat ?

Reply all
Reply to author
Forward
0 new messages