Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finatra-hello-world does not compile #219

Closed
timoreimann opened this issue Jun 30, 2015 · 5 comments

Comments

@timoreimann
Copy link

commented Jun 30, 2015

I tried to run finatra-hello-world as described in the README file via

sbt -Dlogback.configurationFile=src/test/resources/logback-test.xml run

Unfortunately, this leads to a number of compiler errors:

$ sbt -Dlogback.configurationFile=src/test/resources/logback-test.xml run
[info] Loading global plugins from /Users/treimann/.sbt/0.13/plugins
[info] Loading project definition from /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/project
[info] Set current project to finatra-hello-world (in build file:/Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/)
[info] Compiling 3 Scala sources to /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/target/scala-2.10/classes...
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldController.scala:3: object finagle is not a member of package com.twitter
[error] import com.twitter.finagle.http.Request
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldController.scala:4: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.http.Controller
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldController.scala:6: not found: type Controller
[error] class HelloWorldController extends Controller {
[error]                                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldController.scala:8: not found: value get
[error]   get("/hi") { request: Request =>
[error]   ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldController.scala:13: not found: value post
[error]   post("/hi") { hiRequest: HiRequest =>
[error]   ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:3: object finagle is not a member of package com.twitter
[error] import com.twitter.finagle.http.{Response, Request}
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:4: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.http.HttpServer
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:5: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.http.filters.CommonFilters
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:6: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.http.routing.HttpRouter
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:7: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.logging.filter.{TraceIdMDCFilter, LoggingMDCFilter}
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:8: object finatra is not a member of package com.twitter
[error] import com.twitter.finatra.logging.modules.Slf4jBridgeModule
[error]                    ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:12: not found: type HttpServer
[error] class HelloWorldServer extends HttpServer {
[error]                                ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:13: not found: value Slf4jBridgeModule
[error]   override def modules = Seq(Slf4jBridgeModule)
[error]                              ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:15: not found: type HttpRouter
[error]   override def configureHttp(router: HttpRouter) {
[error]                                      ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:17: not found: type LoggingMDCFilter
[error]       .filter[LoggingMDCFilter[Request, Response]]
[error]               ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:18: not found: type TraceIdMDCFilter
[error]       .filter[TraceIdMDCFilter[Request, Response]]
[error]               ^
[error] /Users/treimann/Development/repos/third-party/twitter/finatra/examples/finatra-hello-world/src/main/scala/com/twitter/hello/HelloWorldServer.scala:19: not found: type CommonFilters
[error]       .filter[CommonFilters]
[error]               ^
[error] 17 errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 1 s, completed 30.06.2015 14:41:59

I wondered if I first had to build and/or publish artifacts from the root project, but playing around there didn't help either.

Am I missing something?

@cacoco

This comment has been minimized.

Copy link
Member

commented Jun 30, 2015

Hi @timoreimann -- it looks like that README.md is actually out of date. We recently moved the standalone examples to finatra-examples. I'll make a note to update this README.md.

To run the example in finatra (which is not standalone) you need to build the project from the top-level, e.g.,

$ sbt
> projects
[info] In file:/Users/ccoco/github/twitter/finatra/
[info]     benchmarks
[info]     helloWorld
[info]     http
[info]     httpclient
[info]     injectApp
[info]     injectCore
[info]     injectModules
[info]     injectRequestScope
[info]     injectServer
[info]     injectThriftClient
[info]     jackson
[info]   * root
[info]     slf4j
[info]     twitterClone
[info]     utils
> project helloWorld
[info] Set current project to finatra-hello-world (in build file:/Users/ccoco/github/twitter/finatra/)
> run
...

Or more simply (from the base finatra directory):

$ sbt helloWorld/run

Let me know if that doesn't work. Thanks!

@cacoco

This comment has been minimized.

Copy link
Member

commented Jul 1, 2015

@timoreimann we've updated the README.md in finatra/examples/finatra-hello-world. Let us know if you're still having issues building and running the example. Thanks!

@timoreimann

This comment has been minimized.

Copy link
Author

commented Jul 1, 2015

@cacoco working like a charm now. Thanks!

One more question before closing the ticket: Do you have any plans to retire/remove the examples in finatra in favor of finatra-examples? I suppose it'd be nice to have a single repository of exemplary truth. :)

@timoreimann

This comment has been minimized.

Copy link
Author

commented Jul 1, 2015

Actually, I think I can come up with at least one good use case to keep the examples, which is to be able to modify the Finatra code and test the changes fairly quickly through the hello-world app. Having the Finatra source code and application separated would make this much harder.

Anyways, I think we're good to close the ticket. Thanks again!

@timoreimann timoreimann closed this Jul 1, 2015

@cacoco

This comment has been minimized.

Copy link
Member

commented Jul 2, 2015

@timoreimann we plan on keeping the examples that currently exist in finatra/examples as well as add more that exercise new functionality when features become available.

The finatra-examples project will live independently and we hope to have others contribute new interesting examples there. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.