How to publish scala module in sonatype and maven? - scala

I have been trying publish module to sonatype but I am getting this exception--
[error] java.io.FileNotFoundException: /home/johnny/.sbt/gpg/secring.asc (No such file or directory)
[error] at java.io.FileInputStream.open0(Native Method)
[error] at java.io.FileInputStream.open(FileInputStream.java:195)
[error] at java.io.FileInputStream.<init>(FileInputStream.java:138)
[error] at com.jsuereth.pgp.StreamingLoadable.loadFromFile(StreamingLoadable.scala:11)
[error] at com.jsuereth.pgp.StreamingLoadable.loadFromFile$(StreamingLoadable.scala:11)
[error] at com.jsuereth.pgp.SecretKeyRing$.loadFromFile(SecretKeyRing.scala:45)
[error] at com.jsuereth.pgp.PGP$.loadSecretKeyRing(package.scala:31)
[error] at com.jsuereth.pgp.cli.PgpStaticContext.secretKeyRing(context.scala:27)
[error] at com.jsuereth.pgp.cli.PgpStaticContext.secretKeyRing$(context.scala:27)
[error] at com.typesafe.sbt.pgp.SbtPgpStaticContext.secretKeyRing(SbtPgpCommandContext.scala:9)
[error] at com.jsuereth.pgp.cli.DelegatingPgpStaticContext.secretKeyRing(context.scala:34)
[error] at com.jsuereth.pgp.cli.DelegatingPgpStaticContext.secretKeyRing$(context.scala:34)
[error] at com.typesafe.sbt.pgp.SbtPgpCommandContext.secretKeyRing(SbtPgpCommandContext.scala:14)
[error] at com.typesafe.sbt.pgp.BouncyCastlePgpSigner.$anonfun$keyId$1(PgpSigner.scala:37)
[error] at scala.runtime.java8.JFunction0$mcJ$sp.apply(JFunction0$mcJ$sp.java:12)
[error] at scala.Option.getOrElse(Option.scala:121)
[error] at com.typesafe.sbt.pgp.BouncyCastlePgpSigner.<init>(PgpSigner.scala:37)
[error] at com.typesafe.sbt.pgp.PgpSettings$.$anonfun$bcPgpSigner$1(PgpSettings.scala:111)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[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:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Global / pgpSigner) java.io.FileNotFoundException: /home/johnny/.sbt/gpg/secring.asc (No such file or directory)
[error] Total time: 1 s, completed Jul 17, 2019 2:46:54 PM
I have tried many ways and and plugin setup instructions but getting different short of exceptions.

You can do this by this way:
check $ gpg --version
If do not have, install gnupg.
Then run $ gpg --gen-key to generate key.
set realm , set mail address, set the passphrase
Key generation completed
check by $ gpg --list-keys
you will get this type result-
pub rsa4096 2018-08-22 [SC]
1234517530FB96F147C6A146A326F592D39AAAAA
uid [ultimate] your name <you#example.com>
sub rsa4096 2018-08-22 [E]
Now use this command to get public key block
$ gpg -a --export 1234517530FB96F147C6A146A326F592D39AAAAA
Copy the whole text-
-----BEGIN PGP PUBLIC KEY BLOCK-----
to
-----END PGP PUBLIC KEY BLOCK-----
Submit it pgp key servers, Wait some hours.
4.1 export secring.asc file to any location of your computer.
write this command
$ gpg -a --export-secret-keys > /home/johnny/secring.asc
4.2 Copy this file and place it to this location
~/.sbt/gpg/secring.asc
Now you will have to set up sbt-pgp plugin
To this ~/.sbt/1.0/plugins/gpg.sbt file to enable it globally for SBT projects add this line- (if the gpg.sbt file does not exist create this there)
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
Go to /home/$username/.gnugp folder, if you see pubring.kpx file but not secring.gpg file, you do not need to add useGpg := true line in your module's build.sbt file. If secring.gpg file exists add useGpg := true in your module's build.sbt file.
6.1 run this command on your terminal to find out the gpg executable file in your machine
$ dpkg --listfiles gpg
/.
/usr
/usr/bin
/usr/bin/gpg
/usr/share
/usr/share/doc
/usr/share/doc/gpg
/usr/share/doc/gpg/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/gpg.1.gz
/usr/share/doc/gpg/NEWS.Debian.gz
/usr/share/doc/gpg/changelog.Debian.gz
6.2 add this to ~/.sbt/gpg.sbt file
gpgCommand := "/user/bin/gpg"
6.3 If in your /home/$username/.gnugp folder you have secring.gpg file you will have to add this to ~/.sbt/gpg.sbt file by
pgpSecretRing := file("/path/to/my/secring.gpg")
For more information visit this link
Now create this file ~/.sbt/1.0/sonatype.sbt
just add this line to the file
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credential")
7.1 Create JIRA account by this link
7.2 By create button create an issue for opening your repository in sonatype
7.3 Create github repository or use your module related repository in issue creation form.
you will get idea about your form from this pic
7.4 Create a another repository with your issue's OSSRH-XXXXX string like this-
githubusername/OSSRH-xxxx . To verify your repository
You will have to wait some minutes to be approved. If your repo is approved you will get a mail.
Now create this file ~/.sbt/sonatype_credential, just add this line and in pass and username - set your JIRA password and username respectively.
realm=Sonatype Nexus Repository Manager
host=oss.sonatype.org
user=username
password=password
in your module's build.sbt file set this configuration---
ThisBuild / organization := "com.example.project2"
ThisBuild / organizationName := "example"
ThisBuild / organizationHomepage := Some(url("http://example.com/"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/your-account/your-project"),
"scm:git#github.com:your-account/your-project.git"
)
)
ThisBuild / developers := List(
Developer(
id = "Your identifier",
name = "Your Name",
email = "your#email",
url = url("http://your.url")
)
)
ThisBuild / description := "Some descripiton about your project."
ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org /licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Some(url("https://github.com/example/project"))
// Remove all additional repository other than Maven Central from POM
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / publishMavenStyle := true
Now run publishSigned
on your sbt project.
Now you can check your upload by this link
https://oss.sonatype.org/content/repositories/snapshots/com/github/$yourgitUserName/$repoName
or login https://oss.sonatype.org/ and search by your module name

Related

How to extract a standalone FPU module from Rocket-Chip Chisel code?

I am working on Rocket Chip Generator, which is a SoC written in Chisel.
My objective is to extract the Floating-Point Unit, in order to synthesize it and study its power consumption/area ...etc. separately from the rest of the SoC.
So I cloned the project and tried to create a dedicated TestHarness where I only instanciate an FPU. This is an example code of what I did (very similar to TestHarness
package freechips.rocketchip.system
import Chisel._
import freechips.rocketchip.config.Parameters
import freechips.rocketchip.devices.debug.Debug
import freechips.rocketchip.diplomacy.LazyModule
import freechips.rocketchip.rocket._
// importing FPU class
import freechips.rocketchip.tile._
class FPUTestHarness() (implicit p: Parameters) extends Module {
val io = new Bundle {
val dummyIn = Bool(INPUT)
val dummyOut = Bool(OUTPUT)
}
// The parameters of the FPU
val fpu_params = FPUParams(
fLen = 32 // default is 64
divSqrt = false // default is true
// sfmaLatency = 3, // default
// dfmaLatency = 4 // default
)
val fpu = Module(new FPU(fpu_params)(p))
}
The problem is that the implicit parameter p (of type Parameters) doesn't contain something called TileKey, which is needed I don't know where. Apparently the implicit parameter p, passed to FPUTestHarness doesn't contain that information. How can I resolve that? Is it possible to hardcode that somewhere for example?
rocket-chip-new/vsim$ make verilog
mkdir -p /home/mylab/rocket-chip/vsim/generated-src/
cd /home/mylab/rocket-chip && java -Xmx2G -Xss8M -XX:MaxPermSize=256M -jar /home/mylab/rocket-chip/sbt-launch.jar "runMain freechips.rocketchip.system.Generator /home/mylab/rocket-chip/vsim/generated-src freechips.rocketchip.system FPUTestHarness freechips.rocketchip.system DefaultConfig"
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[info] Loading settings for project rocket-chip-new-build from plugins.sbt ...
[info] Loading project definition from /home/mylab/rocket-chip/project
[info] Loading settings for project rocketchip from build.sbt ...
[info] Loading settings for project hardfloat from build.sbt ...
[info] Loading settings for project chisel from build.sbt ...
Using addons:
[info] Set current project to rocketchip (in build file:/home/mylab/rocket-chip/)
[info] Compiling 1 Scala source to /home/mylab/rocket-chip/target/scala-2.12/classes ...
[warn] there were two feature warnings; re-run with -feature for details
[warn] one warning found
[info] Done compiling.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/aitsaidn/.sbt/boot/scala-2.12.7/org.scala-sbt/sbt/1.2.7/protobuf-java-3.3.1.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[warn] Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
[info] Packaging /home/mylab/rocket-chip/target/scala-2.12/rocketchip_2.12-1.2-SNAPSHOT.jar ...
[info] Done packaging.
[info] Running freechips.rocketchip.system.Generator /home/mylab/rocket-chip/vsim/generated-src freechips.rocketchip.system FPUTestHarness freechips.rocketchip.system DefaultConfig
[info] [0.003] Elaborating design...
List(RocketTileParams(RocketCoreParams(0,true,false,true,true,false,true,false,0,1,false,8,0,true,false,true,0,Some(0),true,true,false,false,false,0,538447876,Some(MulDivParams(8,1,true,true,1)),Some(FPUParams(64,true,3,4))),Some(ICacheParams(64,4,64,32,0,None,None,None,false,64,2,4)),Some(DCacheParams(64,4,64,32,None,None,1,0,17,16,1,64,false,false,false,false,None)),Some(BTBParams(28,14,6,6,Some(BHTParams(512,1,8,3)),false)),0,Some(tile),0,None,None,false))
[error] (run-main-0) java.lang.reflect.InvocationTargetException
[error] java.lang.reflect.InvocationTargetException
[error] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[error] at freechips.rocketchip.util.HasGeneratorUtilities.$anonfun$elaborate$1(GeneratorUtils.scala:54)
[error] at chisel3.core.Module$.do_apply(Module.scala:52)
[error] at chisel3.Driver$.$anonfun$elaborate$1(Driver.scala:95)
[error] at chisel3.internal.Builder$.$anonfun$build$2(Builder.scala:343)
[error] at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
[error] at chisel3.internal.Builder$.$anonfun$build$1(Builder.scala:341)
[error] at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
[error] at chisel3.internal.Builder$.build(Builder.scala:341)
[error] at chisel3.Driver$.elaborate(Driver.scala:95)
[error] at freechips.rocketchip.util.HasGeneratorUtilities.elaborate(GeneratorUtils.scala:59)
[error] Caused by: java.lang.IllegalArgumentException: requirement failed: Key TileKey is not defined in Parameters
[error] at scala.Predef$.require(Predef.scala:277)
[error] at freechips.rocketchip.config.View.apply(Config.scala:15)
[error] at freechips.rocketchip.config.View.apply(Config.scala:12)
[error] at freechips.rocketchip.tile.HasNonDiplomaticTileParameters.tileParams(BaseTile.scala:37)
[error] at freechips.rocketchip.tile.HasNonDiplomaticTileParameters.tileParams$(BaseTile.scala:37)
[error] at freechips.rocketchip.tile.CoreModule.tileParams(Core.scala:90)
[error] at freechips.rocketchip.tile.HasCoreParameters.$init$(Core.scala:51)
[error] at freechips.rocketchip.tile.CoreModule.<init>(Core.scala:90)
[error] at freechips.rocketchip.tile.FPUModule.<init>(FPU.scala:378)
[error] at freechips.rocketchip.tile.FPU.<init>(FPU.scala:661)
[error] at freechips.rocketchip.system.FPUTestHarness.$anonfun$fpu$1(FPUTestHarness.scala:71)
[error] at chisel3.core.Module$.do_apply(Module.scala:52)
[error] at freechips.rocketchip.system.FPUTestHarness.<init>(FPUTestHarness.scala:71)
[error] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] Nonzero exit code: 1
[error] (Compile / runMain) Nonzero exit code: 1
[error] Total time: 6 s, completed Jul 25, 2019, 7:59:01 PM
/home/mylab/rocket-chip/vsim/Makefrag-verilog:12: recipe for target '/home/mylab/rocket-chip/vsim/generated-src/freechips.rocketchip.system.DefaultConfig.fir' failed
make: *** [/home/mylab/rocket-chip/vsim/generated-src/freechips.rocketchip.system.DefaultConfig.fir] Error 1
It seems that you use the config as "DefaultConfig". Error log states that you did not specify TileKey parameter in this config. Adding TileKey parameter will resolve the issue. DefaultConfig is defined in rocket-chip/src/main/scala/system/Configs.scala

How to add parameters to run SBT in Ammonite?

I want to run this SBT command in Ammonite:
sbt -mem 3000 clean compile docker:publishLocal
I tried a few things like:
%.sbt("-mem 3000", 'clean, 'test)(pwd)
Which gives this exception:
[error] Expected symbol
[error] Not a valid command: -
[error] Expected end of input.
[error] Expected '--'
[error] Expected 'debug'
[error] Expected 'info'
[error] Expected 'warn'
[error] Expected 'error'
[error] Expected 'addPluginSbtFile'
[error] -mem 3000
[error] ^
How is this done?
I recently had to the same thing, and i can tell you that is not fun when those "random" errors happen.
// I had to put the full path where sbt is, like this
val SBT = "C:\\Program Files (x86)\\sbt\\bin\\sbt.bat"
%(SBT, "-mem", "3000", "clean", "compile", "docker:publishLocal")(pwd)
with this the solution is:
%.sbt("-mem", "3000", 'clean, 'test)(pwd)

Getting File name too long when running tests on circleci

Im building my project with circleci 2 and in my test coverage im getting a weird error:
[info] Compiling 5 Scala sources to /root/build/target/scala-2.11/test-classes...
[error] /root/build/test/myApplication/SomeGeneratorNameGen.scala:40: File name too long
[error] This can happen on some encrypted or legacy file systems. Please see SI-3623 for more details.
[error] employeeName <- Gen.numStr
[error] ^
Your file length is
printf /root/build/test/myApplication/AmountPerExpTypeGen.scala | wc -c
56
$ printf /root/build/test/myApplication/ | wc -c
31
Based on the most of the references, you might want to increase the length using scalac options.
eg.
"-Xmax-classfile-name", "242"
Releated links
https://discuss.circleci.com/t/scala-sbt-assembly-does-not-work/10499/10
Filename too long sbt
https://github.com/sbt/sbt-assembly/issues/69#issuecomment-14176243
https://groups.google.com/forum/#!topic/simple-build-tool/wtD6vgdiy6g
https://issues.scala-lang.org/browse/SI-3623

In the Play Route's file, how can indicate to use routes from a module?

Currently trying to follow Manning's Play for Scala, specifically the section on testing a module before publishing.
I've created a module named "Ean2BarcodePlayModule" with organization "net.nowhereatall.playforscala".
I've used activator to publish local to ~/.ivy2/local
In my test project, I've added the library dependency:
"net.nowhereatall.playforscala" %% "ean2barcodeplaymodule" % "1.0-SNAPSHOT"
Now, I'd like to modify my routes file to indicate
-> /barcode Ean2BarcodePlayModule.Routes
but this results in:
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes:10:
not found: value Ean2BarcodePlayModule
[error] -> /barcode Ean2BarcodePlayModule.Routes
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes: no
t found: value Ean2BarcodePlayModule
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes: va
lue setPrefix is not a member of Any
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes:10:
not found: value Ean2BarcodePlayModule
[error] -> /barcode Ean2BarcodePlayModule.Routes
[error] four errors found
[error] (compile:compile) Compilation failed
[error] Total time: 4 s, completed Mar 12, 2015 1:36:34 PM
alternatively, if I try:
Now, I'd like to modify my routes file to indicate
-> /barcode net.nowhereatall.playforscala.Ean2BarcodePlayModule.Routes
the result is:
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes:10:
object nowhereatall is not a member of package net
[error] -> /barcode net.nowhereatall.playforscala.Ean2Ba
rcodePlayModule.Routes
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes: ob
ject nowhereatall is not a member of package net
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes: va
lue setPrefix is not a member of Any
[error] D:\Tutorials\Workspaces\Scala\Ean2BarcodePlayModule-Test\conf\routes:10:
object nowhereatall is not a member of package net
[error] -> /barcode net.nowhereatall.playforscala.Ean2Ba
rcodePlayModule.Routes
[error] four errors found
[error] (compile:compile) Compilation failed
[error] Total time: 6 s, completed Mar 12, 2015 1:35:56 PM
What is the correct way to do this?
With thanks to #Sarvesh Kumar Singh for directing me to the page on "SubProjects", the solution was relatively simple.
Rename "routes" in the the module source to "barcode.routes".
Redo activator publish-local.
In the "Test" project route file, include the required line as
-> /barcode barcode.Routes
(Note the last "R" in "Routes" is capital. That seems to be important!)

Play framework, 2.x clean project, test fails - MAC OS

I think this should be due to some issues in my enviroment, I can't figure this out so I am posting a question.
I created a new play 2.1.3 project (scala 2.10.2).
When I run play for the first time (no file is edited at this stage) and run the test sbt command, I get the following error.
info] Updating {file:/private/tmp/myapp/}myapp...
[info] Done updating.
[info] Compiling 5 Scala sources and 1 Java source to /private/tmp/myapp/target/scala-2.10/classes...
[info] Compiling 2 Scala sources to /private/tmp/myapp/target/scala-2.10/test-classes...
log4j:WARN No appenders could be found for logger (play).
log4j:WARN Please initialize the log4j system properly.
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:224)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:299)
at java.util.logging.Logger.log(Logger.java:509)
at java.util.logging.Logger.doLog(Logger.java:531)
at java.util.logging.Logger.logp(Logger.java:647)
at org.jboss.netty.logging.JdkLogger.debug(JdkLogger.java:36)
at org.jboss.netty.logging.InternalLoggerFactory$1.debug(InternalLoggerFactory.java:80)
at org.jboss.netty.channel.socket.nio.SelectorUtil.<clinit>(SelectorUtil.java:57)
at org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.<init>(NioServerSocketChannelFactory.java:115)
at play.core.server.NettyServer.play$core$server$NettyServer$$newBootstrap(NettyServer.scala:40)
at play.core.server.NettyServer.<init>(NettyServer.scala:127)
at play.api.test.TestServer.start(Selenium.scala:124)
at play.api.test.Helpers$.running(Helpers.scala:71)
at test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
at test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
at org.specs2.mutable.SpecificationFeatures$$anon$1$$anonfun$asResult$1.apply(Specification.scala:34)
at org.specs2.mutable.SpecificationFeatures$$anon$1$$anonfun$asResult$1.apply(Specification.scala:34)
at org.specs2.execute.AsResult$$anon$10.asResult(Result.scala:230)
at org.specs2.execute.AsResult$.apply(Result.scala:238)
at org.specs2.specification.Contexts$$anon$4.apply(Contexts.scala:44)
at org.specs2.mutable.SpecificationFeatures$$anon$1.asResult(Specification.scala:34)
at org.specs2.execute.AsResult$.apply(Result.scala:238)
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:141)
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:141)
at org.specs2.specification.Example.execute(Fragment.scala:104)
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
at org.specs2.execute.ResultExecution$class.execute(ResultExecution.scala:22)
at org.specs2.execute.ResultExecution$.execute(ResultExecution.scala:76)
at org.specs2.specification.FragmentExecution$class.executeBody(FragmentExecution.scala:28)
at org.specs2.runner.TestInterfaceConsoleReporter.executeBody(TestInterfaceRunner.scala:125)
at org.specs2.specification.FragmentExecution$class.execute(FragmentExecution.scala:52)
at org.specs2.runner.TestInterfaceConsoleReporter.execute(TestInterfaceRunner.scala:125)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
at org.specs2.control.Exceptions$class.catchAllOr(Exceptions.scala:54)
at org.specs2.control.Exceptions$.catchAllOr(Exceptions.scala:109)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$org$specs2$reporter$DefaultExecutionStrategy$$executeSequence$1.apply(ExecutionStrategy.scala:99)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$org$specs2$reporter$DefaultExecutionStrategy$$executeSequence$1.apply(ExecutionStrategy.scala:99)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:309)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.specs2.reporter.DefaultExecutionStrategy$class.org$specs2$reporter$DefaultExecutionStrategy$$executeSequence(ExecutionStrategy.scala:99)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$execute$1$$anonfun$2.apply(ExecutionStrategy.scala:43)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$execute$1$$anonfun$2.apply(ExecutionStrategy.scala:41)
at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144)
at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144)
at scala.collection.GenTraversableViewLike$Mapped$$anonfun$foreach$2.apply(GenTraversableViewLike.scala:81)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
at scala.collection.IterableViewLike$Transformed$class.foreach(IterableViewLike.scala:42)
at scala.collection.SeqViewLike$AbstractTransformed.foreach(SeqViewLike.scala:43)
at scala.collection.GenTraversableViewLike$Appended$class.foreach(GenTraversableViewLike.scala:99)
at scala.collection.SeqViewLike$$anon$2.foreach(SeqViewLike.scala:77)
at scala.collection.GenTraversableViewLike$Mapped$class.foreach(GenTraversableViewLike.scala:80)
at scala.collection.SeqViewLike$$anon$3.foreach(SeqViewLike.scala:78)
at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144)
at scala.collection.SeqViewLike$AbstractTransformed.foldLeft(SeqViewLike.scala:43)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$execute$1.apply(ExecutionStrategy.scala:41)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$execute$1.apply(ExecutionStrategy.scala:38)
at org.specs2.internal.scalaz.syntax.IdOps$class.$bar$greater(IdOps.scala:15)
at org.specs2.internal.scalaz.syntax.ToIdOps$$anon$1.$bar$greater(IdOps.scala:68)
at org.specs2.reporter.AllExporting$class.report(AllExporting.scala:15)
at org.specs2.runner.TestInterfaceConsoleReporter.report(TestInterfaceRunner.scala:125)
at org.specs2.runner.TestInterfaceRunner.runSpecification(TestInterfaceRunner.scala:61)
at org.specs2.runner.TestInterfaceRunner.run(TestInterfaceRunner.scala:54)
at sbt.ForkMain$Run.runTests(ForkMain.java:157)
at sbt.ForkMain$Run.run(ForkMain.java:169)
at sbt.ForkMain.main(ForkMain.java:84)
[info] IntegrationSpec
[info]
[info] Application should
[error] ! work from within a browser
[error] RuntimeException: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V (Helpers.scala:71)
[error] play.api.test.TestServer.start(Selenium.scala:128)
[error] play.api.test.Helpers$.running(Helpers.scala:71)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
[error] org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:224)
[error] org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:299)
[error] org.jboss.netty.logging.JdkLogger.debug(JdkLogger.java:36)
[error] org.jboss.netty.logging.InternalLoggerFactory$1.debug(InternalLoggerFactory.java:80)
[error] org.jboss.netty.channel.socket.nio.SelectorUtil.<clinit>(SelectorUtil.java:57)
[error] org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.<init>(NioServerSocketChannelFactory.java:115)
[error] play.core.server.NettyServer.play$core$server$NettyServer$$newBootstrap(NettyServer.scala:40)
[error] play.core.server.NettyServer.<init>(NettyServer.scala:127)
[error] play.api.test.TestServer.start(Selenium.scala:124)
[error] play.api.test.Helpers$.running(Helpers.scala:71)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
[error] org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
[error] org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:224)
[error] org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:299)
[error] org.jboss.netty.logging.JdkLogger.debug(JdkLogger.java:36)
[error] org.jboss.netty.logging.InternalLoggerFactory$1.debug(InternalLoggerFactory.java:80)
[error] org.jboss.netty.channel.socket.nio.SelectorUtil.<clinit>(SelectorUtil.java:57)
[error] org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory.<init>(NioServerSocketChannelFactory.java:115)
[error] play.core.server.NettyServer.play$core$server$NettyServer$$newBootstrap(NettyServer.scala:40)
[error] play.core.server.NettyServer.<init>(NettyServer.scala:127)
[error] play.api.test.TestServer.start(Selenium.scala:124)
[error] play.api.test.Helpers$.running(Helpers.scala:71)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
[error] test.IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
UPDATE - Problem Fixed
These files somehow managed to get into classpath,
rm /Library/Java/Extensions/log4j-1.2.15.jar
rm /Library/Java/Extensions/slf4j-api-1.5.8.jar
rm /Library/Java/Extentions/slf4j-log4j12-1.5.8.jar
I don't know which program placed these files.
Play logger will be called by default even if you don't use it. Check your application.conf
it contains something like:
# Root logger:
logger=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
and Play.logger uses log4j and slf4j both as you can see above . So you need to configure them properly .
Check this question for setting up slf4 and log4j How to get SLF4J "Hello World" working with log4j?