error during sbt execution: java.nio.channels.overlappingfilelockexception from windows command prompt - sbt

I'm trying to install sbt on windows 7 but testing it, I get the following error:
java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(Unknown Source)
at sun.nio.ch.SharedFileLockTable.add(Unknown Source)
at sun.nio.ch.FileChannelImpl.tryLock(Unknown Source)
at java.nio.channels.FileChannel.tryLock(Unknown Source)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:88)
at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:81)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
at xsbt.boot.Using$.withResource(Using.scala:11)
at xsbt.boot.Using$.apply(Using.scala:10)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
at xsbt.boot.Locks$GlobalLock.liftedTree1$1(Locks.scala:52)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at xsbt.boot.Update.apply(Checks.java:100)
at xsbt.boot.Launch.update(Launch.scala:266)
at xsbt.boot.Launch.retrieve$1(Launch.scala:136)
at xsbt.boot.Launch$$anonfun$3.apply(Launch.scala:144)
at scala.Option.getOrElse(Option.scala:108)
at xsbt.boot.Launch$$anon$2.call(Launch.scala:129)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:81)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
at xsbt.boot.Using$.withResource(Using.scala:11)
at xsbt.boot.Using$.apply(Using.scala:10)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
at xsbt.boot.Locks$GlobalLock.liftedTree1$1(Locks.scala:52)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at xsbt.boot.Launch.locked(Launch.scala:165)
at xsbt.boot.Launch.app(Launch.scala:82)
at xsbt.boot.Launch.app(Launch.scala:80)
at xsbt.boot.Launch$.run(Launch.scala:51)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:60)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
at SbtJansiLaunch.main(SbtJansiLaunch.java:4)
Error during sbt execution: java.nio.channels.OverlappingFileLockException
which seems related to the fact that I do have access to my remote HOME drive according to this post:
https://groups.google.com/forum/#!topic/simple-build-tool/lJvOvZ5RUwE
I tried to follow what they suggest, but I have never found any sbt.boot.properties file. I have also tried to overwrite the boot and working dir via:
sbt -sbt-dir C:\my\new\home -sbt-boot C:\my\new\home
Would any of you have gone through all these problems and could have a step-by-step recipy to solve that ?

Ok so I had the same problem. The sbt.boot.properties file resides inside the sbt-launch.jar archive. Open it with an archive tool like winzip or 7zip and then look in the folder /sbt and you will see the sbt.boot.properties file.
The current version looks like this
[scala]
version: ${sbt.scala.version-auto}
[app]
org: ${sbt.organization-org.scala-sbt}
name: sbt
version: ${sbt.version-read(sbt.version)[0.13.6]}
class: ${sbt.main.class-sbt.xMain}
components: xsbti,extra
cross-versioned: ${sbt.cross.versioned-false}
resources: ${sbt.extraClasspath-}
[repositories]
local
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
maven-central
[boot]
directory: ${sbt.boot.directory-${sbt.global.base-${user.home}/.sbt}/boot/}
[ivy]
ivy-home: ${sbt.ivy.home-${user.home}/.ivy2/}
checksums: ${sbt.checksums-sha1,md5}
override-build-repos: ${sbt.override.build.repos-false}
repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}
Make sure you add the property lock in the [boot] section or you will get another error. So eventually it should look like this:
[scala]
version: ${sbt.scala.version-auto}
[app]
org: ${sbt.organization-org.scala-sbt}
name: sbt
version: ${sbt.version-read(sbt.version)[0.13.6]}
class: ${sbt.main.class-sbt.xMain}
components: xsbti,extra
cross-versioned: ${sbt.cross.versioned-false}
resources: ${sbt.extraClasspath-}
[repositories]
local
typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
maven-central
[boot]
directory: ${sbt.boot.directory-${sbt.global.base-${user.home}/.sbt}/boot/}
lock: false
[ivy]
ivy-home: ${sbt.ivy.home-${user.home}/.ivy2/}
checksums: ${sbt.checksums-sha1,md5}
override-build-repos: ${sbt.override.build.repos-false}
repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}
Another point of attention is also what they said on that google group. Do not run two sbt processes at the same time, as this parameter might cause inconsistencies then.

Related

sbt 1.3.8 publishLocal creates a jar that sbt update can't resolve. scala version is appended to jar name

I published some libraries using sbt publishLocal it worked and published to my ~/.ivy2/local dir.
I then have a project that depends on these libraries but sbt update can't find them.
specifically, my project has these dependencies:
lazy val myDependencies = commonDependencies ++ Seq(
"my.corp" %% "lib1" % "1.0.1-SNAPSHOT" withSources () withJavadoc (),
"my.corp" %% "lib2" % "2.0.2-SNAPSHOT" withSources () withJavadoc ()
)
sbt update has this error:
[error] (services / update) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] file:////home/myuser/.ivy2//local/my.corp/lib1_2.12/1.0.1-SNAPSHOT/jars/lib1.jar: not found: /home/myuser/.ivy2//local/my.corp/lib1_2.12/1.0.1-SNAPSHOT/jars/lib1.jar
[error] file://///home/myuser/.ivy2//local/my.corp/lib2_2.12/2.0.2-SNAPSHOT/jars/lib2.jar: not found: /home/myuser/.ivy2//local/my.corp/lib2_2.12/2.0.2-SNAPSHOT/jars/lib2.jar
when I look in the dir I can see the published jars but their name has the scala version appended, which is why the update resolving fails, I think :
$ ls /home/myuser/.ivy2/local/my.corp/lib1_2.12/1.0.1-SNAPSHOT/jars
lib1_2.12.jar lib1_2.12.jar.md5 lib1_2.12.jar.sha1
$ ls /home/myuser/.ivy2/local/my.corp/lib2_2.12/2.0.2-SNAPSHOT/jars
lib2_2.12.jar lib2_2.12.jar.md5 lib2_2.12.jar.sha1
If I publish to a repo for real I can resolve the libs.
Does anyone know the sbt incantation to fix this? ;-)
Cheers
Karl
Update:- I think coursier is the problem, not sure how to tell it to look for lib2_2_12.jar. Could it have a bad cached reference?
Caused by: lmcoursier.internal.shaded.coursier.cache.ArtifactError$NotFound: not found: /home/myuser/.ivy2/local/my.corp/lib2_2.12/2.0.2-SNAPSHOT/jars/lib2.jar
Update:-
disabling coursier worked
from the sbt REPL I can run
sbt:my-project> set ThisBuild / useCoursier := false
and then
sbt:my-project> update
and that worked, but setting it back to true update failed again, so this looks like a coursier issue.
Update:
coursier fetch from the command line worked!!
coursier fetch my.corp::lib1:1.0.1-SNAPSHOT --no-default -r central -r ivy2Local
downloaded the transitive dependencies and found my jar in my local ivy2 dir
so this is back to looking like an sbt - coursier interaction issue
I've just now run into this and after lots of diffs between an older working version and this non-working version I figured out that it is the withSources() that triggers the bug in sbt and/or coursier.

How to install magnolia's Travel Demo project on blank magnolia instance

I'm trying to follow Travel Demo - for developers # https://documentation.magnolia-cms.com/display/DOCS56/Travel+Demo+-+for+developers
as suggested I've cloned project
build it with skipped checkstyle option (already feel weird if I can't build project without undocumented tricks)
Build succeed, but I have no clue what to do with it:
There no war files, only jars.
I know about training-developer-project bundle which I was able to build and run on local Tomcat
What I would like to do is:
install Travel Demo project in blank magnolia web app maven project which I generated with maven archetype
Clarification: My idea was not just to install travel-demo as dependency but make it a part of my study project.
Update #Ducaz035: Running mvn -e -X clean install gives errors in checkstyle plugin:
[INFO] Starting audit...
C:\Magnolia_dev\demo-projects\community\magnolia-travel-demo\src\test\java\info\magnolia\demo\travel\model\NavigationAreaModelTest
.java:48: Missing a Javadoc comment.
C:\Magnolia_dev\demo-projects\community\magnolia-travel-demo\src\test\java\info\magnolia\demo\travel\setup\SetupDemoRolesAndGroups
TaskTest.java:54: Missing a Javadoc comment.
C:\Magnolia_dev\demo-projects\community\magnolia-travel-demo\src\test\java\info\magnolia\demo\travel\setup\TravelDemoModuleVersion
HandlerTest.java:75: Missing a Javadoc comment.
Audit done.
[INFO] There are 3 errors reported by Checkstyle 6.1.1 with magnolia-build-resources/checkstyle.xml ruleset.
[ERROR] src\test\java\info\magnolia\demo\travel\model\NavigationAreaModelTest.java[48] (javadoc) JavadocType: Missing a Javadoc co
mment.
[ERROR] src\test\java\info\magnolia\demo\travel\setup\SetupDemoRolesAndGroupsTaskTest.java[54] (javadoc) JavadocType: Missing a Ja
vadoc comment.
[ERROR] src\test\java\info\magnolia\demo\travel\setup\TravelDemoModuleVersionHandlerTest.java[75] (javadoc) JavadocType: Missing a
Javadoc comment.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Magnolia Travel Demo (parent pom) .................. SUCCESS [ 4.489 s]
[INFO] Magnolia Travel Demo Module ........................ FAILURE [ 34.003 s]
You have to put in into the webapp, you are talking about the bundle so add the travel-demo to it as maven dependency. Alternative you can drop the jar to /libs folder and Magnolia will it pick up automatically. For more detail please check
https://documentation.magnolia-cms.com/display/DOCS55/Installing+a+module
Cheers,

JHipster prod profile Grunt build error on Eclipse

I'm doing an app with JHipster 1.4.0 using Eclipse.
In dev profile, no problem, but when i switched to prod profile, there's an error in build :
Description : Plugin execution not covered by lifecycle configuration: com.github.trecloux:yeoman-maven-plugin:0.2:build (execution: run-grunt, phase: generate-resources)
Resource : pom.xml
Path : /myapp
Location : line 444
Type : Maven Project Build Lifecycle Mapping Problem
I'm new to Eclipse and i didn't find a solution on forums. If someone can help...
Thanks !
I just had a same issue, and this was because I had another process using the same port number as Grunt (port 9001).
Can you check your Grunt error message? I had:
Running "connect:test" (connect) task
Fatal error: Port 9001 is already in use by another process.

Springfuse - Failed to execute goal: generate

I try to generate an Eclipse Project with Springfuse code generator, based on a MySql database. I have filled up the form at http://www.springfuse.com/, and it generated following Maven command:
mvn -U archetype:generate -DarchetypeGroupId=com.springfuse.archetypes -DarchetypeArtifactId=quickstart -DarchetypeVersion=3.0.108 -DgroupId=com.company.demo -Dpackage=com.company.demo -DartifactId=myproject -Dversion=1.0.0 -DfrontEnd=jsf2Spring -Demail=peter.varga.sp#gmail.com -Dpassword=none -DjdbcGroupId=mysql -DjdbcArtifactId=mysql-connector-java -DjdbcVersion=5.1.25 -DjdbcDriver=com.mysql.jdbc.Driver -DjdbcUser=root -DjdbcPassword=qwe123 -DjdbcUrl=jdbc:mysql://localhost/test -DinteractiveMode=false -DarchetypeRepository=http://maven2.springfuse.com/
I opened a command window, copied the command as it is, and run it, but got following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.springfuse.archetypes:quickstart:3.0.108) -> [Help 1]
My environment details:
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: c:\Prog\Maven\Maven.3.2.1
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: c:\Program Files\Java\jdk1.7.0_51\jre
Default locale: en_US, platform encoding: Cp1250
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Does anybody has an idea, what the problem is?
Thanks.
Please check the settings of proxy / firewall springfuse. Also check the Apache Maven, because it needs to download the dependencies on the Internet. And if it fails, then its usually you need to tell him about the http proxy you need to use.

jruby on rails with jdbc

Hy,
I am a new in JRuby on Rails. I installed RadRails and many gems:
pieces of gems
activerecord (2.3.4)
ActiveRecord-JDBC (0.5)
activerecord-jdbc-adapter (1.2.9)
activerecord-jdbcmysql-adapter (1.2.9)
jdbc-mysql (5.1.24)
book: http://koti.kapsi.fi/jamo/priv2/JRuby%20on%20Rails,%202007.pdf
I read the following section called "Store Administration" in chapter 4 and I modified my config/database.yml to this:
development:
adapter: jdbc
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://my_host/my_database
username: my_user
password: my_pass
I added to build path the following:
C:\Program Files\Aptana RadRails\plugins\org.jruby_1.2.0.9419p2\lib\ruby\gems\1.8\gems\jdbc-mysql-5.1.24\
When I restarted the server I got the following error:
Status: 500 Internal Server Error
The driver encountered an error: cannot load Java class com.mysql.jdbc.Driver
C:/Program Files/Aptana RadRails/plugins/org.jruby_1.2.0.9419p2/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:265:in `initialize'
C:/Program Files/Aptana RadRails/plugins/org.jruby_1.2.0.9419p2/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:41:in `jdbc_connection'
I would like to ask your help.
Have you added the jdbc jar to your class path? Try copying the jar file directly to the lib directory under your jruby installation.
e.g. C:\jruby\lib\mysql-jdbc.jar.

Resources