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 169770 - java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
Summary: java.security.AccessControlException: access denied (java.lang.RuntimePermiss...
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Hurka
URL: http://statistics.netbeans.org/except...
Keywords: REGRESSION
: 170791 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-04 05:17 UTC by _ tboudreau
Modified: 2009-09-03 08:42 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 152576


Attachments
stacktrace (7.41 KB, text/plain)
2009-08-04 05:17 UTC, _ tboudreau
Details
stacktrace (2.76 KB, text/plain)
2009-08-19 22:28 UTC, Exceptions Reporter
Details
stacktrace (3.23 KB, text/plain)
2009-09-01 14:31 UTC, rmatous
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2009-08-04 05:17:51 UTC
Build: NetBeans IDE Dev (Build 090803)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_06-b05
OS: Windows XP, 5.1, x86

User Comments:
tboudreau: Deleting a class in a module I am about to add to nbsrc, marked as new in hg

tboudreau: Open dialog after startup



Stacktrace: 
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
        at java.security.AccessController.checkPermission(AccessController.java:427)
        at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:893)
        at java.util.concurrent.ScheduledThreadPoolExecutor.shutdown(ScheduledThreadPoolExecutor.java:455)
        at java.util.concurrent.Executors$DelegatedExecutorService.shutdown(Executors.java:594)
        at org.netbeans.modules.profiler.actions.SelfSamplerAction$Controller.actionPerformed(SelfSamplerAction.java:193)
Comment 1 _ tboudreau 2009-08-04 05:17:56 UTC
Created attachment 85738 [details]
stacktrace
Comment 2 Exceptions Reporter 2009-08-19 22:26:16 UTC
This issue already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=152576
Comment 3 Exceptions Reporter 2009-08-19 22:28:17 UTC
Build: NetBeans IDE Dev (Build 200908022240)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_06-b05
OS: Windows NT (unknown), 6.0, x86

User Comments: 


Stacktrace: 
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
        at java.security.AccessController.checkPermission(AccessController.java:427)
        at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:893)
        at java.util.concurrent.ScheduledThreadPoolExecutor.shutdown(ScheduledThreadPoolExecutor.java:455)
        at java.util.concurrent.Executors$DelegatedExecutorService.shutdown(Executors.java:594)
        at org.netbeans.modules.profiler.actions.SelfSamplerAction$Controller.actionPerformed(SelfSamplerAction.java:193)
Comment 4 Exceptions Reporter 2009-08-19 22:28:21 UTC
Created attachment 86487 [details]
stacktrace
Comment 5 Exceptions Reporter 2009-08-19 22:28:26 UTC
This issue already has 6 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=152576
Comment 6 Jiri Sedlacek 2009-08-24 11:21:22 UTC
*** Issue 170791 has been marked as a duplicate of this issue. ***
Comment 7 Tomas Hurka 2009-08-28 12:56:02 UTC
Use JDK 1.6 as workaround.
Comment 8 _ tboudreau 2009-08-29 17:43:07 UTC
Not really a useful workaround, as I need $NB_SRC/nbbuild/user.build.properties to point to JDK 5, which means the run target of any module under $NB_SRC 
will be run on JDK 5 - as it should be (I will need to test on JDK 5 before committing anything, so running on JDK 6 just wastes time).

FYI, this appears to happen on any dialog being opened and also when any dialog receives a mouse event.  Very annoying, esp. in the case of modal dialogs 
where the exception dialog gets parented to the modal dialog.
Comment 9 Tomas Hurka 2009-08-31 12:03:13 UTC
AccessControlException is caused by the bug #6385134 in JDK. This bug is fixed in JDK 6.
 
Comment 10 Tomas Hurka 2009-08-31 13:43:12 UTC
Case from issue 170791 (taking snapshot with Profile-Me action) is working file in NB 6.7.1. It starts failing after integration of issue #168547. Due to JDK 
bug #6385134 the ThreadPoolExecutor shutdown method makes direct calls to AccessController.checkPermission. Case from issue 170791 was working fine 
before integration of issue #168547 since all methods on the call stack was from JDK or from regular netbeans modules, which protection domain has all 
permissions. However issue #168547 introduced methods from org.netbeans.modules.openide.util.ActionsBridge which are from org-openide-util.jar 
module. org-openide-util is loaded by system classloader, which does not have modifyThread RuntimePermission and therefore call to 
ThreadPoolExecutor.shutdown fails on JDK 5. According to other stack traces from exception reporter, there are other places, where the same situation can 
happen, but all includes classes from org-openide-util.jar on the stack trace. 
Comment 11 Tomas Hurka 2009-08-31 17:12:56 UTC
Fixed in profiler-main
changeset:   142872:bf68fa7872d8
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon Aug 31 18:01:31 2009 +0200
summary:     bugfix #169770, use java.util.Timer to do the sampling; redo synchornization in StackTraceSnapshotBuilder so that createSnapshot() can be 
safely invoked from non-sampling thread
Comment 12 rmatous 2009-09-01 14:31:41 UTC
Build: NetBeans IDE Dev (Build 090831)
VM: Java HotSpot(TM) Client VM, 1.5.0_16-b02, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b02
OS: Linux, 2.6.24-24-generic, i386

User Comments: 


Stacktrace: 
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
        at java.security.AccessController.checkPermission(AccessController.java:427)
        at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:893)
        at java.util.concurrent.ScheduledThreadPoolExecutor.shutdown(ScheduledThreadPoolExecutor.java:455)
        at java.util.concurrent.Executors$DelegatedExecutorService.shutdown(Executors.java:594)
        at org.netbeans.modules.profiler.actions.SelfSamplerAction$Controller.actionPerformed(SelfSamplerAction.java:249)
Comment 13 rmatous 2009-09-01 14:31:45 UTC
Created attachment 86919 [details]
stacktrace
Comment 14 Quality Engineering 2009-09-03 08:42:37 UTC
Integrated into 'main-golden', will be available in build *200909021401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/bf68fa7872d8
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #169770, use java.util.Timer to do the sampling; redo synchornization in StackTraceSnapshotBuilder so that createSnapshot() can be safely invoked from non-sampling thread