Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327413 - ClassCircularityError in DeclaritiveServices activate Method
Summary: ClassCircularityError in DeclaritiveServices activate Method
Status: RESOLVED DUPLICATE of bug 342613
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-11 00:18 EDT by Ed Costello CLA
Modified: 2011-11-21 05:19 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Costello CLA 2010-10-11 00:18:46 EDT
Build Identifier: org.eclipse.equinox.registry=3.5.0.v20100301, org.eclipse.equinox.ds=1.2.0.v20100422-1745, org.eclipse.equinox.common=3.6.0.v20100315

Periodically I'm getting a ClassCircularityError thrown when an activate method of a DeclaritiveService is called by the framework. The error is reported for org/eclipse/core/runtime/IRegistryEventListener. The DeclaritiveService implementation indirectly references this interface.

After debugging this appears to happen only when the service is being activated very early in the startup process. My working theory is that the org.eclipse.equinox.registry bundle containing the IRegistryEventListener is being activated by "Start Level Event Dispatcher" or similar thread related to bundle activation at the same time as the "Component Resolve Thread" activates the DeclaritiveService. I suspect that both of these threads are attempting to define the class at the same time resulting in the class circularity error.

I have changed the Start Level of org.eclipse.equinox.common and org.eclipse.equinox.registry to ensure they start before org.eclipse.equinox.ds. In this scenario the error doesn't occur, this tends to lend weight to my theory.

The error we're getting is:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:234)
...
Caused by: java.lang.ClassCircularityError: org/eclipse/core/runtime/IRegistryEventListener
        at com.orchestral.dictionary.persistence.terminology.AggregateTerminologyActivator.activate(AggregateTerminologyActivator.java:29)

This seems similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=316780 however we're not using lazy activation.

Reproducible: Sometimes

Steps to Reproduce:
Because this is dependent on the order which Declarative Services this is not easily reproducible.
Comment 1 Stoyan Boshev CLA 2010-10-11 09:34:32 EDT
According to the plugin versions provided in "Build Identifier" section I think you are using earlier version of Eclipse 3.6 (Perhaps 3.6M6 ?)
There were some fixes in DS concerning ClassCircularityError issues in 3.6RC1 (see bug #308021)
There are even more sophisticated fixes in DS in Eclipse 3.6.1 (see bug#316780)

Before going in deeper analysis on this issue, I would suggest you to switch to  Eclipse 3.6.1 and see if there are still any ClassCircularityError issues in your case.
Comment 2 Ed Costello CLA 2010-10-11 20:13:20 EDT
Sorry about the confusing version, we're using Equinox stand alone so it's a little more difficult to determine exactly what eclipse version this corresponds to.

I believe we're using 3.6M7. As there are further related fixes in 3.6.1 I'll see if we can upgrade.
Comment 3 Stoyan Boshev CLA 2011-11-21 05:19:10 EST
It seems this bug is duplicate of bug342613.

*** This bug has been marked as a duplicate of bug 342613 ***