Giter Site home page Giter Site logo

cannot treat nil as http response about yada HOT 2 CLOSED

0xqd avatar 0xqd commented on August 16, 2024
cannot treat nil as http response

from yada.

Comments (2)

malcolmsparks avatar malcolmsparks commented on August 16, 2024

Try http://localhost:3000/hello or http://localhost:3000/hello-atom

The reason it fails is that there is no route for / and there is no handler defined for the case where no route matches. IIRC you can actually do this in bidi by providing a catch-all true - but make sure you use the 'vector-of-vectors' form rather than the map-form, because it's important the true is matched last (maps in clojure are unordered)

["/" [["hello" (yada "hello world" {:id :hello})]
      ["hello-atom" (yada (atom "hello world"))]
      [true (yada nil)]]]

Closing for now but please re-open if you want.

from yada.

0xqd avatar 0xqd commented on August 16, 2024

hmm, I use the same routes definition above and I got another error :

backend.yada.core=> Dec 31, 2015 6:21:23 PM io.netty.channel.DefaultChannelPipeline$TailContext exceptionCaught
WARNING: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.channel.ChannelPipelineException: io.netty.handler.codec.http.HttpServerCodec.handlerAdded() has thrown an exception; removed.
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:501)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded(DefaultChannelPipeline.java:482)
    at io.netty.channel.DefaultChannelPipeline.addLast0(DefaultChannelPipeline.java:146)
    at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:129)
    at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:120)
    at aleph.http.server$pipeline_builder$fn__25246.invoke(server.clj:385)
    at aleph.netty$pipeline_initializer$reify__24879.channelRegistered(netty.clj:478)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRegistered(AbstractChannelHandlerContext.java:162)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRegistered(AbstractChannelHandlerContext.java:148)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:734)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:450)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:378)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:424)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError: tried to access method io.netty.channel.DefaultChannelPipeline.generateName(Lio/netty/channel/ChannelHandler;)Ljava/lang/String; from class io.netty.channel.ChannelHandlerAppender
    at io.netty.channel.ChannelHandlerAppender.handlerAdded(ChannelHandlerAppender.java:190)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:488)
    ... 17 more

// note, @malcolmsparks I cannot reopen this issue so I reference you instead.

from yada.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.