question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile Error in 1.4 Tech Hub Starter (Scala)

See original GitHub issue

Resolution : do not use “lagom” as the project name when starting a project from Tech Hub

Lagom : Version 1.4

API : Scala

Operating System : MacOS 10.13.3

JDK : Oracle 1.8.0_152

java version “1.8.0_152” Java™ SE Runtime Environment (build 1.8.0_152-b16) Java HotSpot™ 64-Bit Server VM (build 25.152-b16, mixed mode)

Library Dependencies

standard dependencies for the tech hub starter project

Expected Behavior

  1. download lagom scala 1.4 starter project
  2. run permissions adjustments on sbt files per the instructions
  3. run ‘sbt runAll’, project initializes
  4. lagom started compiles and runs,
  5. open browser to http://localhost:9000/api/hello/World and see message

Actual Behavior

  1. as expected
  2. as expected
  3. as expected
  4. lagom starts up the demo services, but sbt fails to compile the following
    • lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:26
    • lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:27
    • lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:33
    • lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:39
    • (see below for complete sbt output)
  5. receive the browser error “Action Not Found For request ‘GET /api/hello/World’ These routes have been tried, in this order: GET \Q/stream\E Service: lagom-stream (http://0.0.0.0:57104)”

sbt output

2012MBP:lagom sailer$ sbt runAll
[info] Loading project definition from /Users/sailer/Downloads/lagom/project
[info] Set current project to lagom (in build file:/Users/sailer/Downloads/lagom/)
[info] Starting Kafka
[info] Starting Cassandra
..........
[info] Cassandra server running at 127.0.0.1:4000
2018-01-29T11:51:49.112Z [info] akka.event.slf4j.Slf4jLogger [] - Slf4jLogger started
2018-01-29T11:51:51.470Z [info] com.lightbend.lagom.discovery.ServiceLocatorServer [] - Service locator can be reached at http://localhost:9008
2018-01-29T11:51:51.470Z [info] com.lightbend.lagom.discovery.ServiceLocatorServer [] - Service gateway can be reached at http://localhost:9000
[info] Service locator is running at http://localhost:9008
[info] Service gateway is running at http://localhost:9000
04:51:53.779 [info] play.core.server.AkkaHttpServer [] - Listening for HTTP on /0:0:0:0:0:0:0:0:57104
04:51:53.946 [info] play.core.server.AkkaHttpServer [] - Listening for HTTP on /0:0:0:0:0:0:0:0:63779
[info] Compiling 3 Scala sources to /Users/sailer/Downloads/lagom/lagom-impl/target/scala-2.12/classes...
04:51:54.819 [info] akka.event.slf4j.Slf4jLogger [] - Slf4jLogger started
04:51:56.073 [info] play.api.Play [] - Application started (Dev)
[error] /Users/sailer/Downloads/lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:26: illegal cyclic reference involving class LagomApplication
[error] abstract class LagomApplication(context: LagomApplicationContext)
[error]                                ^
[error] /Users/sailer/Downloads/lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:27: no arguments allowed for nullary constructor Object: ()Object
[error]   extends LagomApplication(context)
[error]                            ^
[error] /Users/sailer/Downloads/lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:33: not found: value serverFor
[error]   override lazy val lagomServer = serverFor[LagomService](wire[LagomServiceImpl])
[error]                                   ^
[error] /Users/sailer/Downloads/lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:33: recursive lazy value lagomServer needs type
[error]   override lazy val lagomServer = serverFor[LagomService](wire[LagomServiceImpl])
[error]                                                               ^
[error] /Users/sailer/Downloads/lagom/lagom-impl/src/main/scala/com/example/hello/impl/LagomLoader.scala:39: not found: value persistentEntityRegistry
[error]   persistentEntityRegistry.register(wire[LagomEntity])
[error]   ^
[error] 5 errors found
[error] (lagom-impl/compile:compileIncremental) Compilation failed
[info] Service lagom-stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:57104
[info] Service lagom-impl listening for HTTP on 0:0:0:0:0:0:0:0:63779
[info] (Services started, press enter to stop and go back to the console...)

Reproducible Test Case

Using the standard starter from Tech Hub reproduces this failure.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TimMoorecommented, Jan 30, 2018

I think there’s a way to add some validation to this field, so we should disallow values that are known to be broken like this.

0reactions
jfspencercommented, Jan 29, 2018

@renatocaval ah yes, thanks! I was using “lagom” as the project name from the tech hub page. should have figured it would have caused name collisions 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

SBT 1.4.1 prints Compilation failed in shell, that is ... - GitHub
When I run run sbt compile (note there is no ~ in the command) in a project with a compilation error in sbt...
Read more >
Scala SBT compile error - intellij idea - Stack Overflow
First error: Scala 2.9.x requires JVM runtime v 1.6 or 1.7, while you are using 1.8, which wouldn't work as we can clearly...
Read more >
eed3si9n
I am Eugene Yokota (@eed3si9n on Twitter and GitHub), a software engineer with years of experience working on Scala tooling. Most recently I...
Read more >
Requirements - 2.8.x - Play Framework
A Play application only needs to include the Play JAR files to run properly. These JAR files are published to the Maven Repository,...
Read more >
Scala compiler crash (?)
If I run “sbt compile”, the compiler throws up with a bunch of errors such as: [error] (Compile / compileIncremental) java.lang.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found