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 67533 - Exception during startup java.lang.IllegalAccessException: Class org.netbeans.core.xml.FileEntityResolver
Summary: Exception during startup java.lang.IllegalAccessException: Class org.netbeans...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-26 02:59 UTC by ahe
Modified: 2008-12-22 19:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (20.12 KB, text/plain)
2005-10-26 03:00 UTC, ahe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ahe 2005-10-26 02:59:51 UTC
During start up of NetBeans 5.0 beta I got this exception.


java.lang.IllegalAccessException: Class org.netbeans.core.xml.FileEntityResolver
can not access a member of class org.openide.loaders.XMLDataObject with
modifiers "static"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.reflect.Method.invoke(Method.java:582)
[catch] at
org.netbeans.core.xml.FileEntityResolver.createInfoLookup(FileEntityResolver.java:206)
        at
org.netbeans.core.xml.FileEntityResolver.findLookup(FileEntityResolver.java:174)
        at
org.netbeans.core.xml.FileEntityResolver.access$200(FileEntityResolver.java:58)
        at
org.netbeans.core.xml.FileEntityResolver$Lkp.update(FileEntityResolver.java:500)
        at
org.netbeans.core.xml.FileEntityResolver$Lkp.beforeLookup(FileEntityResolver.java:466)
        at
org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:488)
        at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:413)
        at org.openide.util.lookup.ProxyLookup$R.allItems(ProxyLookup.java:404)
        at
org.openide.loaders.XMLDataObject$InfoParser.lookupCookie(XMLDataObject.java:1080)
        at org.openide.loaders.XMLDataObject.getCookie(XMLDataObject.java:312)
Comment 1 ahe 2005-10-26 03:00:31 UTC
Created attachment 26336 [details]
messages.log
Comment 2 Jaroslav Tulach 2005-10-27 22:22:08 UTC
I'd bet you have not seen this exception more than once. Lucky moment to catch 
such race condition. 
Comment 3 Jaroslav Tulach 2005-10-27 22:25:17 UTC
Double locking is bad: 
 
          if (method == null) { 
              try { 
!                 method = XMLDataObject.class.getDeclaredMethod 
("createInfoLookup", new Class[] { // NOI18N 
                      XMLDataObject.class, 
                      XMLDataObject.Info.class 
                  }); 
!                 method.setAccessible (true); 
              } catch (Exception ex) { 
                  ErrorManager.getDefault ().notify (ex); 
                  return null; 
--- 192,203 ---- 
          // well, it is a wormhole, but just for default compatibility 
          if (method == null) { 
              try { 
!                 java.lang.reflect.Method m = 
XMLDataObject.class.getDeclaredMethod ("createInfoLookup", new Class[] { // 
NOI18N 
                      XMLDataObject.class, 
                      XMLDataObject.Info.class 
                  }); 
!                 m.setAccessible (true); 
!                 method = m;