2017-12-18 44 views
0

IntelliJでmaven sprintブートREST APIアプリケーションをデバッグできない問題が発生しました。アプリケーションは起動しますが、ブレークポイントで停止することはありません。Intellij - Mavenプロジェクトでデバッガが動作しない

さらに、デバッガを停止するとログに次の行が表示されますが、Javaプロセスが終了しないことがわかります.2回目にアプリケーションを起動すると、サーバーポート8080がまだ使用されているため失敗します。 CでIntelliJのログで

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

:\ Users \ユーザーBernhard.IdeaIC2017.3 \ SYSTEM \私は次のエラーが表示されるログ。

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) 

答えて

0

いくつかの検索の後で、問題がIntelliJのMaven Run/Debug設定にあることがわかりました。私は春ブーツのREST APIを開始するために使用するコマンドラインは、-Drun.jvmArguments=-Denvironment=devのjavaコマンドラインプロパティが犯人であることが表示されます

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

です。私はそれを削除すると、ブレークポイントは再び動作します。

1

おそらく、その引数の値を引用符で囲むことができます。 -D arg内の-D argのため、コマンドライン文字列全体を読み取るパーサがおそらく窒息している可能性があります。

きれいなパッケージ-Drun.profiles = DEV-US-東-1 -Drun.jvmArguments = "-Denvironment = DEV" -DskipTests春ブート:

+0

こんにちはJaraon、良いoberservationを実行します。私は "-Denvironment = dev"を二重引用符で囲みました。私はStackoverflowが私のコピーペーストでそれらを削除したようだ... –

関連する問題