RFR: 8263636: Add --disableregistry option to jhsdb debugd [v2]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Apr 6 03:35:25 UTC 2021


On Tue, 6 Apr 2021 03:16:29 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> SA has RMI remote object, it will be handled in RMI registry.
>> We can see following exception without `--add-modules`.
>> 
>> $ jhsdb debugd --pid 40339 --disableregistry --hostname localhost --registryport 1098
>> Attaching to process ID 40339 and starting RMI services, please wait...
>> Error attaching to process or starting server: sun.jvm.hotspot.debugger.DebuggerException: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
>>         java.lang.ClassNotFoundException: sun.jvm.hotspot.debugger.remote.RemoteDebugger
>>         at jdk.hotspot.agent/sun.jvm.hotspot.RMIHelper.rebind(RMIHelper.java:75)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:380)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:330)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.startServer(HotSpotAgent.java:216)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runDEBUGD(SALauncher.java:437)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:499)
>> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
>>         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
>>         java.lang.ClassNotFoundException: sun.jvm.hotspot.debugger.remote.RemoteDebugger
>>         at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:389)
>>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
>>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
>>         at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
>>         at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
>>         at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>>         at java.base/java.lang.Thread.run(Thread.java:831)
>>         at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
>>         at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
>>         at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:380)
>>         at java.rmi/sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:158)
>>         at java.rmi/java.rmi.Naming.rebind(Naming.java:177)
>>         at jdk.hotspot.agent/sun.jvm.hotspot.RMIHelper.rebind(RMIHelper.java:64)
>>         ... 5 more
>> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
>>         java.lang.ClassNotFoundException: sun.jvm.hotspot.debugger.remote.RemoteDebugger
>>         at java.rmi/sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:157)
>>         at java.rmi/sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:466)
>>         at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:296)
>>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
>>         at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
>>         at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
>>         at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
>>         at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
>>         at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>>         at java.base/java.lang.Thread.run(Thread.java:831)
>> Caused by: java.lang.ClassNotFoundException: sun.jvm.hotspot.debugger.remote.RemoteDebugger
>>         at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:432)
>>         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:586)
>>         at java.rmi/sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
>>         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
>>         at java.base/java.lang.Class.forName0(Native Method)
>>         at java.base/java.lang.Class.forName(Class.java:466)
>>         at java.rmi/sun.rmi.server.LoaderHandler.loadClassForName(LoaderHandler.java:1221)
>>         at java.rmi/sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:731)
>>         at java.rmi/sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:674)
>>         at java.rmi/sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:611)
>>         at java.rmi/java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
>>         at java.rmi/java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
>>         at java.rmi/sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:254)
>>         at java.base/java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1944)
>>         at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1886)
>>         at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
>>         at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1706)
>>         at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:496)
>>         at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:454)
>>         at java.rmi/sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:154)
>>         ... 14 more
>> 
>> As an option, we can also use RMI registry which is started by debugd as following:
>> 
>> * console 1
>>     * `jhsdb debugd --disableregistry --pid 40859`
>> * console 2
>>     * `jhsdb -J-Dsun.jvm.hotspot.rmi.serverNamePrefix=second debugd --disableregistry --pid 40860`
>
> Both of the above are using `--disableregistry`. Is that what you meant to do? I would think that you would not want that on the first one.

Sorry, the correct commands are as follows:

* console 1 (start RMI registry)
    * `jhsdb debugd --pid 40859`
* console 2 (add `--disableregistry` to use it in console 1)
    * `jhsdb -J-Dsun.jvm.hotspot.rmi.serverNamePrefix=second debugd --disableregistry --pid 40860`

-------------

PR: https://git.openjdk.java.net/jdk/pull/3233


More information about the serviceability-dev mailing list