Docker-maven-plugin: java.lang.Character cannot be cast to java.lang.Integer when using -X flag on docker:build

Created on 5 Oct 2017  路  5Comments  路  Source: fabric8io/docker-maven-plugin

Description

I had some problem with a docker:build hanging, so I tried to use -X flag: mvn -X docker:build

And I got the following exception (and maven terminated):

Caused by: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Integer
at org.fusesource.jansi.AnsiOutputStream.optionInt(AnsiOutputStream.java:502)
at org.fusesource.jansi.AnsiOutputStream.processEscapeCommand(AnsiOutputStream.java:258)
at org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:112)
at java.io.FilterOutputStream.write(FilterOutputStream.java:125)
at java.io.PrintStream.write(PrintStream.java:480)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.flushBuffer(StreamEncoder.java:104)
at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:185)
at java.io.PrintStream.write(PrintStream.java:527)
at java.io.PrintStream.print(PrintStream.java:669)
at java.io.PrintStream.println(PrintStream.java:806)
at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:373)
at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:368)
at org.slf4j.impl.SimpleLogger.debug(SimpleLogger.java:487)
at org.apache.maven.cli.logging.Slf4jLogger.debug(Slf4jLogger.java:44)
at org.apache.maven.monitor.logging.DefaultLog.debug(DefaultLog.java:41)
at io.fabric8.maven.docker.util.AnsiLogger.debug(AnsiLogger.java:70)`

Then I shortened my Dockerfile until docker:build executed successfully (without -X flag).
Adding however again the -X flag caused the same error.

  • d-m-p version : 0.2.2.1
  • Maven version (mvn -v) : Apache Maven 3.5.0

my configuration

<plugins>
    <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.22.1</version>
        <configuration> 
            <images>
                <image>
                    <name>wildfly10.1.0-oracle-jdk8</name>
                    <build>
                        <dockerFileDir>${basedir}/docker-build</dockerFileDir>
                        <tags>
                            <tag>latest</tag>
                        </tags>
                    </build>
                </image>
            </images>
        </configuration>
    </plugin>
</plugins>
  • Docker version : Version 17.09.0-ce-win32 (13529)

Most helpful comment

Fixed with #1039

All 5 comments

Sound like a bug indeed. I'm going to fix that but are currently very busy. A PR is highly welcome.

This bug still exists and I see it occurring on 0.26.0 version as well.

Sorry, looks like an issue with in the ANSI logger. If you switch of ansi output, this should help as a workaround (set useColor to false in the plugin configuration).

I'm trying to investigate this issue asap (though no promises, super loaded these days ..)

@rhuss I have raised a PR with a workaround. See if it helps. https://github.com/fabric8io/docker-maven-plugin/pull/1039

Fixed with #1039

Was this page helpful?
0 / 5 - 0 ratings