Intellij-调试器在Maven项目中不起作用 [英] Intellij - Debugger not working in maven project

查看:445
本文介绍了Intellij-调试器在Maven项目中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,即我无法在IntelliJ中调试Maven sprint引导REST API应用程序.该应用程序将启动,但不会在任何断点处停止.

I came across an issue where I am not able to debug a maven sprint boot REST API application in IntelliJ. The application starts up but won't stop at any breakpoint.

另外,当我停止调试器时,我在日志中看到以下几行,但是我可以看到Java进程永不终止,并且当我第二次启动该应用程序时,它失败了,因为服务器端口8080仍在使用中.

Additionally when I stop the debugger I see below lines in the log, but I can see that the java process never terminates and when I start the app the 2nd time it fails because the server port 8080 is still in use.

Disconnected from the target VM, address: '127.0.0.1:53020', transport: 'socket'
Process finished with exit code -1

在C:\ Users \ Bernhard.IdeaIC2017.3 \ system \ log的IntelliJ日志中,我看到以下错误.

In the IntelliJ logs at C:\Users\Bernhard.IdeaIC2017.3\system\log I see the following error.

2017-12-15 07:22:30,761 [  11899]   INFO - .server.BuildMessageDispatcher - An existing connection was forcibly closed by the remote host 
java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
    at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:745)

推荐答案

您可能可以将该参数的值括在引号中.读取整个命令行字符串的解析器可能由于-D arg中的-D arg而阻塞.

You can probably wrap the value of that argument in quotations. The parser that reads the entire command line string is probably choking because of the -D arg within a -D arg.

干净的软件包-Drun.profiles = dev-us-east-1 -Drun.jvmArguments = -Denvironment = dev" -DskipTests spring-boot:run

clean package -Drun.profiles=dev-us-east-1 -Drun.jvmArguments="-Denvironment=dev" -DskipTests spring-boot:run

这篇关于Intellij-调试器在Maven项目中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆