Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.Character cannot be cast to java.lang.Integer when using -X flag on docker:build #873

Closed
ghuser opened this issue Oct 5, 2017 · 5 comments

Comments

@ghuser
Copy link

ghuser commented Oct 5, 2017

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)
@ghuser ghuser changed the title java.lang.Character cannot be cast to java.lang.Integer when trying to use -X flag on docker:build java.lang.Character cannot be cast to java.lang.Integer when using -X flag on docker:build Oct 5, 2017
@rhuss
Copy link
Collaborator

rhuss commented Oct 6, 2017

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

@techpavan
Copy link
Contributor

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

@rhuss
Copy link
Collaborator

rhuss commented Jun 13, 2018

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 ..)

@techpavan
Copy link
Contributor

@rhuss I have raised a PR with a workaround. See if it helps. #1039

@rhuss
Copy link
Collaborator

rhuss commented Sep 25, 2018

Fixed with #1039

@rhuss rhuss closed this as completed Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants