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

Chris Plummer cjplummer at openjdk.java.net
Tue Apr 6 03:18:29 UTC 2021


On Tue, 6 Apr 2021 02:46:40 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> I was actually just referring to `--add-modules`, but github added a few lines before the one I selected.
>> 
>> I guess I'm not fully understanding what `rmid` is for in this context, and how it relates to the `rmiregistry` command. I thought it was starting the registry, but that does not seem to be it's primary purpose (maybe it starts it as a side affect). Also, it is deprecated.
>
> 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.

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

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


More information about the serviceability-dev mailing list