Micronaut-core: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream

Created on 12 Apr 2019  路  7Comments  路  Source: micronaut-projects/micronaut-core

Steps to Reproduce

  1. Create new app using cli

Expected Behaviour

Run without errors

Actual Behaviour

Got the following error:
16:16:04,758 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69) at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:40) at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88) at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79) at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90) at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193) at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383) at at io.micronaut.runtime.Micronaut.<clinit>(Micronaut.java:46) at at micronaut.jdbi.Application.main(Application.kt:9) Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream at at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56) at ... 23 common frames omitted

Environment Information

  • Operating System: Windows
  • Micronaut Version: 1.1.0
  • JDK Version: 11.0.1
bug

Most helpful comment

I followed that article and added Jansi as a dependency but still getting the same error. However by editing logback.xml and setting <withJansi>fasle</withJansi> the error disappears.

All 7 comments

I can reproduce this error behavior.

Environment Information

  • Operating System: Microsoft Windows 10 Pro (10.0.17134 N/A Build 17134)
  • Micronaut Version: 1.1.0
  • JDK Versions: Oracle JDK 1.8.0_131 (x64) and openjdk version "11.0.1"

It seems to be in the ansi color logging in logback.xml on Windows causing problems.

Is there an easy way to enable Jansi with MN? This article Springboot logging under point 8. JANSI on Windows, describe the problem and solution.

You can simply follow the same steps as described in the referenced Spring Boot post

I followed that article and added Jansi as a dependency but still getting the same error. However by editing logback.xml and setting <withJansi>fasle</withJansi> the error disappears.

We will make that setting false on Windows by default

On Windows 10, using VS Code with Maven and Gradle extensions installed, it is still happening and doing this (.._However by editing logback.xml and setting fasle...) fixed the problem.

Was this page helpful?
0 / 5 - 0 ratings