basic docs example incorrect moving from 0.11.0 to 0.11.1

80 views
Skip to first unread message

Alissa Pajer

unread,
May 22, 2014, 4:28:22 AM5/22/14
to dispatc...@googlegroups.com
In version `0.11.0` the following works. But in version `0.11.1` I get `NoSuchMethodError`. I'm seeing this same error in the docs example as well as in my own code.

This example is from the docs here: http://dispatch.databinder.net/Dispatch.html. What is the correct way to perform this example in dispatch version `0.11.1`?

```
import dispatch._, Defaults._
val svc = url("http://api.hostip.info/country.php")
val country = Http(svc OK as.String)
```

And the error:

```
scala> val country = Http(svc OK as.String)
java.lang.NoSuchMethodError: org.jboss.netty.handler.codec.http.HttpHeaders.set(Ljava/lang/String;Ljava/lang/Object;)Lorg/jboss/netty/handler/codec/http/HttpHeaders;
  at org.jboss.netty.handler.codec.http.DefaultHttpMessage.setHeader(DefaultHttpMessage.java:54)
  at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.construct(NettyAsyncHttpProvider.java:691)
  at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.buildRequest(NettyAsyncHttpProvider.java:648)
  at com.ning.http.client.providers.netty.NettyConnectListener$Builder.build(NettyConnectListener.java:144)
  at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:1068)
  at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:933)
  at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:524)
  at dispatch.HttpExecutor$class.apply(execution.scala:47)
  at dispatch.Http.apply(execution.scala:12)
  at dispatch.HttpExecutor$class.apply(execution.scala:42)
  at dispatch.Http.apply(execution.scala:12)
  ... 43 elided
```

Thanks,
Alissa

Alissa Pajer

unread,
May 22, 2014, 5:02:32 AM5/22/14
to dispatc...@googlegroups.com
Update: Wiped my .ivy2 cache and ran `sbt clean`, just in case. But still have the same problem.

Nathan Hamblen

unread,
May 22, 2014, 8:14:32 AM5/22/14
to dispatc...@googlegroups.com
Hi Alissa, I'm not seeing that when I run the example code. Are you
testing with an independent project, in a clean directory where you've
run this?

echo 'libraryDependencies +=
"net.databinder.dispatch" %% "dispatch-core" % "0.11.1"' > build.sbt

Just guessing from the stack trace, it might be that you have dispatch
in combination with some other build instructions that might be
requesting a different version of netty.

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

Alissa Pajer

unread,
May 22, 2014, 9:01:59 AM5/22/14
to dispatc...@googlegroups.com
Awesome, thank you!! I indeed was not in an independent project and I do have other dependencies depending on netty.

I upgraded everything to its latest version in my build.sbt, and now I can run the demo example again!

Thanks :)
Alissa

Nathan Hamblen

unread,
May 22, 2014, 10:11:30 AM5/22/14
to dispatc...@googlegroups.com

No problem, glad you got it figured out. :-)

To unsubscribe from this group and stop receiving emails from it, send an email to dispatch-scal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages