This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215383 - RMI application no longer runs in platform
Summary: RMI application no longer runs in platform
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 02:09 UTC by cdavis
Modified: 2012-09-10 14:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cdavis 2012-07-11 02:09:46 UTC
I have an RMI swing application that has been running a decade.  I modified for platform and 7.1 has been running it nicely.  7.2 beta, 7.2RC and 7.2 daily builds all crash.

Pertinent code follows:

// locate the registry on the server and obtain the SessionConnect object...
try {
    java.rmi.registry.Registry registry =  LocateRegistry.getRegistry(object.getURL(), 1097);
    sc = (SessionConnect) registry.lookup("SessionConnect");

     }

The crash happens at the line sc = .....  which is line 280 of class ConnectionTopComponent.

The message is as follows:
java.lang.Exception: Dangerous reflection access to sun.misc.GC$Daemon by class java.lang.Thread$1 detected!
[catch] at org.netbeans.TopSecurityManager.checkMemberAccess(TopSecurityManager.java:435)
	at java.lang.Class.checkMemberAccess(Class.java:2174)
	at java.lang.Class.getDeclaredMethod(Class.java:1951)
	at java.lang.Thread$1.run(Thread.java:1682)
	at java.lang.Thread$1.run(Thread.java:1675)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.lang.Thread.auditSubclass(Thread.java:1674)
	at java.lang.Thread.isCCLOverridden(Thread.java:1661)
	at java.lang.Thread.init(Thread.java:382)
	at java.lang.Thread.<init>(Thread.java:509)
	at sun.misc.GC$Daemon.<init>(GC.java:126)
	at sun.misc.GC$Daemon.<init>(GC.java:86)
	at sun.misc.GC$Daemon$1.run(GC.java:137)
	at sun.misc.GC$Daemon$1.run(GC.java:131)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.GC$Daemon.create(GC.java:144)
	at sun.misc.GC.setLatencyTarget(GC.java:157)
	at sun.misc.GC.access$500(GC.java:41)
	at sun.misc.GC$LatencyRequest.adjustLatencyIfNeeded(GC.java:193)
	at sun.misc.GC$LatencyRequest.<init>(GC.java:218)
	at sun.misc.GC$LatencyRequest.<init>(GC.java:173)
	at sun.misc.GC.requestLatency(GC.java:271)
	at sun.rmi.transport.DGCClient$EndpointEntry.lookup(DGCClient.java:230)
	at sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:138)
	at sun.rmi.transport.ConnectionInputStream.registerRefs(ConnectionInputStream.java:98)
	at sun.rmi.transport.StreamRemoteCall.releaseInputStream(StreamRemoteCall.java:156)
	at sun.rmi.transport.StreamRemoteCall.done(StreamRemoteCall.java:310)
	at sun.rmi.server.UnicastRef.done(UnicastRef.java:449)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at com.yrs.client.topcomponents.ConnectionTopComponent.btnConnectActionPerformed(ConnectionTopComponent.java:280)

As I mentioned, this code has been working for a decade and has been working on the 7.1 platform without issues.  It's broken, however, for all versions of 7.2.
Comment 1 cdavis 2012-07-20 01:19:43 UTC
Appears to be fixed in daily 20120719.
Comment 2 cdavis 2012-07-20 01:22:02 UTC
I spoke too early.  The exception is still being thrown.  But the rest of my code is working now in spite of the exception.
Comment 3 Antonin Nebuzelsky 2012-07-20 12:39:26 UTC
Caused by fix of issue 214019.

Jardo, please help the reporter resolve this problem.
Comment 4 Jaroslav Havlin 2012-07-23 09:04:29 UTC
(In reply to comment #2)
> I spoke too early.  The exception is still being thrown.  But the rest of my
> code is working now in spite of the exception.

This is not a "real exception", it is created only to be a part of warning which tells you that "sun.misc" class is accessed by reflection.

The warning (in fact logger message of level INFO) is shown only once par class, and only if assertions are enabled (usually development builds). If assertions are disabled, the message has level FINE.

In this case the sun.misc.GC$Daemon is called from java.lang.Thread$1, not from user code, so it can be ignored.

Fixed in http://hg.netbeans.org/core-main/rev/578350dca79a
Thanks for reporting.
Comment 5 Quality Engineering 2012-07-24 16:34:52 UTC
Integrated into 'main-golden', will be available in build *201207241500* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/578350dca79a
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #215383: Add caller "java.lang.Thread$1" to "sun.misc" access whitelist
Comment 6 Jaroslav Havlin 2012-07-27 09:46:11 UTC
http://hg.netbeans.org/releases/rev/2cc2d1cd8c9a
Integrated into release72 branch.
See bug 215895.
Comment 7 Quality Engineering 2012-09-01 11:10:14 UTC
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/2cc2d1cd8c9a
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #215383: Add caller "java.lang.Thread$1" to "sun.misc" access whitelist
Comment 8 Tomas Danek 2012-09-10 14:14:08 UTC
changeset looks fine, mechanism itself was verified as part of bug 215895 -> verified.