The issue is exposed by JDK-8170669.
this is a RMI product issue, below code will throw exception unexpectedly, "java.rmi.server.ExportException: internal error: ObjID already in use"
Registry registry1 = LocateRegistry.createRegistry(0);
Registry registry2 = LocateRegistry.createRegistry(0);
but below code runs successfully as expect,
Registry registry1 = LocateRegistry.createRegistry(60003);
Registry registry2 = LocateRegistry.createRegistry(60004);
Exception in thread "main" java.rmi.server.ExportException: internal error: ObjID already in use
at java.rmi/sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:184)
at java.rmi/sun.rmi.transport.Transport.exportObject(Transport.java:106)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:259)
at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
at java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:232)
at java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:157)
at java.rmi/sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:142)
at java.rmi/java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
at ming.test.rmi.LocateRegistryTest.main(LocateRegistryTest.java:10)
this is a RMI product issue, below code will throw exception unexpectedly, "java.rmi.server.ExportException: internal error: ObjID already in use"
Registry registry1 = LocateRegistry.createRegistry(0);
Registry registry2 = LocateRegistry.createRegistry(0);
but below code runs successfully as expect,
Registry registry1 = LocateRegistry.createRegistry(60003);
Registry registry2 = LocateRegistry.createRegistry(60004);
Exception in thread "main" java.rmi.server.ExportException: internal error: ObjID already in use
at java.rmi/sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:184)
at java.rmi/sun.rmi.transport.Transport.exportObject(Transport.java:106)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:259)
at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
at java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:232)
at java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:157)
at java.rmi/sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:142)
at java.rmi/java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
at ming.test.rmi.LocateRegistryTest.main(LocateRegistryTest.java:10)
- duplicates
-
JDK-8170669 com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java fails after JDK-8153916
- Closed