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 16:11
arkady.ioffe is currently offline arkady.ioffe
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: Mon Jul 28 00:29:46 EDT 2014

Powered by FUDForum. Page generated in 0.04132 seconds