ring / Clojure 1.5 / contains? runtime exception

151 views
Skip to first unread message

Vilho Räisänen

unread,
Jul 3, 2013, 3:09:21 AM7/3/13
to ring-c...@googlegroups.com
Greetings,

I saw that this topic was discussed and tracked to root causes last December but the issue seems to remain: when using Ring 1.2.0-RC1 (or older) together with Clojure 1.5, the following runtime exception gets thrown in ring.middleware.session:

java.lang.IllegalArgumentException: contains? not supported on type: java.lang.String

The same code worked OK with Clojure 1.4.0. I have added some libraries which require v1.5 so it would be nice to get Ring working too. Please advise. Tx in advance.

    BR,
      Vilho

James Reeves

unread,
Jul 3, 2013, 5:36:40 AM7/3/13
to ring-c...@googlegroups.com
Could you provide the complete stack trace, and the full version of Clojure you're using (presumably 1.5.1)?

Also, the Github issue tracker is the preferred mechanism for raising issues.

- James



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

Vilho Räisänen

unread,
Jul 4, 2013, 1:18:14 AM7/4/13
to ring-c...@googlegroups.com, ja...@booleanknot.com
Sure:

Clojure version is 1.5.1., Ring version 1.2.0-RC1.

Stack trace below.

   BR,
     Vilho

java.lang.IllegalArgumentException: contains? not supported on type: java.lang.String
        at clojure.lang.RT.contains(RT.java:724)
        at clojure.core$contains_QMARK_.invoke(core.clj:1402)
        at ring.middleware.session$bare_session_response.doInvoke(session.clj:33)
        at clojure.lang.RestFn.invoke(RestFn.java:442)
        at ring.middleware.session$session_response.doInvoke(session.clj:54)
        at clojure.lang.RestFn.invoke(RestFn.java:442)
        at ring.middleware.session$wrap_session$fn__1453.invoke(session.clj:85)
        at ring.middleware.params$wrap_params$fn__1481.invoke(params.clj:58)
        at ring.adapter.jetty$proxy_handler$fn__171.invoke(jetty.clj:18)
        at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$0.handle(Unknown Source)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:363)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:679)

James Reeves

unread,
Jul 4, 2013, 5:05:11 AM7/4/13
to ring-c...@googlegroups.com
It looks like you're returning a string instead of a response map. In 1.4.0 the error occurs silently, but 1.5.1 has more type checks on the clojure.core/contains? function, and raises an exception.

- James

Vilho Räisänen

unread,
Jul 4, 2013, 7:37:44 AM7/4/13
to ring-c...@googlegroups.com, ja...@booleanknot.com
[slap in the forehead] You are correct. Ring is not at fault. Thanks a lot, James!
Reply all
Reply to author
Forward
0 new messages