Error when seding request

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when seding request

thirsch81
Hi everyone,

I got excited about the app-in-a-script idea, but it does not quite work for me.
I tried the example on the main page, executing in Groovy console (when i use the Groovy command line, I get the same error in the browser but no other output at all).

@GrabResolver("https://oss.jfrog.org/repo")
@Grab("org.ratpack-framework:ratpack-groovy:0.9.0-SNAPSHOT")
import static org.ratpackframework.groovy.RatpackScript.ratpack

ratpack {
    handlers {
        get {
            response.send "Hello world!"
        }
    }
}

Jun 18, 2013 12:05:40 PM io.netty.util.internal.PlatformDependent hasJavassist0

INFO: You don't have Javassist in your class path or you don't have enough permission to load dynamically generated classes.  Please check the configuration for better performance.
Jun 18, 2013 12:05:40 PM org.ratpackframework.bootstrap.internal.NettyRatpackService startUp

INFO: Ratpack started for http://localhost:5050


And when I send a request to <a href="http://localhost:5050:">http://localhost:5050:


UNHANDLED EXCEPTION: /
java.lang.NullPointerException
        at org.ratpackframework.groovy.internal.ScriptBackedApp.handle(ScriptBackedApp.java:95)
        at org.ratpackframework.error.internal.ErrorCatchingHandler.handle(ErrorCatchingHandler.java:33)
        at org.ratpackframework.bootstrap.internal.NettyHandlerAdapter.messageReceived(NettyHandlerAdapter.java:84)
        at org.ratpackframework.bootstrap.internal.NettyHandlerAdapter.messageReceived(NettyHandlerAdapter.java:46)
        at io.netty.channel.ChannelHandlerUtil.handleInboundBufferUpdated(ChannelHandlerUtil.java:60)
        at io.netty.channel.ChannelInboundMessageHandlerAdapter.inboundBufferUpdated(ChannelInboundMessageHandlerAdapter.java:100)
        at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1031)
        at io.netty.channel.DefaultChannelHandlerContext.access$1500(DefaultChannelHandlerContext.java:39)
        at io.netty.channel.DefaultChannelHandlerContext$13.run(DefaultChannelHandlerContext.java:1005)
        at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:114)
        at java.lang.Thread.run(Thread.java:722)
UNHANDLED EXCEPTION: /favicon.ico
java.lang.NullPointerException
        at org.ratpackframework.groovy.internal.ScriptBackedApp.handle(ScriptBackedApp.java:95)
        at org.ratpackframework.error.internal.ErrorCatchingHandler.handle(ErrorCatchingHandler.java:33)
        at org.ratpackframework.bootstrap.internal.NettyHandlerAdapter.messageReceived(NettyHandlerAdapter.java:84)
        at org.ratpackframework.bootstrap.internal.NettyHandlerAdapter.messageReceived(NettyHandlerAdapter.java:46)
        at io.netty.channel.ChannelHandlerUtil.handleInboundBufferUpdated(ChannelHandlerUtil.java:60)
        at io.netty.channel.ChannelInboundMessageHandlerAdapter.inboundBufferUpdated(ChannelInboundMessageHandlerAdapter.java:100)
        at io.netty.channel.DefaultChannelHandlerContext.invokeInboundBufferUpdated(DefaultChannelHandlerContext.java:1031)
        at io.netty.channel.DefaultChannelHandlerContext.access$1500(DefaultChannelHandlerContext.java:39)
        at io.netty.channel.DefaultChannelHandlerContext$13.run(DefaultChannelHandlerContext.java:1005)
        at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:114)
        at java.lang.Thread.run(Thread.java:722)



Does anyone have an Idea what the problem mightbe? I already isntalled latest Groovy version...

Thanks for help and regards,
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: Error when seding request

Luke Daley
Administrator
Hi, could you post your ratpack.groovy file please.
Reply | Threaded
Open this post in threaded view
|

Re: Error when seding request

thirsch81
I used the basic example from the web page, that's why I'm puzzled:

@GrabResolver("https://oss.jfrog.org/repo")
@Grab("org.ratpack-framework:ratpack-groovy:0.9.0-SNAPSHOT")
import static org.ratpackframework.groovy.RatpackScript.ratpack

ratpack {
    handlers {
        get {
            response.send "Hello world!"
        }
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Error when seding request

Luke Daley
Administrator
I can't reproduce this.

Try clearing your Grape cacheā€¦

rm -rf ~/.groovy/grapes/org.ratpack-framework