Problem install lift framework on Fedora - scala

I'm trying to start the lift_basic project from the latest version of lift (2.4-M1).
I'm following the docs - untarred the tarball, then changed into scala_29/lift_basic and ran ./sbt update but it fails with:
Getting Scala 2.7.7 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (9911kB/112ms)
Getting org.scala-tools.sbt sbt_2.7.7 0.7.5 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
16 artifacts copied, 0 already retrieved (4271kB/107ms)
[info] Recompiling project definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
sbt.UndefinedValue: Value for property '<unnamed>' from /var/www/html/projects/lift/lift-lift_24_sbt-14a1743/scala_29/lift_basic/project/build.properties is undefined.
at sbt.BasicEnvironment$UserProperty.sbt$BasicEnvironment$UserProperty$$inheritedValue(Environment.scala:155)
at sbt.BasicEnvironment$UserProperty$$anonfun$resolveDefaultFirst$1.apply(Environment.scala:135)
at sbt.BasicEnvironment$UserProperty$$anonfun$resolveDefaultFirst$1.apply(Environment.scala:135)
at sbt.BasicEnvironment$UserProperty.sbt$BasicEnvironment$UserProperty$$getDefault(Environment.scala:143)
at sbt.BasicEnvironment$UserProperty.resolveDefaultFirst(Environment.scala:135)
at sbt.BasicEnvironment$UserProperty.resolve(Environment.scala:120)
at sbt.Environment$Property.value(Environment.scala:16)
at LiftProject.<init>(LiftProject.scala:4)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at sbt.Project$.constructProject(Project.scala:391)
at sbt.Project$$anonfun$9.apply(Project.scala:365)
at sbt.Project$$anonfun$9.apply(Project.scala:364)
at scala.Either$RightProjection.map(Either.scala:239)
at sbt.Project$.loadProject(Project.scala:364)
at sbt.Project$.loadProject(Project.scala:355)
at sbt.Project$.loadProject(Project.scala:343)
at sbt.Project$.loadProject(Project.scala:340)
at sbt.xMain.run(Main.scala:47)
at sbt.xMain.run0$1(Main.scala:35)
at sbt.xMain.run(Main.scala:42)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:42)
at xsbt.boot.Launch$.launch(Launch.scala:57)
at xsbt.boot.Launch$.explicit(Launch.scala:42)
at xsbt.boot.Launch$.initialized(Launch.scala:38)
at xsbt.boot.Launch$.parsed(Launch.scala:31)
at xsbt.boot.Launch$.configured(Launch.scala:21)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Launch$.apply(Launch.scala:13)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.run(Boot.scala:19)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Error loading project: sbt.UndefinedValue: Value for property '<unnamed>' from /var/www/html/projects/lift/lift-lift_24_sbt-14a1743/scala_29/lift_basic/project/build.properties is undefined.
Does anyone know where I'm going wrong?
Thanks

I just tried this out myself (on Ubuntu 10.04) and I'm getting the exact same error. It's attempting to get a build configuration property and for some reason failing. I don't know enough about the SBT internals to offer a full solution, but I can show you how to get around it for now.
Simply open up the project/build/LiftProject.scala and on line 4, change
val liftVersion = property[Version].value.toString
to
val liftVersion = "2.4-M3" //use the value in project/build.properties for lift.version
After I did this, SBT was able to update and the example project compiled and ran without error.

Related

SAXNotRecognizedException in Play for Scala 2.6

I'm migrating from Play 2.5 to 2.6, the application compiles with no issues, but when I start Play I get the exception below. The error mentions AkkaHttpServer - the new default HTTP server in Play 2.6. I tried adding to application.conf the Akka HTTP server standard configuration taken from Play's website but I still get the same error.
Looking at the SAX Exception it says that there's a property not recognized by the parser. Any ideas how to fix this?
play.api.UnexpectedException: Unexpected
exception[ExceptionInInitializerError: null]
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:190)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsync$$anon$25.onPush(Ops.scala:1194)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:585)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:469)
Caused by: java.lang.ExceptionInInitializerError: null
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:177)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
at play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117)
at akka.stream.impl.fusing.MapAsync$$anon$25.onPush(Ops.scala:1194)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:585)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:469)
Caused by: org.xml.sax.SAXNotRecognizedException:
http://apache.org/xml/features/disallow-doctype-decl
at org.apache.xerces.parsers.AbstractSAXParser.setFeature(AbstractSAXParser.java:1508)
at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(SAXParserImpl.java:145)
at org.apache.xerces.jaxp.SAXParserImpl.(SAXParserImpl.java:128)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:112)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:140)
at play.api.Play$.(Play.scala:58)
at play.api.Play$.(Play.scala)
at play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:177)
at play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)
After long hours of trial an error, I discovered that changing the version of commons-dbcp from 1.2 to 1.4 fixed the problem. The error message doesn't seem to point to the resolution.

Getting OutOfMemoryException :Permgern space issue in jenkins

I am getting OutOfMemoryExeption:Permgern space issue when building a Maven project in Jenkins.
At the end of the building process message is showing as "Build Success" .But after that line below error msg is printing.
Fatal Error : Permgern space
Once this exception comes ,every time whole Jenkins is getting hanged i.e no
corresponding page of Jenkins even if dash board is not opening.
Below is the Command Line argument error for Jenkins.
Java HotSpot(TM) 64-bit Server VM Warning : Exception java.lang.OutOfMemoryError
occured dispatching signal unknown to handler - The VM may need to forcibly terminated.
Below is the error details from the console O/P of job-
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building EmployeeInformation 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
**[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.161 s
[INFO] Finished at: 2016-09-11T00:55:52+05:30
[INFO] Final Memory: 5M/76M**
[INFO] ------------------------------------------------------------------------
Parsing POMs
Established TCP socket on 49708
[Employee_Management] $ "C:\Program Files\Java\jdk1.7.0_03/bin/java" -cp "C:\Users\pc\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven32-agent-1.7.jar;C:\Program Files\Apache\maven\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files\Apache\maven\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven32Main "C:\Program Files\Apache\maven\apache-maven-3.3.9" C:\Users\pc\.jenkins\war\WEB-INF\lib\remoting-2.62.jar C:\Users\pc\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven32-interceptor-1.7.jar C:\Users\pc\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-**commons-1.7.jar 49708
FATAL: PermGen space
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
FATAL: PermGen space**
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jenkins.maven3.agent.Maven32Main.main(Maven32Main.java:144)
at jenkins.maven3.agent.Maven32Main.main(Maven32Main.java:74)
Caused by: java.io.EOFException: unexpected stream termination
at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:365)
at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:310)
at hudson.remoting.Launcher.main(Launcher.java:530)
at hudson.remoting.Launcher.main(Launcher.java:513)
at hudson.remoting.Launcher.main(Launcher.java:504)
at hudson.remoting.Launcher.main(Launcher.java:500)
... 6 more
Below are some of the possible steps I tried to solve-
(1)In POM.XML below tag added.
attached image link for Changed permgern space configuration in POM.xml
(2)Set JAVA_OPTS in enviroment variable.
attached image link for setting enviromental variables
But,unfortunately none of them working.Still issue is there.
After searching some where,I got to know
-XX:PermSize=256m -XX:MaxPermSize=512m declaration will resolve the issue.But I am not sure Where and How to give the above declaration.
Guys,Plz go through the above links I attached and let me know If any thing I did wrong.
Any help will be appreciated.
BR//
Abinash
Add your options to the _JAVA_OPTIONS environment variable -- this will work for sure.
Otherwise, for customizing the compiler options in your Maven build environment, there's several possibilities. See this question for an overview.

typesafe activator ui not launching

play.api.Application$$anon$1: Execution exception[[IllegalArgumentException: req
uirement failed: Source file 'C:\Users\shriv_000\.activator\1.3.6\templates\inde
x.db_e25b80033130c08.tmp' is a directory.]]
at play.api.Application$class.handleError(Application.scala:296) ~[play_
2.11-2.3.9.jar:2.3.9]
at play.api.DefaultApplication.handleError(Application.scala:402) [play_
2.11-2.3.9.jar:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfu
n$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [play_2.11-2.3.9.jar
:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfu
n$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [play_2.11-2.3.9.jar
:2.3.9]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.s
cala:36) [scala-library.jar:0.13.8]
Caused by: java.lang.IllegalArgumentException: requirement failed: Source file '
C:\Users\shriv_000\.activator\1.3.6\templates\index.db_e25b80033130c08.tmp' is a
directory.
at scala.Predef$.require(Predef.scala:219) ~[scala-library.jar:0.13.8]
at sbt.IO$.copyFile(IO.scala:584) ~[client-all-2-11-0.3.5.jar:0.3.5]
at sbt.IO$.move(IO.scala:786) ~[client-all-2-11-0.3.5.jar:0.3.5]
at activator.package$RichIO$.createViaTemporary$extension(package.scala:
30) ~[activator-templates-cache-1.0-a0afb008ea619bf9d87dc010156cddffa8a6f880.jar
:1.3.6]
at activator.templates.repository.UriRemoteTemplateRepository$$anonfun$r
esolveIndexTo$1.apply(UriRemoteTemplateRepository.scala:228) ~[activator-templat
es-cache-1.0-a0afb008ea619bf9d87dc010156cddffa8a6f880.jar:1.0-a0afb008ea619bf9d8
7dc010156cddffa8a6f880]
[info] application - onStop received closing down the app
I am at activator 1.3.6
I have seen TypeSafe Activator installation error and it might be different then my problem. I have been able to create and launch a play project.
The solution provided there did not work for me.
I see this problem frequently.
I found a workaround. Try to execute activator as an administrator.

typesafe activator dependency error

I just download the last activator version (version 1.2.12 - offline distribution) and I have found some errors in dependency when I follow the documentation in order to create a new scala project (https://www.playframework.com/documentation/2.3.x/NewApplication).
How can I get the unresolved dependency?
Can I install like mvn:install the missing dependency?
[info] Updating {file:/home/myhome/workspaceScala/play-scala/project/}play-scala-build...
[info] Resolving com.typesafe.play#routes-compiler_2.10;2.3.8 ...
[error] Server access Error: Connection timed out url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/routes-compiler_2.10/2.3.8/ivys/ivy.xml
[error] Server access Error: Connection timed out url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/routes-compiler_2.10/2.3.8/jars/routes-compiler_2.10.jar
[info] Resolving commons-io#commons-io;2.0.1 ...
[error] Server access Error: Connection timed out url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/commons-io/commons-io/2.0.1/ivys/ivy.xml
[info] Resolving com.typesafe.play#sbt-run-support_2.10;2.3.8 ...
[error] Server access Error: Connection timed out url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-run-support_2.10/2.3.8/ivys/ivy.xml
[error] Server access Error: Connection timed out url=http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-run-support_2.10/2.3.8/jars/sbt-run-support_2.10.jar
Thank you singhakash and Sarvesh, it is a network problem.
I think the best solution is to set environment variable ACTIVATOR_OPTS.
I add this line to my .bashrc file (~/.bashrc):
export ACTIVATOR_OPTS="-Dhttp.proxyUser=MyProxyAccount -Dhttp.proxyPassword=MyProxyPwd -Dhttp.proxyHost=MyProxyIp -Dhttp.proxyPort=MyProxyPort"
Thanks a lot

"org.fusesource.scalate.TemplateException: loader constraint violation" when using SBTs embedded Jetty and scalatra/scalate

I started getting this error yesterday when using the embedded 'jetty-run' task in SBT. I reverted my code to a previous version and it's still happening.
Note that I packaged up the application and deployed it in an actual jetty instance and I don't get the error. I started getting this error after adding some dependencies to my project (may or may not be related), but have since removed them.
I tried 'clean' 'clean-lib' and 'clean-cache' as well as cleaning out my ~/.m2/repository, ~/.ivy2/cache and project/boot directories.
Anybody have any other ideas?
The line that is blowing up is:
templateEngine.layout(uri, Map("flash" -> flash))
More of the stack trace is below:
org.fusesource.scalate.TemplateException: loader constraint violation: when resolving method "scala.tools.nsc.Settings.(Lscala/Function1;)V" the class loader (instance of sbt/jetty/LazyJettyRun7$SbtWebAppLoader$1) of the current class, org/fusesource/scalate/support/ScalaCompiler, and the class loader (instance of java/net/URLClassLoader) for resolved class, scala/tools/nsc/Settings, have different Class objects for the type scala/Function1 used in the signature
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:775)
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:637)
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:368)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:362)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:420)
at org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:521)
at com.ford.testbuilder.web.AppDefaults$class.com$ford$testbuilder$web$AppDefaults$$render(SharedTraits.scala:79)
at com.ford.testbuilder.web.AppDefaults$$anonfun$6.apply(SharedTraits.scala:52)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2$$anonfun$6.apply(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2$$anonfun$6.apply(ScalatraKernel.scala:133)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:44)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:121)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:121)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:121)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:121)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:121)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:120)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:120)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:120)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:119)
at com.ford.testbuilder.web.LoginServlet.org$scalatra$CookieSupport$$super$handle(LoginServlet.scala:10)
at org.scalatra.CookieSupport$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(CookieSupport.scala:102)
at org.scalatra.CookieSupport$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(CookieSupport.scala:102)
at org.scalatra.CookieSupport$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(CookieSupport.scala:102)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.CookieSupport$$anonfun$handle$1.apply$mcV$sp(CookieSupport.scala:101)
at org.scalatra.CookieSupport$$anonfun$handle$1.apply(CookieSupport.scala:101)
at org.scalatra.CookieSupport$$anonfun$handle$1.apply(CookieSupport.scala:101)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.CookieSupport$class.handle(CookieSupport.scala:100)
at com.ford.testbuilder.web.LoginServlet.org$scalatra$FlashMapSupport$$super$handle(LoginServlet.scala:10)
at org.scalatra.FlashMapSupport$$anonfun$handle$1.apply$mcV$sp(flashMap.scala:101)
at org.scalatra.FlashMapSupport$$anonfun$handle$1.apply(flashMap.scala:100)
at org.scalatra.FlashMapSupport$$anonfun$handle$1.apply(flashMap.scala:100)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
at org.scalatra.FlashMapSupport$class.handle(flashMap.scala:100)
I figured this out after trying a fresh checkout on someone else's machine (which was working fine) and comparing the classpaths. I found that I had both the scala-library-2.8.1.jar as well as the scala-library.jar in my classpath.
This was caused by the following line in my project file:
override def filterScalaJars = false
Wasted the better part of a day on this :(