How to display classpath used for run task? - sbt

How can the classpath used for run task be displayed under SBT 0.13?
I have found some info here https://groups.google.com/forum/#!msg/simple-build-tool/0rhVRPnjyZU/DOYAd14gh1wJ:
I was dumping my classpaths as a way to troubleshoot my build recently and maybe this task can help you too:
lazy val printClasspath = task {
this.runClasspath.getPaths.foreach(println);
None
}
runClasspath is a PathFinder [1] instance and you can interrogate it even further. I guess building a ':'-separated list of those paths will be easy.
I don't understand where and how I should use this tip. Please advise.

If I type this in the sbt shell:
inspect run
I see, among other output:
[info] Dependencies:
[info] runtime:fullClasspath
So then if I type:
show runtime:fullClasspath
I get output like:
List(
Attributed(/Users/tisue/Dropbox/repos/euler/target/scala-2.10/classes),
Attributed(/Users/tisue/.sbt/boot/scala-2.10.3/lib/scala-library.jar))
Which is probably what you were looking for?
You can also get it in a colon-separated form suitable for use with java -classpath on the command line:
export runtime:fullClasspath
which prints e.g.:
/Users/tisue/Dropbox/repos/euler/target/scala-2.10/classes:/Users/tisue/.sbt/boot/scala-2.10.3/lib/scala-library.jar

tl;dr Use last run or write a custom task.
last run
With last run you should be presented with the entire classpath:
[info] Running main.Main
[debug] Waiting for threads to exit or System.exit to be called.
[debug] Classpath:
[debug] /Users/jacek/work/ingrifo/dictionary-spray/target/scala-2.11/classes
[debug] /Users/jacek/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.4.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-can_2.11/bundles/spray-can_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-io_2.11/bundles/spray-io_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-util_2.11/bundles/spray-util_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-http_2.11/bundles/spray-http_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/org.parboiled/parboiled-scala_2.11/bundles/parboiled-scala_2.11-1.1.6.jar
[debug] /Users/jacek/.ivy2/cache/org.parboiled/parboiled-core/bundles/parboiled-core-1.1.6.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-routing_2.11/bundles/spray-routing_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-httpx_2.11/bundles/spray-httpx_2.11-1.3.2.jar
[debug] /Users/jacek/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar
[debug] /Users/jacek/.ivy2/cache/org.jvnet.mimepull/mimepull/jars/mimepull-1.9.4.jar
[debug] /Users/jacek/.ivy2/cache/com.chuusai/shapeless_2.11/jars/shapeless_2.11-1.2.4.jar
[debug] /Users/jacek/.ivy2/cache/io.spray/spray-json_2.11/bundles/spray-json_2.11-1.3.1.jar
[debug] /Users/jacek/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/jars/akka-actor_2.11-2.3.6.jar
[debug] /Users/jacek/.ivy2/cache/com.typesafe/config/bundles/config-1.2.1.jar
[debug] Waiting for thread run-main-0 to terminate.
[debug] Thread run-main-0 exited.
[debug] Waiting for thread default-akka.actor.default-dispatcher-4 to terminate.
Custom task to dump CLASSPATH
If you need to see what the run task depends on, use inspect.
[fullclasspath]> inspect run
[info] Input task: Unit
[info] Description:
[info] Runs a main class, passing along arguments provided on the command line.
[info] Provided by:
[info] {file:/Users/jacek/sandbox/so/fullClasspath/}fullclasspath/compile:run
[info] Defined at:
[info] (sbt.Defaults) Defaults.scala:704
[info] Dependencies:
[info] compile:run::streams
[info] runtime:fullClasspath
[info] compile:run::runner
[info] compile:run::mainClass
[info] Delegates:
[info] compile:run
[info] *:run
[info] {.}/compile:run
[info] {.}/*:run
[info] */compile:run
[info] */*:run
[info] Related:
[info] test:run
In Dependencies there's the runtime:fullClasspath setting which means that run depends on its value.
According to SBT help, fullClasspath is...
[fullclasspath]> help fullClasspath
The exported classpath, consisting of build products and unmanaged and managed, internal and external dependencies.
You simply need to parse the value of the runtime:fullClasspath setting.
[fullclasspath]> show runtime:fullClasspath
[info] Updating {file:/Users/jacek/sandbox/so/fullClasspath/}fullclasspath...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] List(Attributed(/Users/jacek/sandbox/so/fullClasspath/target/scala-2.10/classes), Attributed(/Users/jacek/.sbt/boot/scala-2.10.3/lib/scala-library.jar))
[success] Total time: 0 s, completed Feb 13, 2014 1:27:38 AM
To have a more parsable output, use the following task that reads fullClasspath as defined for the runtime scope (Runtime in Scala/SBT code):
lazy val printClasspath = taskKey[Unit]("Dump classpath")
printClasspath := {
(fullClasspath in Runtime value) foreach {
e => println(e.data)
}
}
Unfortunatelly, the Runtime configuration is hardcoded and think an input task to accept a configuration would make it so much better.

or directly from the bash , dash , sh or whatever shell:
sbt 'inspect run' 'show runtime:fullClasspath'
and
sbt "inspect run" "show runtime:fullClasspath"
for Windows command line.

Add the line lazy val printClasspath ... in your build.sbt file.
Then at the command line run:
sbt printClasspath

Related

How to connect to local gremlin server using python

I have a local gremlin server running:
bin/gremlin.sh
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/Users/jwan/Downloads/apache-tinkerpop-gremlin-console-3.4.4/lib/groovy-2.5.7-indy.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
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
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
But I'm also trying to connect to it using python:
from gremlin_python.structure.graph import Graph
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from os import environ
graph = Graph()
>>> graph_db = traversal().withGraph(graph).withRemote(DriverRemoteConnection(f'ws://localhost:3000/gremlin','g'))
I get a connection refused error. How do I connect to this locally?
That console session shows output from Gremlin Console not Gremlin Server. They are two totally different distributions. Download the Gremlin Server distribution here and start with bin/gremlin-server.sh. Your output should look like this after it has started:
[INFO] GremlinServer
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[INFO] DefaultGraphManager - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and preparing GremlinScriptEngines instances.
[INFO] ServerGremlinExecutor - Initialized gremlin-groovy GremlinScriptEngine and registered metrics
[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
[INFO] OpLoader - Adding the standard OpProcessor.
[INFO] OpLoader - Adding the session OpProcessor.
[INFO] OpLoader - Adding the traversal OpProcessor.
[INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
[INFO] GremlinServer - Executing start up LifeCycleHook
[INFO] Logger$info - Loading 'modern' graph data.
[INFO] GremlinServer - idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
[INFO] GremlinServer - keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0-stringd with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 4 and boss thread pool of 1.
[INFO] GremlinServer$1 - Channel started at port 8182.

Why does sbt 1.02 not suppress debug logging messages?

Install details:
SBT 1.02
Scala 2.12.3
Java 8
Ubuntu Linux 16.04 on a ThinkPad & Mac OS X Sierra (10.12.6)
Steps I took:
Installed SBT on both Linux and Mac using instructions here: http://www.scala-sbt.org/1.x/docs/
Created the Hello World example.
Tried to run the sample program, both within SBT and on the bash command line.
Observed that regardless of what settings I tried, I would still see the debug messages:
Here's a sample:
Osiris:hello Noel$ sbt
[info] Loading project definition from
/Users/Noel/src/scala/sandbox/hello/project
[info] Loading settings from build.sbt ...
[info] Set current project to Hello (in build
file:/Users/Noel/src/scala/sandbox/hello/)
[info] sbt server started at 127.0.0.1:5256
sbt:Hello> logLevel
[info] warn
sbt:Hello> run
[info] Running example.Hello
hello
[debug] Waiting for threads to exit or System.exit to be called.
[debug] Classpath:
[debug] <abbreviated>.../hello_2.12-0.1.0-SNAPSHOT.jar
[debug] <abbreviated>.../scala-library.jar
[debug] Waiting for thread run-main-0 to terminate.
[debug] Thread run-main-0 exited.
[debug] Interrupting remaining threads (should be all daemons).
[debug] Sandboxed run complete..
[debug] Exited with code 0
[success] Total time: 0 s, completed Oct 15, 2017 9:44:13 PM
sbt:Hello>
What I tried:
From the command line:
sbt warn run
From within SBT:
warn
run
Modify build.sbt to contain the line:
logLevel := Level.Warn
Here is what build.sbt looks like:
import Dependencies._
logLevel := Level.Warn
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.12.3",
version := "0.1.0-SNAPSHOT",
)),
name := "Hello",
libraryDependencies += scalaTest % Test
)
I've also searched on this forum, but this question was asked 4 years ago and those answers don't work for me. What am I missing?
Thanks in advance.
This is a known bug in sbt 1.0.1 and 1.0.2. See https://github.com/sbt/sbt/issues/3655

Strange problems with TERM=Apple_Terminal on macOS Sierra 10.12.3

I upgraded my MacBookPro to macOS Sierra and experienced a very odd behavior.
First, I used brew to install sbt as suggested in the doc:
http://www.scala-sbt.org/download.html
Here's a simple test:
cd /tmp; echo $TERM; mkdir AT; cd AT; sbt -no-share -no-global -sbt-create
Apple_Terminal
Getting org.scala-sbt sbt 0.13.13 ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/jars/sbt.jar ...
[SUCCESSFUL ] org.scala-sbt#sbt;0.13.13!sbt.jar (1934ms)
...
downloading https://repo1.maven.org/maven2/jline/jline/2.13/jline-2.13.jar ...
[SUCCESSFUL ] jline#jline;2.13!jline.jar (170ms)
...
Getting Scala 2.10.6 (for sbt)...
downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.6/jline-2.10.6.jar ...
[SUCCESSFUL ] org.scala-lang#jline;2.10.6!jline.jar (70ms)
downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
[SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (80ms)
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24494kB/25ms)
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.NumberFormatException: For input string: "`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
at jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:233)
at jline.UnixTerminal.<init>(UnixTerminal.java:64)
at jline.UnixTerminal.<init>(UnixTerminal.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at jline.TerminalFactory.getFlavor(TerminalFactory.java:209)
at jline.TerminalFactory.create(TerminalFactory.java:100)
at jline.TerminalFactory.get(TerminalFactory.java:184)
at jline.TerminalFactory.get(TerminalFactory.java:190)
at sbt.ConsoleLogger$.ansiSupported(ConsoleLogger.scala:123)
at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:117)
at sbt.ConsoleLogger$.<clinit>(ConsoleLogger.scala)
at sbt.GlobalLogging$.initial(GlobalLogging.scala:43)
at sbt.StandardMain$.initialGlobalLogging(Main.scala:64)
at sbt.StandardMain$.initialState(Main.scala:73)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
[info] Loading project definition from /private/tmp/AT/project
[info] Updating {file:/private/tmp/AT/project/}at-build...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scala-sbt#sbt;0.13.13 ...
[info] Resolving org.scala-sbt#main;0.13.13 ...
[info] Resolving org.scala-sbt#actions;0.13.13 ...
[info] Resolving org.scala-sbt#classpath;0.13.13 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.6 ...
[info] Resolving org.scala-sbt#interface;0.13.13 ...
[info] Resolving org.scala-sbt#io;0.13.13 ...
[info] Resolving org.scala-sbt#control;0.13.13 ...
[info] Resolving org.scala-sbt#launcher-interface;1.0.0-M1 ...
[info] Resolving org.scala-sbt#completion;0.13.13 ...
[info] Resolving org.scala-sbt#collections;0.13.13 ...
[info] Resolving jline#jline;2.13 ...
[info] Resolving org.fusesource.jansi#jansi;1.11 ...
[info] Resolving org.scala-sbt#api;0.13.13 ...
[info] Resolving org.scala-sbt#classfile;0.13.13 ...
[info] Resolving org.scala-sbt#logging;0.13.13 ...
[info] Resolving org.scala-sbt#process;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.13 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.13 ...
[info] Resolving org.scala-sbt#relation;0.13.13 ...
[info] Resolving org.scala-sbt#compile;0.13.13 ...
[info] Resolving org.scala-sbt#persist;0.13.13 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.13 ...
[info] Resolving org.scala-sbt#ivy;0.13.13 ...
[info] Resolving org.scala-sbt#cross;0.13.13 ...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cf13e211b2cb31f0d3b317289dca70eca3362f6 ...
[info] Resolving com.jcraft#jsch;0.1.50 ...
[info] Resolving org.scala-sbt#serialization_2.10;0.1.2 ...
[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.1 ...
[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...
[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...
[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...
[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...
[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...
[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.13 ...
[info] Resolving org.scala-sbt#task-system;0.13.13 ...
[info] Resolving org.scala-sbt#tasks;0.13.13 ...
[info] Resolving org.scala-sbt#tracking;0.13.13 ...
[info] Resolving org.scala-sbt#cache;0.13.13 ...
[info] Resolving org.scala-sbt#testing;0.13.13 ...
[info] Resolving org.scala-sbt#test-agent;0.13.13 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.13 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.13 ...
[info] Resolving org.scala-sbt#command;0.13.13 ...
[info] Resolving org.scala-sbt#template-resolver;0.1 ...
[info] Resolving org.scala-sbt#logic;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.13 ...
[info] Resolving org.scala-lang#jline;2.10.6 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to at (in build file:/private/tmp/AT/)
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.NumberFormatException: For input string: "`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
at jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:233)
at jline.UnixTerminal.<init>(UnixTerminal.java:64)
at jline.UnixTerminal.<init>(UnixTerminal.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at jline.TerminalFactory.getFlavor(TerminalFactory.java:209)
at jline.TerminalFactory.create(TerminalFactory.java:100)
at jline.TerminalFactory.get(TerminalFactory.java:184)
at jline.TerminalFactory.get(TerminalFactory.java:190)
at sbt.JLine$.sbt$JLine$$terminal(LineReader.scala:85)
at sbt.JLine$.withTerminal(LineReader.scala:88)
at sbt.JLine$.usingTerminal(LineReader.scala:96)
at sbt.JLine$.createReader(LineReader.scala:102)
at sbt.FullReader.<init>(LineReader.scala:132)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:184)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:181)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:30)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:30)
at sbt.Command$.process(Command.scala:93)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:96)
at sbt.MainLoop$.run(MainLoop.scala:89)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
at sbt.MainLoop$.runLogged(MainLoop.scala:22)
at sbt.StandardMain$.runManaged(Main.scala:57)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.NumberFormatException: For input string: "`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
at jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:233)
at jline.UnixTerminal.<init>(UnixTerminal.java:64)
at jline.UnixTerminal.<init>(UnixTerminal.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at jline.TerminalFactory.getFlavor(TerminalFactory.java:209)
at jline.TerminalFactory.create(TerminalFactory.java:100)
at jline.TerminalFactory.get(TerminalFactory.java:184)
at jline.TerminalFactory.get(TerminalFactory.java:190)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:240)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:232)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:220)
at sbt.JLine$$anonfun$createReader$1.apply(LineReader.scala:103)
at sbt.JLine$$anonfun$createReader$1.apply(LineReader.scala:102)
at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:98)
at sbt.JLine$$anonfun$usingTerminal$1.apply(LineReader.scala:96)
at sbt.JLine$.withTerminal(LineReader.scala:89)
at sbt.JLine$.usingTerminal(LineReader.scala:96)
at sbt.JLine$.createReader(LineReader.scala:102)
at sbt.FullReader.<init>(LineReader.scala:132)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:184)
at sbt.BasicCommands$$anonfun$shell$1.apply(BasicCommands.scala:181)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:30)
at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:30)
at sbt.Command$.process(Command.scala:93)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:96)
at sbt.MainLoop$.run(MainLoop.scala:89)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
at sbt.MainLoop$.runLogged(MainLoop.scala:22)
at sbt.StandardMain$.runManaged(Main.scala:57)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
>
In looking a the stack trace, I understand that sbt uses jline
to query the capabilities of the terminal using the 'infocmp' process.
In this case, it shows:
infocmp
# Reconstructed via infocmp from file: /usr/share/terminfo/41/Apple_Terminal
nsterm|Apple_Terminal|AppKit Terminal.app v41+ w/MacRoman charset (color),
am, bw, msgr, xenl, xon,
colors#8, cols#80, it#8, lines#24, ncv#37, pairs#64,
acsc=+\335\,\334-\366.\3770#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245,
bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
enacs=\E(B\E)0, home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL,
il1=\E[L, ind=^J, ka1=\EOq, ka3=\EOs, kb2=\EOr, kbs=\177,
kc1=\EOp, kc3=\EOn, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
kcuu1=\EOA, kent=\EOM, kf1=\EOP, kf2=\EOQ, kf3=\EOR,
kf4=\EOS, op=\E[0m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smkx=\E[?1h\E=,
smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR,
u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
Indeed, the 'acsc' line matches the content that jline tried to parse as a number.
Switching terminal worked:
export TERM=xterm-256color
cd tmp; echo $TERM; mkdir XC; cd XC; sbt -no-share -no-global -sbt-create
xterm-256color
Getting org.scala-sbt sbt 0.13.13 ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/jars/sbt.jar ...
[SUCCESSFUL ] org.scala-sbt#sbt;0.13.13!sbt.jar (2051ms)
...
Getting Scala 2.10.6 (for sbt)...
downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.6/jline-2.10.6.jar ...
[SUCCESSFUL ] org.scala-lang#jline;2.10.6!jline.jar (70ms)
downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
[SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (69ms)
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24494kB/48ms)
[info] Loading project definition from /private/tmp/XC/project
[info] Updating {file:/private/tmp/XC/project/}xc-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to xc (in build file:/private/tmp/XC/)
>
I also noticed that sbt 1.0.0-M4 seems to be unaffected by this
terminal difference:
echo $TERM; mkdir NAT; cd NAT; sbt -no-share -no-global -sbt-create
Apple_Terminal
Getting org.scala-sbt sbt 1.0.0-M4 ...
downloading https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.0.0-M4/sbt-1.0.0-M4.jar ...
[SUCCESSFUL ] org.scala-sbt#sbt;1.0.0-M4!sbt.jar (78ms)
...
Getting Scala 2.11.8 (for sbt)...
downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.4/scala-xml_2.11-1.0.4.jar ...
[SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.4!scala-xml_2.11.jar(bundle) (92ms)
downloading https://repo1.maven.org/maven2/jline/jline/2.12.1/jline-2.12.1.jar ...
[SUCCESSFUL ] jline#jline;2.12.1!jline.jar (111ms)
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
6 artifacts copied, 0 already retrieved (26456kB/26ms)
[info] Loading project definition from /private/tmp/NAT/project
[info] Updating {file:/private/tmp/NAT/project/}nat-build...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Set current project to nat (in build file:/private/tmp/NAT/)
>
Same behavior with TERM=xterm-256color.
I'm baffled by this.
Has anyone experienced this problem?
jline (and jline2) uses a naive parser
Matcher m = Pattern.compile("\\s*(([^,]|\\\\,)+)\\s*[,$]").matcher(lines[i]);
which cannot handle the input shown. Among other omissions, it looks for a # character, decides that is the terminfo-separator for a numeric capability and its value and attempts to parse everything following the # as an integer. So rather than seeing
acsc=+\335\,\334-\366.\3770#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245,
as
acsc
=
+\335\,\334-\366.\3770#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245,
(where the value is a set of character-mappings), it sees
acsc=+\335\,\334-\366.\3770#`\327a\:f\241g\261h
#
i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245,
The problem is aggravated by Apple's habit of supplying long-obsolete software in its base system. If you happened to install something newer, whether with MacPorts or something else, the nsterm entry would have a different value for acsc:
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
which is just a one-one mapping (e.g., "vt100").
The one shown in the question is named nsterm+mac, which corresponds to nsterm-old (renamed in October 2009). The entry was reformatted in September 2010 (reordering the mapping to look as shown), but for practical purposes has been obsolete since 2009.
The ncurses terminfo(5) manual page assumes that the reader knows something about the syntax. That is documented by X/Open, e.g., Formal Grammar.
Well, 1.0.x uses a newer JLine which could be the difference. I'm not sure how I have the following terminal but I can confirm that I'm using the following:
eric$ echo $TERM
xterm-256color
I am using OS X 10.11.6 (El Capitan) so perhaps they changed the default terminal in the newer OS?
This is not too much help but at least it confirms what you found. Also, I haven't found any problems with this configuration using 0.13.x but have added an issue for the 1.0.x dev version related to stty echo after running an sbt script. Refer to https://github.com/sbt/sbt/issues/2963
This issue still occurred for me on OSX 10.12.5 with SBT 0.13.13. Following the comments, I got this to work by just exporting anything other than apple terminal:
export TERM=Apple_NoTerminal
sbt

graniteds-tutorial-data using GraniteDS 3.0.1 error

I run the following command for the example graniteds-tutorial-data in the GraniteDS 3.0.1 GA github repo, but get the error trace given at the bottom of this post,
mvn clean install asciidoctor:process-asciidoc -Dserver=ejb -Dclient=flex
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.graniteds.tutorials:tutorial-data-client-flex:1.0-SNAPSHOT (C:\Documents and Settings\463072\FreshSpaceJuno\graniteds-tutorial-data\client-flex\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta or one of its dependencies could not be resolved: The following artifacts could not be resolved:
com.adobe.flex.compiler:saxon9:jar:4.5.1.21328, com.adobe.flex.compiler:xalan:jar:4.5.1.21328: Could not transfer artifact com.adobe.flex.compiler:saxon9:jar:4.5.1.21328 from/to flex-mojos-plugin-repository (http://repository.sonatype.org/content/groups/flexgroup/): GET request of: com/adobe/flex/compiler/saxon9/4.5.1.21328/saxon9-4.5.1.21328.jar from flex-mojos-plugin-repository failed: Premature end of Content-Length delimited message body (expected: 5024396; received: 3576621 -> [Help 2]
[ERROR] Unknown packaging: swf # line 17, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Any help on how to resolve this will be really appreciated. I am trying to port my application with the GraniteDS 2.0.3 to the latest 3.0.1. Also, are there any examples of a Flex EJB example using GraniteDS 3.0.1?
This is the log after I made the change you suggested.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.graniteds.tutorials:tutorial-data-server-model:jar:1.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at org.graniteds.tutorials:tutorial-data instead of org.graniteds.tutorials:tutorial-parent, please verify your project structure # line 28, column 13
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.graniteds.tutorials:tutorial-data-client-flex:swf:1.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at org.graniteds.tutorials:tutorial-data instead of org.graniteds.tutorials:tutorial-parent-client-flex, please verify your project structure # line 9, column 13
[WARNING] 'build.plugins.plugin.version' for org.sonatype.flexmojos:flexmojos-maven-plugin is missing. # org.graniteds.tutorials:tutorial-parent-client-flex:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-client-flex\3.0.1.GA\tutorial-parent-client-flex-3.0.1.GA.pom, line 67, column 21
[WARNING] 'dependencies.dependency.scope' for com.adobe.flex.framework:spark:swc must be one of [provided, compile, runtime, test, system] but is 'theme'. # org.graniteds.tutorials:tutorial-parent-client-flex:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-client-flex\3.0.1.GA\tutorial-parent-client-flex-3.0.1.GA.pom, line 33, column 20
[WARNING] 'dependencies.dependency.scope' for org.graniteds:granite-client-flex:swc must be one of [provided, compile, runtime, test, system] but is 'internal'. # org.graniteds.tutorials:tutorial-parent-client-flex:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-client-flex\3.0.1.GA\tutorial-parent-client-flex-3.0.1.GA.pom, line 49, column 20
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.graniteds.tutorials:tutorial-data-server-ejb:war:1.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at org.graniteds.tutorials:tutorial-data instead of org.graniteds.tutorials:tutorial-parent-server-ejb, please verify your project structure # line 28, column 13
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # org.graniteds.tutorials:tutorial-parent-server-base:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-server-base\3.0.1.GA\tutorial-parent-server-base-3.0.1.GA.pom, line 37, column 21
[WARNING] 'build.plugins.plugin.version' for org.wildfly.plugins:wildfly-maven-plugin is missing. # org.graniteds.tutorials:tutorial-parent-server-base:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-server-base\3.0.1.GA\tutorial-parent-server-base-3.0.1.GA.pom, line 84, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. # org.graniteds.tutorials:tutorial-parent-server-base:3.0.1.GA, C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-parent-server-base\3.0.1.GA\tutorial-parent-server-base-3.0.1.GA.pom, line 46, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] GraniteDS Data Tutorial - Server Model
[INFO] GraniteDS Data Tutorial - Flex Client
[INFO] GraniteDS Data Tutorial - EJB Server
[INFO] GraniteDS Data Tutorial
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GraniteDS Data Tutorial - Server Model 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
.
.
.
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # tutorial-data-server-model ---
.
.
.
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.jar
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to C:\Documents and Settings\463072\FreshSpaceJuno\graniteds-tutorial-data\server-model\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # tutorial-data-server-model ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Documents and Settings\463072\FreshSpaceJuno\graniteds-tutorial-data\server-model\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # tutorial-data-server-model ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # tutorial-data-server-model ---
Downloading: http://repository.sonatype.org/content/groups/flexgroup/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom
Downloading: http://dl.bintray.com/graniteds/tutorial-dependencies/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom
.
.
[INFO] Installing C:\Documents and Settings\463072\FreshSpaceJuno\graniteds-tutorial-data\server-model\pom.xml to C:\Documents and Settings\463072\.m2\repository\org\graniteds\tutorials\tutorial-data-server-model\1.0-SNAPSHOT\tutorial-data-server-model-1.0-SNAPSHOT.pom
[INFO]
[INFO] --- asciidoctor-maven-plugin:0.1.4:process-asciidoc (default-cli) # tutorial-data-server-model ---
Downloading: http://repository.sonatype.org/content/groups/flexgroup/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom
Downloading: http://dl.bintray.com/graniteds/tutorial-dependencies/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom
.
.
.
Downloaded: http://repo.maven.apache.org/maven2/org/graniteds/granite-client-flex45-advanced/3.0.1.GA/granite-client-flex45-advanced-3.0.1.GA.swc (366 KB at 97.0 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GraniteDS Data Tutorial - Server Model ............ SUCCESS [7:41.452s]
[INFO] GraniteDS Data Tutorial - Flex Client ............. FAILURE [1:18.299s]
[INFO] GraniteDS Data Tutorial - EJB Server .............. SKIPPED
[INFO] GraniteDS Data Tutorial ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:08.939s
[INFO] Finished at: Thu Jan 23 12:00:48 IST 2014
[INFO] Final Memory: 25M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project tutorial-data-client-flex: Could not resolve dependencies for project org.graniteds.tutorials:tutorial-data-client-flex:swf:1.0-SNAPSHOT: Could not transfer artifact com.adobe.flex.framework:framework:zip:configs:4.5.1.21328 from/to flex-mojos-repository (http://repository.sonatype.org/content/groups/flexgroup/): Checksum validation failed, expected 410a3bcaceb1ea1960b2521818dc7ab9fac35aef but is 5359ccaf2d93e09ff2ec6fffe0648c611f42314b -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :tutorial-data-client-flex
Could you try renaming temporarily your .m2 to .m2.bak so we can make sure that this is not just an issue with your local repository?
are there any examples of a Flex EJB example using GraniteDS 3.0.1?
Yes, the one you are trying to launch.
Thanks.

Setup of flex units on linux

I am working on a project using Flex and until now we are using Windows to run flex unit tests for the modules/artifacts that require flex environment. Because of given dependencies, it is difficult to automatize anything because I have to swithch between linux/windows when running those maven tests.
I have made an effort to try to make flex units tests run on linux, but have not succedded [yet]. Here is small part of the stack trace from maven clean test -X on a flex project.
[INFO] Flexmojos 3.8
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Running tests /root/trunk/flex-project/flex-surface/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [org.sonatype.flexmojos.test.monitor.AsVmPing] opened server socket on port 13540
[DEBUG] [org.sonatype.flexmojos.test.monitor.ResultHandler] opened server socket on port 13539
[DEBUG] [LAUNCHER] ASVmLauncher starting
[DEBUG] [LAUNCHER] exec: /usr/bin/flashplayer - /root/trunk/flex-project/flex-project-arbeidsflate/flex-surface-common/flex-surface-common-flex/target/test-classes/TestRunner.swf
[DEBUG] [LAUNCHER] Creating process
[WARNING] [LAUNCHER] Using xvfb-run to launch headless tests
[DEBUG] [LAUNCHER] Process created java.lang.UNIXProcess#1a6c088
[DEBUG] [MOJO] launcher RUNNING
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[DEBUG] [LAUNCHER] Output pumpers ON
[DEBUG] [LAUNCHER] Waiting for flashplayer termination
[DEBUG] [LAUNCHER] Flashplayer closed
[DEBUG] [LAUNCHER] Unexpected return code 1
[DEBUG] [SYSERR]: mktemp: cannot create temp file /tmp/Xauthority: File exists
[DEBUG] [MOJO] launcher ERROR
[DEBUG] [MOJO] pinger STARTED
[DEBUG] [MOJO] resultHandler STARTED
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 0, Failures: 0, Errors: 0, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
I need help find out what is wrong. If any of you guys know any other way to run flex units test on linux, NOT THROUGH JENKINS/HUDSON, I will be extremely grateful.
First of all, just follow the linux part of the instructions on the following site:Running unit tests - FlexMojos. Download the flashplayer and untar it some appropriate place and put the absolute directory path in your PATH variable.
Download the xvfb-run script and change the following 'fi'
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
error "temporary directory $XVFB_RUN_TMPDIR already exists"
exit 4
fi
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority)
fi
to
# If the user did not specify an X authorization file to use, set up a temporary
# directory to house one.
if [ -z "$AUTHFILE" ]; then
XVFB_RUN_TMPDIR=$(mktemp -d)
if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
error "temporary directory $XVFB_RUN_TMPDIR already exists"
exit 4
fi
AUTHFILE=$(mktemp "$XVFB_RUN_TMPDIR/Xauthority")
fi
I solved my problem, hopefully you will too.
Good luck.

Resources