我正在尝试在Linux上使用jsadebugd工具调试某些进程,但出现端口使用错误(与rmi相关)。该端口由另一个Jboss进程使用,但不允许我对Jboss做任何事情。所以我想更改jsadebugd工具尝试使用的端口,可以吗?
错误结果是:
Attaching to process ID 27523 and starting RMI services, please wait...
Error attaching to process or starting server: sun.jvm.hotspot.debugger.DebuggerException: java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use
at sun.jvm.hotspot.RMIHelper.rebind(RMIHelper.java:72)
at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:353)
at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:314)
at sun.jvm.hotspot.HotSpotAgent.startServer(HotSpotAgent.java:221)
at sun.jvm.hotspot.DebugServer.run(DebugServer.java:107)
at sun.jvm.hotspot.DebugServer.main(DebugServer.java:46)
at sun.jvm.hotspot.jdi.SADebugServer.main(SADebugServer.java:63)
Caused by: java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:310)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:188)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:100)
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:86)
at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)
at sun.jvm.hotspot.RMIHelper.rebind(RMIHelper.java:69)
... 6 more
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:106)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:27)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:333)
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
... 14 more