Home > Net >  Error when opening .aj file in STS 4 (Eclipse 4.21.0)
Error when opening .aj file in STS 4 (Eclipse 4.21.0)

Time:11-24

UPDATE 11/15/2021

Also looks like this may have already been reported, and the fix simply not released yet. https://bugs.eclipse.org/bugs/show_bug.cgi?id=575897

A workaround would still be appreciated if anyone has one.

I can edit the files in a different editor for now, but that is a major pain.

ORIGINAL QUESTION

Unable to open an aspectj file (*.aj) in STS 4.12.1.RELEASE

Whenever I try to open an .aj file, Eclipse gives the error "Editor could not be initialized" and the following exception is thrown.

Additionally, if I simply click on an .aj file in the Package Explorer, a popup comes up, saying "Problem Occurred" and "An error has occurred. See error log for more details." and the same exception. The logs simply contain the same exception.

It appears to be related to equinox, so I attempted to uninstall Equinox from STS 4, but was unable to uninstall all of it (due to other plugins depending on it, apparently), and the error persists.

I am using STS 4 "out of the box", with only the following additonal modifications:

  • AspectJ Development Tools 2.2.4.202103162301
  • Maven Integration for AJDT (Optional) 0.14.0.201302011330
  • lombok 1.18.22

My maven project depends on AspectJ 1.9.7 and maven-aspectj-plugin 1.14.0 and I am running JDK 11.

java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @71dac63f; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @629dfb5a)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.generateInfos(AJCompilationUnit.java:231)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:597)
at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:43)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:740)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:806)
at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:98)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:1039)
at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:481)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1284)
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4183)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:262)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1479)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2554)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2527)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1410)
at org.eclipse.ajdt.internal.ui.editor.AspectJEditor.doSetInput(AspectJEditor.java:359)
at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3173)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2290)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3190)
at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215)
at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527)
at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:51)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:82)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:64)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:658)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1078)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

Here are the contents of my .log file, with most of the stack traces removed to fit in this question:

!SESSION 2021-11-15 13:42:08.464 -----------------------------------------------
eclipse.buildId=4.12.1.202110260750
java.version=17
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4

!ENTRY org.eclipse.jface 2 0 2021-11-15 13:42:15.608
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-15 13:42:15.608
!MESSAGE A conflict occurred for CTRL SHIFT T:
Binding(CTRL SHIFT T,
    ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
        Open a type in a Java editor,
        Category(org.eclipse.ui.category.navigate,Navigate,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5b028f58,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)
Binding(CTRL SHIFT T,
    ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
        ,
        Category(org.eclipse.lsp4e.category,Language Servers,null,true),
        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1e4d93f7,
        ,,true),null),
    org.eclipse.ui.defaultAcceleratorConfiguration,
    org.eclipse.ui.contexts.window,,,system)

!ENTRY org.eclipse.egit.ui 2 0 2021-11-15 13:42:23.827
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\david'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.jface 4 2 2021-11-15 13:42:38.406
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    ...

!ENTRY org.eclipse.ui 4 4 2021-11-15 13:42:38.819
!MESSAGE Unable to create part
!STACK 1
org.eclipse.ui.PartInitException: Editor could not be initialized.
    at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3206)
    at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215)
    at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
    ...

Caused by: java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
    ...

!SUBENTRY 1 org.eclipse.ui.workbench.texteditor 4 0 2021-11-15 13:42:38.820
!MESSAGE Editor could not be initialized.
!STACK 0
java.lang.IllegalAccessError: class org.eclipse.ajdt.core.javaelements.AJCompilationUnit tried to access private field org.eclipse.jdt.internal.core.JavaElement.parent (org.eclipse.ajdt.core.javaelements.AJCompilationUnit is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @d96f413; org.eclipse.jdt.internal.core.JavaElement is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59172d2)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.ajCloneCachingContents(AJCompilationUnit.java:1066)
    at org.eclipse.ajdt.core.javaelements.AJCompilationUnit.buildStructure(AJCompilationUnit.java:357)
    ...

UPDATE 11/16/2021

Changed the .ini file to point to Java 11 jvm, but the exception still occurs: New start of .log file:

!SESSION 2021-11-16 09:08:49.754 -----------------------------------------------
eclipse.buildId=4.12.1.202110260750
java.version=11.0.12
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4

CodePudding user response:

Thanks for bringing this issue to my attention. I am not subscribed to the AJDT and AspectJ Bugzilla projects, i.e. I only noticed that something is wrong today when reading this question.

java.lang.IllegalAccessError:
  class org.eclipse.ajdt.core.javaelements.AJCompilationUnit
  tried to access private field
  org.eclipse.jdt.internal.core.JavaElement.parent 

The issue is caused by AJDT being incompatible with Eclipse 2021-09 due to API changes in JDT Core. Same changes do not affect AspectJ in the current release candidate 1.9.8.RC2, but AJDT seems to access a formerly protected field from an ancestor class way up the inheritance hierarchy. This needs to be adjusted to using a getter method instead, as also indicated by the patch attached to the AJDT Bugzilla issue.

Background: While I am helping to maintain AspectJ as such and AspectJ Maven Plugin (group ID dev.aspectj), AJDT has not had a dedicated maintainer for many years and is merely being kept alive by the AspectJ team, which mainly used to consist of Andy Clement and now of me because Andy is super busy (so am I, just a little bit less). The term "kept alive" means, we did and are doing the bare minimum to keep AJDT compiling and not throwing any nasty exceptions for the main use cases. I have zero knowledge about OSGi in general and Eclipse plugins in particular, i.e. I am patching around there as a dilettante. Sorry for having no better news.

Today during a quiet hour, I upgraded some upstream stuff from AspectJ inside AJDT and experienced a whole bunch of Eclipse API changes which need to be adjusted, not just the one addressed in the patch. Presently, I have no clue how to fix them. It is going to be trial and error, and I only have time once in a while, so I cannot predict when I might be able to publish a working AJDT version.


Update: I have released an AJDT version which should work with Eclipse 2021-09. See my comment in ADJT issue #575897 for more details.

  • Related