Search code examples
javaplayframeworkguicewebjarsplayframework-2.4

Error running tests in Play Framework after migrating to 2.4.x (Java)


I just migrated from 2.3 to 2.4. The application itself seems to be working, but none of the tests will run. They all fail with the following error:

[error] Test models.TestCountry.createTheater failed: com.google.inject.ProvisionException: Unable to provision, see the following errors:
[error] 
[error] 1) Error injecting constructor, java.lang.IllegalStateException: Got deeper than 5 levels while searching /home/jlei/workspace/ebor-play/target/web/classes/main/META-INF/resources/webjars
[error]   at controllers.WebJarAssets.<init>(WebJarAssets.scala:21)
[error]   at controllers.WebJarAssets.class(WebJarAssets.scala:21)
[error]   while locating controllers.WebJarAssets
[error]     for parameter 18 at router.Routes.<init>(Routes.scala:96)
[error]   while locating router.Routes
[error]   while locating play.api.test.FakeRouterProvider
[error]   while locating play.api.routing.Router
[error] 
[error] 1 error, took 2.828 sec
[error]     at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
[error]     at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
[error]     at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
[error]     at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:316)
[error]     at play.api.Application$class.routes(Application.scala:111)
[error]     at play.api.test.FakeApplication.routes(Fakes.scala:197)
[error]     at play.api.Play$.start(Play.scala:89)
[error]     at play.api.Play.start(Play.scala)
[error]     at play.test.Helpers.start(Helpers.java:450)
[error]     at play.test.WithApplication.startPlay(WithApplication.java:44)
[error]     ...
[error] Caused by: java.lang.IllegalStateException: Got deeper than 5 levels while searching /home/jlei/workspace/ebor-play/target/web/classes/main/META-INF/resources/webjars
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:43)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.aggregateChildren(FileUrlProtocolHandler.java:47)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.listFiles(FileUrlProtocolHandler.java:36)
[error]     at org.webjars.urlprotocols.FileUrlProtocolHandler.getAssetPaths(FileUrlProtocolHandler.java:25)
[error]     at org.webjars.WebJarAssetLocator.getAssetPaths(WebJarAssetLocator.java:89)
[error]     at org.webjars.WebJarAssetLocator.getFullPathIndex(WebJarAssetLocator.java:119)
[error]     at controllers.WebJarAssets.<init>(WebJarAssets.scala:29)
[error]     at controllers.WebJarAssets$$FastClassByGuice$$db4380e1.newInstance(<generated>)
[error]     at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
[error]     at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
[error]     at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
[error]     at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
[error]     at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
[error]     at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
[error]     at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
[error]     at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
[error]     at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
[error]     at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
[error]     at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
[error]     at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
[error]     at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104)
[error]     at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
[error]     at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
[error]     at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
[error]     at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
[error]     at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
[error]     at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
[error]     at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:321)
[error]     at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:67)
[error]     at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:67)
[error]     at scala.Option.fold(Option.scala:158)
[error]     at play.api.inject.RoutesProvider.get$lzycompute(BuiltinModule.scala:67)
[error]     at play.api.inject.RoutesProvider.get(BuiltinModule.scala:63)
[error]     at play.api.test.FakeRouterProvider.get$lzycompute(Fakes.scala:259)
[error]     at play.api.test.FakeRouterProvider.get(Fakes.scala:259)
[error]     at play.api.test.FakeRouterProvider.get(Fakes.scala:258)
[error]     at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
[error]     at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
[error]     at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
[error]     at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
[error]     at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
[error]     at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
[error]     at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
[error]     ... 44 more
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0

I am using the InjectedRoutesGenerator and version 2.4.0-M3-1 of webjars-play. Let me know if there are any other details that might help!

Does anybody have any idea what might be going on?

EDIT:

Dug this up: https://github.com/sbt/sbt-web/issues/104

So seems to be a known issue. Guess I'll be trying to find a creative workaround in the meantime...


Solution

  • This was a problem in sbt-web. They've increased the limit: https://github.com/sbt/sbt-web/issues/104