JDK-8030943 : TEST_BUG: java/rmi/reliability/juicer/AppleUserImpl.java fails
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2013-12-23
  • Updated: 2018-03-27
  • Resolved: 2018-03-27
Related Reports
Relates :  
Relates :  
Relates :  
Description
TESTFAIL:java/rmi/reliability/juicer/AppleUserImpl.java

Test java/rmi/reliability/juicer/AppleUserImpl.java fails
#section:main
----------messages:(3/168)----------
command: main AppleUserImpl -seconds 30
reason: User specified action: run main/othervm/policy=security.policy AppleUserImpl -seconds 30 
elapsed time (seconds): 1.934
----------System.out:(0/0)----------
----------System.err:(97/5982)----------
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Starting application server in same process
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Waiting for application server process to start
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Test starting
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Waiting 30 seconds for test to complete or exception to be thrown
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: TEST FAILED
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Test finished
Dec 20, 2013 12:32:30 AM AppleUserImpl main
INFO: Test duration was 0 seconds (0 hours)
Dec 20, 2013 12:32:30 AM ApplicationServer run
SEVERE: Failed to register callbacks for AppleImpl #8:
java.rmi.NoSuchObjectException: no such object in table
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
	at com.sun.proxy.$Proxy1.useApple(Unknown Source)
	at ApplicationServer.run(ApplicationServer.java:110)
	at java.lang.Thread.run(Thread.java:744)

Dec 20, 2013 12:32:30 AM ApplicationServer run
SEVERE: Unexpected exception:
java.rmi.NoSuchObjectException: no such object in table
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
	at com.sun.proxy.$Proxy1.reportException(Unknown Source)
	at ApplicationServer.run(ApplicationServer.java:115)
	at java.lang.Thread.run(Thread.java:744)

java.lang.RuntimeException: TEST FAILED: unexpected exception
	at AppleUserImpl.main(AppleUserImpl.java:365)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: TEST FAILED: juicer server reported an exception
	at AppleUserImpl.main(AppleUserImpl.java:354)
	... 6 more
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.io.InvalidClassException: Not a proxy
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:354)
	at sun.rmi.transport.Transport$1.run(Transport.java:178)
	at sun.rmi.transport.Transport$1.run(Transport.java:175)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:174)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)
	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:744)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
	at com.sun.proxy.$Proxy5.recurse(Unknown Source)
	at AppleUserImpl$AppleUserThread.run(AppleUserImpl.java:190)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.io.InvalidClassException: Not a proxy
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:311)
	at sun.rmi.transport.Transport$1.run(Transport.java:178)
	at sun.rmi.transport.Transport$1.run(Transport.java:175)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:174)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)
	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:744)
Caused by: java.io.InvalidClassException: Not a proxy
	at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1562)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:326)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:308)
	... 10 more

JavaTest Message: Test threw exception: java.lang.RuntimeException: TEST FAILED: unexpected exception
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: TEST FAILED: unexpected exception
Comments
Not seen in a long time
27-03-2018

The usual reason for this kind of error: NoSuchObjectException: no such object in table is that the exported object has become weakly reachable. The RMI object table holds weak references to exported objects and removes them from the object table when they've been enqueued. There is thus a race between the test using a weakly-reachable exported object and the GC enqueueing it. The typical problem is that a reference to the exported object is held only in a local variable. Objects referenced only via locals can become unreachable after their last use (not when the containing method returns!) so GC can occur earlier than one might expect. Hotspot seems to have gotten more aggressive about this recently. In the file test/java/rmi/reliability/juicer/AppleUserImpl.java the reference to AppleUserImpl and the Registry are both in local variables, so these might be GC'd before the test completes. The solution is to move them into statics. See description of JDK-8027421 for additional discussion.
25-11-2014