我正在使用mvn clean install命令,似乎maven在编译类时进入了一些死锁状态,它一直保持这种状态 -
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ service-nextgen ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ service-nextgen ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 363 source files to C:\Users\service-nextgen\target\classes
如果我使用Java Visual VM可视化线程转储,我会得到以下信息:
"RMI TCP Connection(3)-3.202.32.1" #20 daemon prio=5 os_prio=0 tid=0x000000001f246000 nid=0x2454 runnable [0x000000002118e000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
- locked <0x00000000ff832010> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(FilterInputStream.java:83)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:550)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$240(TCPTransport.java:683)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/10873147.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000000ff8321d0> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"main" #1 prio=5 os_prio=0 tid=0x0000000001ff8000 nid=0x2b38 runnable [0x0000000002501000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.hashCode(Native Method)
at java.util.HashMap.hash(HashMap.java:338)
at java.util.HashMap.get(HashMap.java:556)
at com.sun.tools.javac.comp.Infer$InferenceContext.cachedCapture(Infer.java:2309)
不确定如何找出根本原因。
mvn clean install
吗?我不知道这个 RMI 连接是从哪里来的? - khmarbaisefork
属性设置为true
(-Dmaven.compiler.fork=true
)吗?这可能有助于缩小问题是Maven还是javac
本身的范围。(当使用-X
运行mvn
时,它也会打印出它使用的javac
命令行,因此您可以通过自己运行javac
来完全排除Maven。) - Andreas Sewe