Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-762

Jansi fails on x64 Windows 7

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.7
    • logback-classic
    • None
    • Windows 7 x64, Java 1.6.0_35

    Description

      Trying to run basic logback example with Jansi support; it fails because the Win32 call to GetConsoleScreenBufferInfo returns 0. MSDN docs state:

      "If the function fails, the return value is zero. To get extended error information, call GetLastError."

      The logged call to GetLastError returns "T h e o p e r a t i o n c o m p l e t e d s u c c e s s f u l l y ."

      Odd.

      22:04:25,922 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
      22:04:25,944 |-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:74)
      at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:42)
      at at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:94)
      at at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:85)
      at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
      at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:318)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:197)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:183)
      at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56)
      at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
      at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
      at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
      at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54)
      at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
      at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
      at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
      at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
      at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
      at at blah.AnsiTest.<clinit>(AnsiTest.java:7)
      at at blah.AnsiTestTest.testIt(AnsiTestTest.java:13)
      at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at at java.lang.reflect.Method.invoke(Method.java:597)
      at at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
      at at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
      at at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
      at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at at java.lang.reflect.Method.invoke(Method.java:597)
      at at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      at at $Proxy0.invoke(Unknown Source)
      at at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
      at at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
      at at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      Caused by: java.lang.reflect.InvocationTargetException
      at at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
      at ... 52 common frames omitted
      Caused by: java.io.IOException: Could not get the screen info: T h e o p e r a t i o n c o m p l e t e d s u c c e s s f u l l y .

      at at org.fusesource.jansi.WindowsAnsiOutputStream.getConsoleInfo(WindowsAnsiOutputStream.java:104)
      at at org.fusesource.jansi.WindowsAnsiOutputStream.<init>(WindowsAnsiOutputStream.java:97)
      at ... 57 common frames omitted

      Attachments

        Activity

          People

            logback-dev Logback dev list
            bob_walker99 Bob Walker
            Votes:
            9 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: