Run async task from sbt with Play 2.4.2 framework - java

I'd like to be able to execute a short routine written in scala (or java) within Play Framework environment. I want to be able to work with models backed with my production database.
note: I know there's a possibility to have jobs executed by akka using Akka.system().scheduler().schedule which is what I am moving away from. In my case, the server runs multiple times so I need to use mutexes to make sure only one instance does the scheduled job ...
I want to have a simple cron job executing:
sbt fulfillmentUdpate
This is where I got:
Top part of my build.sbt file:
def registerTask(name: String, taskClass: String, description: String) = {
val sbtTask = (dependencyClasspath in Runtime) map { (deps) =>
val depURLs = deps.map(_.data.toURI.toURL).toArray
val classLoader = new URLClassLoader(depURLs, null)
val task = classLoader.
loadClass(taskClass).
newInstance().
asInstanceOf[Runnable]
task.run()
}
TaskKey[Unit](name, description) <<= sbtTask.dependsOn(compile in Compile)
}
lazy val hello = taskKey[Unit]("Fulfillment update")
lazy val root = (project in file(".")).enablePlugins(PlayJava).enablePlugins(SbtWeb)
.settings(
registerTask("fulfillment-update","tasks.FulfillmentUpdate", "Update Shipments with data from fulfillment center")
)
I defined the scala code in app/tasks directory:
package tasks
import com.typesafe.config.ConfigFactory
import play.api._
import play.api.inject.guice.GuiceApplicationBuilder
abstract class Task extends Runnable {
val config = Configuration(ConfigFactory.load(this.getClass.getClassLoader, "application.conf"))
val env = Environment(new java.io.File("."), config.getClass.getClassLoader, Mode.Dev)
val application = new GuiceApplicationBuilder()
.configure(config)
.build
}
class FulfillmentUpdate extends Task {
def run {
println("Hey!")
}
}
The scala code gets picked up correctly, so I think the build.sbt part is okay. However, .build fails. There's a bunch of exceptions, but the gist is that Play is unable to connect to the database. If I print out the config variable I can see the expected config data present. I am not sure what class loader should I pass and what the java.io.File is for - I suspect the problem is there.
Where's what sbt/play prints out when I try to run the job.
13:48:04.509 [info] application - Creating Pool for datasource 'default'
13:48:05.178 [info] application - Creating Pool for datasource 'default'
[trace] Stack trace suppressed: run last *:fulfillmentUpdate for the full output.
[error] (*:fulfillmentUpdate) com.google.inject.CreationException: Unable to create injector, see the following errors:
[error]
[error] 1) Error in custom provider, Configuration error: Configuration error[Cannot connect to database [default]]
[error] while locating play.api.db.DBApiProvider
[error] while locating play.api.db.DBApi
[error] for parameter 0 at play.db.DefaultDBApi.<init>(DefaultDBApi.java:28)
[error] at play.db.DefaultDBApi.class(DefaultDBApi.java:28)
[error] while locating play.db.DefaultDBApi
[error] while locating play.db.DBApi
[error] for field at play.db.DBModule$NamedDatabaseProvider.dbApi(DBModule.java:61)
[error] while locating play.db.DBModule$NamedDatabaseProvider
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
[error] at play.db.DBModule.bindings(DBModule.java:40):
[error] Binding(interface play.db.Database qualified with QualifierInstance(#play.db.NamedDatabase(value=default)) to ProviderTarget(play.db.DBModule$NamedDatabaseProvider#6475e778)) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
[error] Caused by: Configuration error: Configuration error[Cannot connect to database [default]]
[error] at play.api.Configuration$.configError(Configuration.scala:178)
[error] at play.api.Configuration.reportError(Configuration.scala:829)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42)
[error] at scala.collection.immutable.List.foreach(List.scala:381)
[error] at play.api.db.DefaultDBApi.connect(DefaultDBApi.scala:42)
[error] at play.api.db.DBApiProvider.get$lzycompute(DBModule.scala:72)
[error] at play.api.db.DBApiProvider.get(DBModule.scala:62)
[error] at play.api.db.DBApiProvider.get(DBModule.scala:58)
[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.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.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.FactoryProxy.get(FactoryProxy.java:56)
[error] at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:54)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
[error] at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:62)
[error] at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies$$FastClassByGuice$$2a7177aa.invoke(<generated>)
[error] at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
[error] at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:57)
[error] at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:91)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
[error] at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:174)
[error] at com.google.inject.internal.Initializer.injectAll(Initializer.java:108)
[error] at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174)
[error] at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
[error] at com.google.inject.Guice.createInjector(Guice.java:96)
[error] at com.google.inject.Guice.createInjector(Guice.java:73)
[error] at com.google.inject.Guice.createInjector(Guice.java:62)
[error] at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
[error] at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
[error] at tasks.Task.<init>(FulfillmentUpdate.scala:16)
[error] at tasks.FulfillmentUpdate.<init>(FulfillmentUpdate.scala:23)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[error] at java.lang.Class.newInstance(Class.java:442)
[error] at $83fce2be1de409ac7c44$$anonfun$1.apply(build.sbt:20)
[error] at $83fce2be1de409ac7c44$$anonfun$1.apply(build.sbt:15)
[error] at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[error] at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:63)
[error] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[error] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[error] at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[error] at sbt.Execute.work(Execute.scala:235)
[error] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[error] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[error] at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:745)
[error] Caused by: Configuration error: Configuration error[Cannot instantiate class: tyrex.naming.MemoryContextFactory]
[error] at play.api.Configuration$.configError(Configuration.scala:178)
[error] at play.api.PlayConfig.reportError(Configuration.scala:1048)
[error] at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:69)
[error] at play.api.db.PooledDatabase.createDataSource(Databases.scala:199)
[error] at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:124)
[error] at play.api.db.DefaultDatabase.dataSource(Databases.scala:122)
[error] at play.api.db.DefaultDatabase.getConnection(Databases.scala:143)
[error] at play.api.db.DefaultDatabase.getConnection(Databases.scala:139)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:44)
[error] ... 74 more
[error] Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: tyrex.naming.MemoryContextFactory [Root exception is java.lang.ClassNotFoundException: tyrex.naming.MemoryContextFactory]
[error] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
[error] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
[error] at javax.naming.InitialContext.init(InitialContext.java:244)
[error] at javax.naming.InitialContext.<init>(InitialContext.java:216)
[error] at play.api.libs.JNDI$.initialContext$lzycompute(JNDI.scala:40)
[error] at play.api.libs.JNDI$.initialContext(JNDI.scala:22)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1$$anonfun$apply$2.apply(HikariCPModule.scala:62)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1$$anonfun$apply$2.apply(HikariCPModule.scala:61)
[error] at scala.Option.foreach(Option.scala:257)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:61)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:54)
[error] at scala.util.Try$.apply(Try.scala:192)
[error] at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54)
[error] ... 80 more
[error] Caused by: java.lang.ClassNotFoundException: tyrex.naming.MemoryContextFactory
[error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error] at java.lang.Class.forName0(Native Method)
[error] at java.lang.Class.forName(Class.java:348)
[error] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
[error] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
[error] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
[error] ... 92 more
[error]
[error] 2) Error in custom provider, Configuration error: Configuration error[Cannot connect to database [default]]
[error] while locating play.api.db.DBApiProvider
[error] while locating play.api.db.DBApi
[error] for field at play.api.db.NamedDatabaseProvider.dbApi(DBModule.scala:80)
[error] while locating play.api.db.NamedDatabaseProvider
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
[error] at play.api.db.DBModule$$anonfun$namedDatabaseBindings$1.apply(DBModule.scala:34):
[error] Binding(interface play.api.db.Database qualified with QualifierInstance(#play.db.NamedDatabase(value=default)) to ProviderTarget(play.api.db.NamedDatabaseProvider#5f20b6fe)) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
[error] Caused by: Configuration error: Configuration error[Cannot connect to database [default]]
[error] at play.api.Configuration$.configError(Configuration.scala:178)
[error] at play.api.Configuration.reportError(Configuration.scala:829)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42)
[error] at scala.collection.immutable.List.foreach(List.scala:381)
[error] at play.api.db.DefaultDBApi.connect(DefaultDBApi.scala:42)
[error] at play.api.db.DBApiProvider.get$lzycompute(DBModule.scala:72)
[error] at play.api.db.DBApiProvider.get(DBModule.scala:62)
[error] at play.api.db.DBApiProvider.get(DBModule.scala:58)
[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.SingleFieldInjector.inject(SingleFieldInjector.java:54)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
[error] at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:62)
[error] at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
[error] at com.google.inject.util.Providers$GuicifiedProviderWithDependencies$$FastClassByGuice$$2a7177aa.invoke(<generated>)
[error] at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
[error] at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:57)
[error] at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:91)
[error] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:132)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:93)
[error] at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
[error] at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
[error] at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:174)
[error] at com.google.inject.internal.Initializer.injectAll(Initializer.java:108)
[error] at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174)
[error] at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
[error] at com.google.inject.Guice.createInjector(Guice.java:96)
[error] at com.google.inject.Guice.createInjector(Guice.java:73)
[error] at com.google.inject.Guice.createInjector(Guice.java:62)
[error] at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
[error] at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
[error] at tasks.Task.<init>(FulfillmentUpdate.scala:16)
[error] at tasks.FulfillmentUpdate.<init>(FulfillmentUpdate.scala:23)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[error] at java.lang.Class.newInstance(Class.java:442)
[error] at $83fce2be1de409ac7c44$$anonfun$1.apply(build.sbt:20)
[error] at $83fce2be1de409ac7c44$$anonfun$1.apply(build.sbt:15)
[error] at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[error] at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:63)
[error] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[error] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[error] at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[error] at sbt.Execute.work(Execute.scala:235)
[error] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[error] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[error] at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:745)
[error] Caused by: Configuration error: Configuration error[Cannot instantiate class: tyrex.naming.MemoryContextFactory]
[error] at play.api.Configuration$.configError(Configuration.scala:178)
[error] at play.api.PlayConfig.reportError(Configuration.scala:1048)
[error] at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:69)
[error] at play.api.db.PooledDatabase.createDataSource(Databases.scala:199)
[error] at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:124)
[error] at play.api.db.DefaultDatabase.dataSource(Databases.scala:122)
[error] at play.api.db.DefaultDatabase.getConnection(Databases.scala:143)
[error] at play.api.db.DefaultDatabase.getConnection(Databases.scala:139)
[error] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:44)
[error] ... 63 more
[error] Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: tyrex.naming.MemoryContextFactory [Root exception is java.lang.ClassNotFoundException: tyrex.naming.MemoryContextFactory]
[error] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
[error] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
[error] at javax.naming.InitialContext.init(InitialContext.java:244)
[error] at javax.naming.InitialContext.<init>(InitialContext.java:216)
[error] at play.api.libs.JNDI$.initialContext$lzycompute(JNDI.scala:40)
[error] at play.api.libs.JNDI$.initialContext(JNDI.scala:22)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1$$anonfun$apply$2.apply(HikariCPModule.scala:62)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1$$anonfun$apply$2.apply(HikariCPModule.scala:61)
[error] at scala.Option.foreach(Option.scala:257)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:61)
[error] at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:54)
[error] at scala.util.Try$.apply(Try.scala:192)
[error] at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54)
[error] ... 69 more
[error] Caused by: java.lang.ClassNotFoundException: tyrex.naming.MemoryContextFactory
[error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error] at java.lang.Class.forName0(Native Method)
[error] at java.lang.Class.forName(Class.java:348)
[error] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
[error] at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
[error] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
[error] ... 81 more
[error]
[error] 2 errors
[error] Total time: 12 s, completed May 2, 2017 3:48:05 PM

Related

"Can not set org.eclipse.aether.spi.log.Logger" with custom maven plugin

I have written a small custom maven plugin, and it runs fine.. most of the time.
When using it, it's configured to run on test phase, and I see it executing, no problem. Now problem comes later, when I do mvn clean install or mvn clean deploy in the project using the plugin : it fails with a message I can't make sense of. And it clearly comes from my plugin, because if I remove it, then mvn clean install works.
Error message is very long and it has 4 similar traces as the one below.
I am quite clueless with where it can come from.. any idea ?
Error injecting: private org.eclipse.aether.spi.log.Logger org.apache.maven.repository.internal.DefaultVersionResolver.logger
[ERROR] while locating org.apache.maven.repository.internal.DefaultVersionResolver
[ERROR] while locating java.lang.Object annotated with *
[ERROR] at org.eclipse.sisu.wire.LocatorWiring
[ERROR] while locating org.eclipse.aether.impl.VersionResolver
[ERROR] for parameter 2 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.<init>(Unknown Source)
[ERROR] while locating org.eclipse.aether.internal.impl.DefaultArtifactResolver
[ERROR] while locating java.lang.Object annotated with *
[ERROR] at org.eclipse.sisu.wire.LocatorWiring
[ERROR] while locating org.eclipse.aether.impl.ArtifactResolver
[ERROR] for parameter 2 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.<init>(Unknown Source)
[ERROR] while locating org.apache.maven.repository.internal.DefaultArtifactDescriptorReader
[ERROR] while locating java.lang.Object annotated with *
[ERROR] at org.eclipse.sisu.wire.LocatorWiring
[ERROR] while locating org.eclipse.aether.impl.ArtifactDescriptorReader
[ERROR] for parameter 1 at org.eclipse.aether.internal.impl.DefaultDependencyCollector.<init>(Unknown Source)
[ERROR] while locating org.eclipse.aether.internal.impl.DefaultDependencyCollector
[ERROR] while locating java.lang.Object annotated with *
[ERROR] at org.eclipse.sisu.wire.LocatorWiring
[ERROR] while locating org.eclipse.aether.impl.DependencyCollector
[ERROR] for parameter 5 at org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown Source)
[ERROR] while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
[ERROR] while locating java.lang.Object annotated with *
[ERROR] while locating org.apache.maven.artifact.installer.DefaultArtifactInstaller
[ERROR] at ClassRealm[plexus.core, parent: null] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] at ClassRealm[plexus.core, parent: null] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.apache.maven.artifact.installer.ArtifactInstaller
[ERROR] while locating org.apache.maven.plugin.install.InstallMojo
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.4, parent: sun.misc.Launcher$AppClassLoader#5c647e05] (via modules: org.eclipse.sisu.wire.Wir
eModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-install-plugin:2.4:install)
[ERROR] Caused by: java.lang.IllegalArgumentException: Can not set org.eclipse.aether.spi.log.Logger field org.apache.maven.repository.internal.DefaultVersionResolver.log
ger to org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory
[ERROR] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
[ERROR] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
[ERROR] at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
[ERROR] at java.lang.reflect.Field.set(Field.java:758)
[ERROR] at org.eclipse.sisu.bean.BeanPropertyField.set(BeanPropertyField.java:72)
[ERROR] at org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
[ERROR] at org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
[ERROR] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:140)
[ERROR] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.wire.BeanProviders.firstOf(BeanProviders.java:179)
[ERROR] at org.eclipse.sisu.wire.BeanProviders$7.get(BeanProviders.java:160)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[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:107)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.wire.BeanProviders.firstOf(BeanProviders.java:179)
[ERROR] at org.eclipse.sisu.wire.BeanProviders$7.get(BeanProviders.java:160)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[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:107)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.wire.BeanProviders.firstOf(BeanProviders.java:179)
[ERROR] at org.eclipse.sisu.wire.BeanProviders$7.get(BeanProviders.java:160)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[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:107)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.wire.BeanProviders.firstOf(BeanProviders.java:179)
[ERROR] at org.eclipse.sisu.wire.BeanProviders$7.get(BeanProviders.java:160)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[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:107)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
[ERROR] at org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:250)
[ERROR] at org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
[ERROR] at org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
[ERROR] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:140)
[ERROR] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1044)
[ERROR] at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[ERROR] at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
[ERROR] at org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:250)
[ERROR] at org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
[ERROR] at org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
[ERROR] at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:140)
[ERROR] at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
[ERROR] at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
[ERROR] at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
[ERROR] at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1066)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1044)
[ERROR] at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:54)
[ERROR] at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
[ERROR] at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
[ERROR] at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
[ERROR] at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
[ERROR] at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:46)
[ERROR] at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1009)
[ERROR] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1059)
[ERROR] at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1005)
[ERROR] at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:36)
[ERROR] at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
[ERROR] at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
[ERROR] at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
[ERROR] at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
[ERROR] at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:543)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:483)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] 4 errors
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-install-plugin:2.4:install
After some research, I felt it looked like some version incompatibility. and indeed, it is, between the maven version I am using to build the applications using the plugin, and the maven core version used in the plugin.
in my plugin, I was using latest maven core version available as a dependency, ie 3.5.2
I am building the plugin with Maven 3.3.1 and build is OK.
but when I build a project using the plugin, with Maven 3.3.1, the problem happens.
I downgraded maven core to 3.3.9, then rebuilt my plugin, and it works now.
I guess there are some incompatibilities between maven core 3.5.x and previous maven runtime..
I see on https://jaxenter.com/apache-maven-3-5-0-nothing-see-3-4-0-move-along-133180.html that they switched ... from Eclipse Aether to Maven Artifact Resolver
but what was very confusing is that my build was failing not at the time of my plugin being called, but after.
if you are running inside IntelliJ IDEA go to
Build -> Execution, Deployment > Build tools > Maven
Update maven directory as your maven /dir. (maven-3.6.0)
The default one is 3.3.9 for IntelliJ idea 2018.3.1
I had same issue but after updating maven version from 3.3.9 to 3.6.3 solved my problem. Please try upgrading maven to 3.6.X . Hope this helps someone. Happy Learning :).
For a spring boot project, if you can't easily update maven version for some reason ( in my case the error appeared in automated builds which used a maven docker container from a custom docker registry )
Specifying a version for plugin spring-boot-maven-plugin fixed the issue for me
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.5.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
Specifying a version for plugin spring-boot-maven-plugin fixed the issue for me as well. Here is what I changed:
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.16.RELEASE</version>
I had the same issue and changed jdeb plugin version and it fixed.
I had met the same issue when upgrade jdeb from 1.5 to 1.7. And downgrade it to 1.5 and it fixed.
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.5</version>
In my case, 3.3.9 maven was mandatory to use as other project were using same maven in jenkins build.
So I downgraded my com.spotify plugin from 1.4.10 to 1.4.6 by refering to below link
https://mvnrepository.com/artifact/com.spotify/dockerfile-maven-plugin/1.4.6
in this link we can see maven supported version
In contrast to the other answer which recommends downgrading spotify, in my case updating spotify version worked for me.
Check the version of maven on your command prompt with "mvn --version".
run the "mvn deploy" on command line to see if that works.
Go to Build -> Execution, Deployment > Build tools > Maven in IntelliJ and change the version of maven to the version available on your pc instead of the default bundle provided.
I downgrade the dockerfile-maven-plugin version 1.4.10 to 1.4.1
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.1</version>
</plugin>

Play 2.5: I can run test by Intelij IDEA but not with ./activator

I run fake server for batch of functional tests, fill database with evolutions. This idea works well to test in IntelijIdea, but I cannot configure CI because activator test fails...
./activator -Dconfig.resource=env_test.conf testOnly com.api.test.FunctionalTestsSuite
[info] Loading project definition from /Users/aieremenko/pr/api/project
[info] Set current project to api (in build file:/Users/aieremenko/pr/api/)
[info] Test run started
THE FIRST
[warn] application - hardcoded value: user is deprecated, use username instead
[info] application - Creating Pool for datasource 'default'
Starting server
before provideApplication
[error] Test com.api.test.FunctionalTestsSuite failed: play.api.Configuration$$anon$1: Configuration error[null], took 0.0 sec
[error] at play.api.Configuration$.configError(Configuration.scala:154)
[error] at play.api.Configuration.reportError(Configuration.scala:806)
[error] at play.Configuration.reportError(Configuration.java:366)
[error] at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.setServerConfigDataSource(DefaultEbeanConfig.java:94)
[error] at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.parse(DefaultEbeanConfig.java:75)
[error] at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:56)
[error] at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.get(DefaultEbeanConfig.java:40)
[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.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.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.FactoryProxy.get(FactoryProxy.java:56)
[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.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
[error] at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
[error] at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
[error] at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
[error] at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
[error] at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
[error] at com.google.inject.Guice.createInjector(Guice.java:96)
[error] at com.google.inject.Guice.createInjector(Guice.java:84)
[error] at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
[error] at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
[error] at play.api.test.FakeApplication.<init>(Fakes.scala:209)
[error] at play.test.FakeApplication.<init>(FakeApplication.java:51)
[error] at play.test.Helpers.fakeApplication(Helpers.java:124)
[error] at com.dimanex.api.test.FunctionalTestsSuite$1.provideApplication(FunctionalTestsSuite.java:105)
[error] at com.dimanex.api.test.FunctionalTestsSuite$1.startServer(FunctionalTestsSuite.java:54)
[error] at com.dimanex.api.test.FunctionalTestsSuite$1.before(FunctionalTestsSuite.java:38)
[error] ...
[error] Caused by: java.lang.NullPointerException
[error] at play.db.ebean.DefaultEbeanConfig$EbeanConfigParser.setServerConfigDataSource(DefaultEbeanConfig.java:92)
[error] ... 64 more
[info] Test run finished: 1 failed, 0 ignored, 0 total, 41.043s
I have separated files with configs for dev, prod and test mode. Tests use own database to miss possibility to hurt production server(I don't use inmemory database)....
Okay. activator just ignores -Dconfig.resource=env_test.conf for test plugin. When I use application.conf for test purposes (which is default config file) than it works. For application running it works:
./activator -Dconfig.resource=env_dev.conf run
But it's IntelijIdea runs test well with defiled -Dconfig.resource=env_test.conf. It's just funny:)

error while connecting to hbase

I am trying to make a remote connection to HBase configured in not distributed mode.
My code is the following in java playframework:
// Instantiating a configuration class
Configuration hbaseConfiguration = HBaseConfiguration.create();
try {
Configuration newConfig = new Configuration(hbaseConfiguration);
newConfig.set("hbase.zookeeper.quorum", "77.154.69.181");
newConfig.set("hbase.zookeper.property.clientPort", "2181");
HConnection connection = HConnectionManager
.getConnection(newConfig);
HBaseAdmin hBaseAdmin = new HBaseAdmin(connection);
if (!hBaseAdmin.isMasterRunning())
throw new Exception("Hbase is not running");
} catch (Exception e) {
e.printStackTrace();
}
and I am getting the following error:
[error] org.apache.hadoop.hbase.MasterNotRunningException: com.google.protobuf.ServiceException: org.apache.hadoop.net.ConnectTimeoutException: 10000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=vm-77446.localdomain/77.154.69.181:37027]
[error] at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1485)
[error] at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1505)
[error] at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1711)
[error] at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isMasterRunning(ConnectionManager.java:876)
[error] at org.apache.hadoop.hbase.client.HBaseAdmin.isMasterRunning(HBaseAdmin.java:271)
[error] at controllers.Application.index(Application.java:29)
[error] at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(Routes.scala:95)
[error] at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(Routes.scala:95)
[error] at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:136)
[error] at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$14$$anon$3$$anon$1.invocation(HandlerInvoker.scala:127)
[error] at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:70)
[error] at play.http.DefaultHttpRequestHandler$1.call(DefaultHttpRequestHandler.java:20)
[error] at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:94)
[error] at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:94)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
[error] at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:40)
[error] at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
[error] at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:32)
[error] at scala.concurrent.impl.Future$.apply(Future.scala:31)
[error] at scala.concurrent.Future$.apply(Future.scala:492)
[error] at play.core.j.JavaAction.apply(JavaAction.scala:94)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
[error] at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:104)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:103)
[error] at scala.Option.map(Option.scala:146)
[error] at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:103)
[error] at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:96)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:524)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:524)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:560)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:560)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:536)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:536)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
[error] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
[error] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
[error] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[error] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[error] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[error] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
newConfig.set("hbase.zookeper.property.clientPort", "2181");
should be
newConfig.set("hbase.zookeeper.property.clientPort", "2181");
you have a typo in your code.
From this "org.apache.hadoop.hbase.MasterNotRunningException", Your hbase master(HMaster) is not running. Try to open http://MasterIp:60010 from a browser and check your master is really running(Hbase master page with the table names should be listed).
If master is running, then add
newConfig.set("hbase.master","MasterIP:60000");
right below
newConfig.set("hbase.zookeeper.property.clientPort", "2181");

play framework test connection refused

I have a huge problem with my play 2.4 application. Every time I try to start my application with activator test, I get the following error:
java.net.ConnectException: Connection refused: localhost/127.0.0.1:9000, took 0.0 sec
[error] at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:128)
[error] at com.ning.http.client.providers.netty.request.NettyConnectListener.operationComplete(NettyConnectListener.java:140)
[error] at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:409)
[error] at org.jboss.netty.channel.DefaultChannelFuture.addListener(DefaultChannelFuture.java:145)
[error] at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:283)
[error] at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect(NettyRequestSender.java:140)
[error] at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequest(NettyRequestSender.java:115)
[error] at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:87)
[error] at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:506)
[error] at play.libs.ws.ning.NingWSRequest.execute(NingWSRequest.java:509)
[error] at play.libs.ws.ning.NingWSRequest.execute(NingWSRequest.java:395)
[error] at play.libs.ws.ning.NingWSRequest.post(NingWSRequest.java:322)
[error] at controllers.projeckerSystem.LoginController.login(LoginController.java:28)
[error] at projeckerSystem.Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(Routes.scala:504)
[error] at projeckerSystem.Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(Routes.scala:504)
[error] at play.core.routing.HandlerInvokerFactory$$anon$5.resultCall(HandlerInvoker.scala:139)
[error] at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$14$$anon$3$$anon$1.invocation(HandlerInvoker.scala:127)
[error] at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:70)
[error] at play.GlobalSettings$1.call(GlobalSettings.java:67)
[error] at play.db.jpa.TransactionalAction.lambda$call$5(TransactionalAction.java:19)
[error] at play.db.jpa.DefaultJPAApi.withTransaction(DefaultJPAApi.java:136)
[error] at play.db.jpa.JPA.withTransaction(JPA.java:159)
[error] at play.db.jpa.TransactionalAction.call(TransactionalAction.java:16)
[error] at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:94)
[error] at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:94)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
[error] at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:40)
[error] at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
[error] at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:32)
[error] at scala.concurrent.impl.Future$.apply(Future.scala:31)
[error] at scala.concurrent.Future$.apply(Future.scala:492)
[error] at play.core.j.JavaAction.apply(JavaAction.scala:94)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:105)
[error] at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:104)
[error] at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:103)
[error] at scala.Option.map(Option.scala:146)
[error] at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:103)
[error] at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:96)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:524)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:524)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:560)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:560)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply(Iteratee.scala:537)
[error] at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply(Iteratee.scala:537)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
[error] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
[error] at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
[error] at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
[error] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[error] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[error] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[error] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[error] Caused by: java.net.ConnectException: Connection refused: localhost/127.0.0.1:9000
[error] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[error] at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
[error] at org.jboss.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
[error] at org.jboss.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
[error] at org.jboss.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
[error] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
[error] at org.jboss.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
[error] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
[error] at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] at java.lang.Thread.run(Thread.java:745)
When I start a second application with activator run and execute the test again, there is no problem and the test runs through successfully. I suspect that there is something wrong with the configuration, but I can't find the problem. Can anybody help?
Edit:
Here is some of my code.
#Test
public void test(){
RequestBuilder requestBuilder = new RequestBuilder()
.method(Helpers.POST)
.uri("...");
Result result = Helpers.route(request);
assertEquals(OK, result.status());
}
I start the FakeApplication globally within the BeforeClass method.
#BeforeClass
public static void startApp(){
app = Helpers.fakeApplication();
Helpers.start(app);
}

Selenium testng saucelabs maven Error

Im trying to run a test using selenium testng on Saucelabs. Im getting an error and cant seem to figure it out!
I`ve tried different versions for the Surefire plugin , testng but cant seem to resolve this.
Here the maven stack trace . Any help is much appreciated
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
14:test (default-test) on project functional: Execution default-test of goal org
.apache.maven.plugins:maven-surefire-plugin:2.14:test failed: There was an error
in the forked process
[ERROR] org.testng.TestNGException: java.lang.NullPointerException
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:340)
[ERROR] at org.testng.TestNG.run(TestNG.java:1004)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.ja
va:178)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXml
TestSuite.java:92)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider
.java:96)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:606)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2
(ReflectionUtils.java:208)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke
(ProviderFactory.java:158)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(Provi
derFactory.java:86)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork
edBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
95)
[ERROR] Caused by: java.lang.NullPointerException
[ERROR] at org.testng.xml.TestNGContentHandler.xmlListeners(TestNGContentHandler
.java:352)
[ERROR] at org.testng.xml.TestNGContentHandler.endElement(TestNGContentHandler.j
ava:700)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(AbstractSAXParser.java:606)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamesp
aceScope(XMLDTDValidator.java:2054)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEnd
Element(XMLDTDValidator.java:2005)
[ERROR] at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElemen
t(XMLDTDValidator.java:879)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:607)
[ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:835)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:123)
[ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1210)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:568)
[ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:302)
[ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
[ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
[ERROR] at org.testng.xml.Parser.parse(Parser.java:172)
[ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:310)
[ERROR] ... 13 more

Categories

Resources