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.nio.BufferUnderflowException occurs when I run any mvnd command #601

Closed
jcm007 opened this issue Feb 7, 2022 · 3 comments
Closed
Milestone

Comments

@jcm007
Copy link

jcm007 commented Feb 7, 2022

Hi Experts,

I get this error even when I run mvnd -v:

PS D:\_Projects\Java\xxx> mvnd -v
mvnd native client 0.7.1-windows-amd64 (97c587c11383a67b5bd0ff8388bd94c694b91c1e)
Terminal: org.jline.terminal.impl.jansi.win.JansiWinSysTerminal
Exception in thread "main" java.nio.BufferUnderflowException
        at java.nio.ByteBuffer.get(ByteBuffer.java:798)
        at java.nio.ByteBuffer.get(ByteBuffer.java:826)
        at org.mvndaemon.mvnd.common.DaemonRegistry.readString(DaemonRegistry.java:303)
        at org.mvndaemon.mvnd.common.DaemonRegistry.doUpdate(DaemonRegistry.java:209)
        at org.mvndaemon.mvnd.common.DaemonRegistry.read(DaemonRegistry.java:164)
        at org.mvndaemon.mvnd.common.DaemonRegistry.getAll(DaemonRegistry.java:102)
        at org.mvndaemon.mvnd.client.DaemonConnector.connect(DaemonConnector.java:101)
        at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:272)
        at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:118)

When I run other commands, it will be like:

PS D:\_Projects\Java\xxx> mvnd clean install -DskipTests=true '-Dmaven.javadoc.skip=true' '-Dmaven.compile.fork=true' -T 0.8C
Exception in thread "main" java.nio.BufferUnderflowException
        at java.nio.ByteBuffer.get(ByteBuffer.java:798)
        at java.nio.ByteBuffer.get(ByteBuffer.java:826)
        at org.mvndaemon.mvnd.common.DaemonRegistry.readString(DaemonRegistry.java:303)
        at org.mvndaemon.mvnd.common.DaemonRegistry.doUpdate(DaemonRegistry.java:209)
        at org.mvndaemon.mvnd.common.DaemonRegistry.read(DaemonRegistry.java:164)
        at org.mvndaemon.mvnd.common.DaemonRegistry.getAll(DaemonRegistry.java:102)
        at org.mvndaemon.mvnd.client.DaemonConnector.connect(DaemonConnector.java:101)
        at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:272)
        at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:118)

Please help. Thanks in advance.

@garywhittington
Copy link

The same problem started for me today. I resolved it by removing the $HOME/.m2/mvnd directory, and then all seems to be working again (with mvnd then recreating this directory).

@gnodet
Copy link
Contributor

gnodet commented Feb 16, 2022

Yes, the exception clearly indicates the registry has been corrupted. We should put some safeguard mechanism to handle this use case more gracefully. As indicated by @garywhittington, deleting the $HOME/.m2/mvnd should be a good workaround.

@gnodet
Copy link
Contributor

gnodet commented Apr 12, 2022

Fixed with #614

@gnodet gnodet closed this as completed Apr 12, 2022
@gnodet gnodet added this to the 0.7.2 milestone Apr 12, 2022
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