fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.12k stars 139 forks source link

Windows related exceptions #36

Closed omidb closed 1 year ago

omidb commented 9 years ago

Hi, I'm not using directly JANSI but I assume some of the libraries that I use are working with it. I get this exception:

sharedProjectJVM[ERROR] Uncaught error from thread [SPA-akka.actor.default-dispatcher-12] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[SPA]
sharedProjectJVM [ERROR] [07/08/2015 17:52:21.851] [SPA-akka.actor.default-dispatcher-12] [ActorSystem(SPA)] Uncaught error from thread [SPA-akka.actor.default-dispatcher-12] shutting down JVM since 'akka.jvm-exit-on-fat
ror' is enabled
sharedProjectJVM java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.WindowsAnsiOutputStream
sharedProjectJVM[ERROR] java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.WindowsAnsiOutputStream
sharedProjectJVM        at java.lang.Class.forName0(Native Method)
sharedProjectJVM[ERROR]         at java.lang.Class.forName0(Native Method)
sharedProjectJVM        at java.lang.Class.forName(Class.java:260)
sharedProjectJVM[ERROR]         at java.lang.Class.forName(Class.java:260)
sharedProjectJVM        at org.apache.logging.log4j.core.util.Loader.loadClassWithDefaultClassLoader(Loader.java:272)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.util.Loader.loadClassWithDefaultClassLoader(Loader.java:272)
sharedProjectJVM        at org.apache.logging.log4j.core.util.Loader.loadClass(Loader.java:267)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.util.Loader.loadClass(Loader.java:267)
sharedProjectJVM        at org.apache.logging.log4j.core.appender.ConsoleAppender.getOutputStream(ConsoleAppender.java:125)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.appender.ConsoleAppender.getOutputStream(ConsoleAppender.java:125)
sharedProjectJVM        at org.apache.logging.log4j.core.appender.ConsoleAppender.getManager(ConsoleAppender.java:104)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.appender.ConsoleAppender.getManager(ConsoleAppender.java:104)
sharedProjectJVM        at org.apache.logging.log4j.core.appender.ConsoleAppender.createAppender(ConsoleAppender.java:99)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.appender.ConsoleAppender.createAppender(ConsoleAppender.java:99)
sharedProjectJVM        at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:60)
sharedProjectJVM        at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:72)
sharedProjectJVM        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:218)
sharedProjectJVM        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:113)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:60)
sharedProjectJVM        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:80)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:72)
sharedProjectJVM        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:82)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:218)
sharedProjectJVM        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:113)
sharedProjectJVM        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:474)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:80)
sharedProjectJVM        at reactivemongo.utils.LazyLogger$.apply(utils.scala:55)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:82)
sharedProjectJVM        at reactivemongo.api.MongoDriver$.<init>(api.scala:642)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
sharedProjectJVM        at reactivemongo.api.MongoDriver$.<clinit>(api.scala)
sharedProjectJVM[ERROR]         at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:474)
sharedProjectJVM        at rocnlpui.server.MongoManager$.<init>(MongoManager.scala:22)
sharedProjectJVM[ERROR]         at reactivemongo.utils.LazyLogger$.apply(utils.scala:55)
sharedProjectJVM        at rocnlpui.server.MongoManager$.<clinit>(MongoManager.scala)
sharedProjectJVM[ERROR]         at reactivemongo.api.MongoDriver$.<init>(api.scala:642)
sharedProjectJVM        at rocnlpui.server.ApiService.getAllGraphProps(ApiService.scala:54)
sharedProjectJVM[ERROR]         at reactivemongo.api.MongoDriver$.<clinit>(api.scala)
sharedProjectJVM        at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$1.applyOrElse(MainApp.scala:59)
sharedProjectJVM[ERROR]         at rocnlpui.server.MongoManager$.<init>(MongoManager.scala:22)
sharedProjectJVM        at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$1.applyOrElse(MainApp.scala:59)
sharedProjectJVM[ERROR]         at rocnlpui.server.MongoManager$.<clinit>(MongoManager.scala)
sharedProjectJVM        at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
sharedProjectJVM[ERROR]         at rocnlpui.server.ApiService.getAllGraphProps(ApiService.scala:54)
sharedProjectJVM        at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(MainApp.scala:59)
sharedProjectJVM[ERROR]         at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$1.applyOrElse(MainApp.scala:59)
sharedProjectJVM        at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(MainApp.scala:57)
sharedProjectJVM[ERROR]         at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$1.applyOrElse(MainApp.scala:59)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(MainApp.scala:59)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at rocnlpui.server.MainApp$$anonfun$main$1$$anonfun$apply$2$$anonfun$apply$4$$anonfun$apply$5.apply(MainApp.scala:57)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:29)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:30)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:29)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:32)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:31)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.RequestContext$$anonfun$withRejectionHandling$1.applyOrElse(RequestContext.scala:130)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:32)
sharedProjectJVM        at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:31)
sharedProjectJVM        at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
sharedProjectJVM[ERROR]         at spray.routing.RequestContext$$anonfun$withRejectionHandling$1.applyOrElse(RequestContext.scala:130)
sharedProjectJVM        at spray.routing.RequestContext.reject(RequestContext.scala:202)
sharedProjectJVM[ERROR]         at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
sharedProjectJVM        at spray.routing.directives.RouteDirectives$$anon$1.apply(RouteDirectives.scala:35)
sharedProjectJVM[ERROR]         at spray.routing.RequestContext$$anon$1.handle(RequestContext.scala:84)
sharedProjectJVM        at spray.routing.directives.RouteDirectives$$anon$1.apply(RouteDirectives.scala:34)
sharedProjectJVM[ERROR]         at akka.spray.UnregisteredActorRefBase.$bang(UnregisteredActorRefBase.scala:72)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.RequestContext.reject(RequestContext.scala:202)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM[ERROR]         at spray.routing.directives.RouteDirectives$$anon$1.apply(RouteDirectives.scala:35)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.directives.RouteDirectives$$anon$1.apply(RouteDirectives.scala:34)
sharedProjectJVM        at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:29)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
sharedProjectJVM        at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:30)
sharedProjectJVM        at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.apply(ExecutionDirectives.scala:35)
sharedProjectJVM[ERROR]         at spray.routing.RouteConcatenation$RouteConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:29)
sharedProjectJVM        at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.apply(ExecutionDirectives.scala:33)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.HttpServiceBase$class.runSealedRoute$1(HttpService.scala:36)
sharedProjectJVM[ERROR]         at spray.routing.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:30)
sharedProjectJVM        at spray.routing.HttpServiceBase$$anonfun$runRoute$1.applyOrElse(HttpService.scala:46)
sharedProjectJVM[ERROR]         at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.apply(ExecutionDirectives.scala:35)
sharedProjectJVM        at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
sharedProjectJVM[ERROR]         at spray.routing.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$4.apply(ExecutionDirectives.scala:33)
sharedProjectJVM        at spray.routing.SimpleRoutingApp$$anonfun$1$$anon$1.aroundReceive(SimpleRoutingApp.scala:54)
sharedProjectJVM[ERROR]         at spray.routing.HttpServiceBase$class.runSealedRoute$1(HttpService.scala:36)
sharedProjectJVM        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
sharedProjectJVM[ERROR]         at spray.routing.HttpServiceBase$$anonfun$runRoute$1.applyOrElse(HttpService.scala:46)
sharedProjectJVM        at akka.actor.ActorCell.invoke(ActorCell.scala:487)
sharedProjectJVM[ERROR]         at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
sharedProjectJVM        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
sharedProjectJVM[ERROR]         at spray.routing.SimpleRoutingApp$$anonfun$1$$anon$1.aroundReceive(SimpleRoutingApp.scala:54)
sharedProjectJVM        at akka.dispatch.Mailbox.run(Mailbox.scala:221)
sharedProjectJVM[ERROR]         at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
sharedProjectJVM        at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
sharedProjectJVM[ERROR]         at akka.actor.ActorCell.invoke(ActorCell.scala:487)
sharedProjectJVM        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
sharedProjectJVM[ERROR]         at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
sharedProjectJVM        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
sharedProjectJVM[ERROR]         at akka.dispatch.Mailbox.run(Mailbox.scala:221)
sharedProjectJVM        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
sharedProjectJVM[ERROR]         at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
sharedProjectJVM        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
sharedProjectJVM[ERROR]         at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
sharedProjectJVM
sharedProjectJVM[ERROR]         at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
sharedProjectJVM[ERROR]         at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
sharedProjectJVM[ERROR]         at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
sharedProjectJVM ... finished with exit code -1

Any thought on that? It's sort of incompatibility with other things.

electronicboy commented 7 years ago

When looking for a fix for a similar issue, ( https://github.com/PaperMC/Paper/issues/696 ), we ended up solving a similar issue as noted on there, specifically setting the system properly library.jansi.version to a value that pleases windows.

Not entirely sure if this is the same issue, however figured the least I could do is note it incase somebody else happens to fall across this; Not my writing, but:

When jansi attempts to extract its natives, by default it tries to extract a specific
 version using the loading class's implementation version. Normally this works 
completely fine however when on Windows certain characters such as - and : 
can trigger special behaviour.

 Furthermore this behaviour only occurs in specific combinations due to the parsing done
by jansi.  For example test-test works fine, but test-test-test does not! In order to avoid
this all together but still keep our versions the same as they were, we set the override
property to the essentially garbage version Paper. This version is only used when 
extracting the libraries to their temp folder.
gnodet commented 1 year ago

Closing as this is related to jansi 1.x which is not supported anymore.