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 9894 - SecurityException in InstanceSupport
Summary: SecurityException in InstanceSupport
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-01 09:16 UTC by Martin Ryzl
Modified: 2007-09-26 09:14 UTC (History)
0 users

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 Martin Ryzl 2001-03-01 09:16:56 UTC
Steps to reproduce:
1) mount kawt_midp.zip (http://www.trantor.de/kawt/)
2) browse java.* package (or CompileAll on java package)
3) see an exception

Reason:
ClassDataObject uses InstanceSupport but there is a special hack in 
java.lang.ClassLoader which prevents InstanceSupport
from working with J2ME classes. ClassLoader throws a SecurityException if
someone tries to load classes from packages java.* (all subpackages of java), 
the exception is propagated to ClassDataObject (I'm not sure if JavaDataObject 
has the same problem too) and there is not handled. Public API of J2ME (CLDC) is 
subset of J2SE, but it also contains private (package private) classes which are 
not part of J2SE (null classloader) but must be loaded from filesystem 
(NbClassLoader) and it causes the exception.

Possible solution:
1) add check for SecurityException into InstanceSupport.findClass and if it has 
been caused by a class from java. change it to ClassNotFoundException.
2) handle SecurityException in all classes that use InstanceSupport. In such a 
case it should be documented in InstanceCookie.

it is not possible to fix NbClassLoader because ClassLoader.defineClass which 
causes the exception is final :(((
Comment 1 Svata Dedic 2001-03-01 09:25:13 UTC
I'll convert SecurityException -> CNFE in both java & clazz modules. Still may
be better if docs for InstanceSupport at least mention such possibility.
Comment 2 Jan Chalupa 2001-03-12 10:46:05 UTC
Version: 'Dev' -> 3.2
Comment 3 Svata Dedic 2001-03-23 17:25:33 UTC
Fixed in 3.2.12 & dev
Comment 4 Jan Becicka 2001-04-09 16:00:22 UTC
[release32-23] Verified
Comment 5 Jan Chalupa 2001-05-05 23:25:43 UTC
Target milestone -> 3.2
Comment 6 Quality Engineering 2003-07-01 13:14:42 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.