Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Intermittent ClassCastException in PolicyHandler
Intermittent ClassCastException in PolicyHandler [message #698123] Mon, 18 July 2011 20:11
arkady.ioffe is currently offline arkady.ioffeFriend
Messages: 1
Registered: July 2011
Junior Member
I encountered irregular exception Cannot Cast String to IBuddyPolicy, when the code in the plug-in that declares buddy policy registered trying to load a class from rt.jar.
I narrow down this to step in DefaultClassLoader when it tries to find a class using buddy policy. Thus it goes to org.eclipse.osgi.framework.internal.core.PolicyHandler#getPolicyImplementation() , and the exception occurs in hte following lines:
74 if (REGISTERED_POLICY.equals(buddyName)) {
75 policies[policyOrder] = new RegisteredPolicy(policedLoader);
76 return (IBuddyPolicy) policies[policyOrder];
77 }
Somehow it happens that string value "registered" in policies[0] was not reset
in line 75 to instance of class RegisteredPolicy, so line 76 throws Exception.

All code in this synchronized method executes in the Main thread. I cannot understand what is going on? This irregular Exception has average frequency about 30%.

Please help.
Arkady
Previous Topic:Different UI for Multipage Editor
Next Topic:Find the Configuration directory
Goto Forum:
  


Current Time: Thu Apr 25 12:38:27 GMT 2024

Powered by FUDForum. Page generated in 0.02650 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top