magento / magento/magento2-phpstorm-plugin

java.lang.NoClassDefFoundError: Could not initialize class com.intellij.lang.javascript.index.gist.JSStubElementGist

Open
#2,449 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
463
Forks
98
Avg merge
1h 6m
Merged PRs (30d)
3

Description

**Describe the bug** (*)

A clear and concise description of what the bug is.

```
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.lang.javascript.index.gist.JSStubElementGist
at com.intellij.lang.javascript.psi.stubs.impl.JSGistDataOwnerStub.initFromPsi(JSGistDataOwnerStub.java:40)
at com.intellij.lang.javascript.psi.stubs.impl.JSGistDataOwnerStub.(JSGistDataOwnerStub.java:30)
at com.intellij.lang.javascript.psi.stubs.impl.JSNamedObjectStubBase.(JSNamedObjectStubBase.java:39)
at com.intellij.lang.javascript.psi.stubs.impl.JSQualifiedObjectStubBase.(JSQualifiedObjectStubBase.java:59)
at com.intellij.lang.javascript.psi.stubs.impl.JSFunctionStubBaseImpl.(JSFunctionStubBaseImpl.java:39)
at com.intellij.lang.javascript.psi.stubs.impl.JSFunctionStubImpl.(JSFunctionStubImpl.java:18)
at com.intellij.lang.javascript.types.JSFunctionElementType.createStub(JSFunctionElementType.java:26)
at com.intellij.lang.javascript.types.JSFunctionElementType.createStub(JSFunctionElementType.java:19)
at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.createStub(DefaultStubBuilder.java:81)
at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.visitNode(DefaultStubBuilder.java:58)
at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.buildStubTree(DefaultStubBuilder.java:53)
at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTreeFor(DefaultStubBuilder.java:31)
at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTree(DefaultStubBuilder.java:22)
at com.intellij.psi.stubs.StubTreeBuilder.lambda$buildStubTree$2(StubTreeBuilder.java:154)
at com.intellij.psi.stubs.StubTreeBuilder.handleStubBuilderException(StubTreeBuilder.java:98)
at com.intellij.psi.stubs.StubTreeBuilder.lambda$buildStubTree$3(StubTreeBuilder.java:154)
at com.intellij.psi.impl.PsiManagerImpl.runInBatchFilesMode(PsiManagerImpl.java:462)
at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:132)
at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:208)
at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:186)
at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:155)
at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:30)
at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:19)
at com.intellij.util.indexing.impl.MapReduceIndex.mapByIndexer(MapReduceIndex.java:385)
at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:376)
at com.intellij.util.indexing.impl.MapReduceIndex.mapInputAndPrepareUpdate(MapReduceIndex.java:301)
at com.intellij.psi.stubs.StubUpdatingIndexStorage.mapInputAndPrepareUpdate(StubUpdatingIndexStorage.java:62)
at com.intellij.psi.stubs.StubUpdatingIndexStorage.mapInputAndPrepareUpdate(StubUpdatingIndexStorage.java:21)
at com.intellij.indexing.composite.CompositeInvertedIndexBase.updateBaseIndex(CompositeInvertedIndexBase.java:287)
at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:64)
at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:29)
at com.intellij.util.indexing.FileBasedIndexImpl.createSingleIndexValueApplier(FileBasedIndexImpl.java:1641)
at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$21(FileBasedIndexImpl.java:1512)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.lambda$freezeFileTypeTemporarilyWithProvidedValueIn$14(FileTypeManagerImpl.java:752)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.cacheFileTypesInside(FileTypeManagerImpl.java:822)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyWithProvidedValueIn(FileTypeManagerImpl.java:748)
at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1465)
at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1440)
at com.intellij.util.indexing.FileBasedIndexImpl.processRefreshedFile(FileBasedIndexImpl.java:1380)
at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1754)
at com.intellij.util.indexing.FileBasedIndexImpl$VirtualFileUpdateTask.doProcess(FileBasedIndexImpl.java:1748)
at com.intellij.util.indexing.UpdateTask.process(UpdateTask.java:63)
at com.intellij.util.indexing.UpdateTask.processAll(UpdateTask.java:32)
at com.intellij.util.indexing.FileBasedIndexImpl.forceUpdate(FileBasedIndexImpl.java:1771)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:854)
at com.intellij.psi.stubs.StubIndexEx.getContainingIds(StubIndexEx.java:367)
at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:177)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:107)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:95)
at com.jetbrains.php.PhpIndexImpl.getElements(PhpIndexImpl.java:753)
at com.jetbrains.php.PhpIndexImpl.getByName(PhpIndexImpl.java:1179)
at com.jetbrains.php.PhpIndexImpl.getByFQN(PhpIndexImpl.java:1156)
at com.jetbrains.php.PhpIndexImpl.getByFqnCacheAware(PhpIndexImpl.java:1237)
at com.jetbrains.php.PhpIndexImpl.getClassesByFQNInternal(PhpIndexImpl.java:1232)
at com.jetbrains.php.PhpIndexImpl.getAnyByFQN(PhpIndexImpl.java:1271)
at com.magento.idea.magento2plugin.reference.provider.PhpClassReferenceProvider.getReferencesByElement(PhpClassReferenceProvider.java:80)
at com.magento.idea.magento2plugin.reference.provider.CompositeReferenceProvider.getReferencesByElement(CompositeReferenceProvider.java:30)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:164)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:145)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:124)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:44)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:173)
at com.intellij.psi.impl.AbstractPsiCachedValue.doCompute(
```

**To Reproduce** (*)

Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior** (*)

A clear and concise description of what you expected to happen.

**Screenshots**

If applicable, add screenshots to help explain your problem.

**Please complete the following information:** (*)

- OS: Linux 5.15.0-126-generic
- PhpStorm/Intellij version: 2024.3
- Plugin Version: 5.3.1

**Additional context**

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the error while indexing a project, then trace the stack from PhpClassReferenceProvider.getReferencesByElement through JSGistDataOwnerStub and JSStubElementGist. Review the reported PhpStorm 2024.3 and plugin 5.3.1 versions; done means the indexing operation completes without the NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, php
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.