Magicento icon indicating copy to clipboard operation
Magicento copied to clipboard

NullPointerException in errors folder

Open Zefiryn opened this issue 9 years ago • 5 comments

When opening any phtml file in errors folder console is filled with NullPointerException information

Full stack is


null
java.lang.NullPointerException
    at com.magicento.models.xml.layout.MagentoLayoutXml.setArea(MagentoLayoutXml.java:252)
    at com.magicento.MagicentoProjectComponent.getCachedLayoutXmlDocument(MagicentoProjectComponent.java:211)
    at com.magicento.models.layout.Template.getBlockElements(Template.java:51)
    at com.magicento.models.layout.Template.getBlocksClasses(Template.java:114)
    at com.magicento.extensions.BlockTypeProvider2.getBySignature(BlockTypeProvider2.java:76)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:398)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:284)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:80)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.globalLocationAware(PhpType.java:392)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveGlobal(MemberReferenceImpl.java:153)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:107)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:104)
    at com.intellij.psi.impl.source.resolve.ResolveCache$3.compute(ResolveCache.java:146)
    at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
    at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:143)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:171)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:163)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.multiResolve(PhpReferenceImpl.java:99)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.resolve(PhpReferenceImpl.java:85)
    at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.checkAccessModifiers(PhpAnnotatorVisitor.java:343)
    at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.visitPhpFieldReference(PhpAnnotatorVisitor.java:308)
    at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.accept(FieldReferenceImpl.java:37)
    at com.jetbrains.php.lang.annotator.PhpAnnotator.annotate(PhpAnnotator.java:17)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:160)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:103)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$5.run(GeneralHighlightingPass.java:313)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:399)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$300(GeneralHighlightingPass.java:64)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$6.run(GeneralHighlightingPass.java:405)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:87)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:402)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$300(GeneralHighlightingPass.java:64)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$6.run(GeneralHighlightingPass.java:405)
    at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:746)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:402)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:390)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:230)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:91)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:62)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:438)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1143)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:429)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:426)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:402)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask.exec(JobLauncherImpl.java:202)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

Zefiryn avatar Jan 14 '15 10:01 Zefiryn

I can confirm this.

null
java.lang.NullPointerException
    at com.magicento.models.xml.layout.MagentoLayoutXml.setArea(MagentoLayoutXml.java:252)
    at com.magicento.MagicentoProjectComponent.getCachedLayoutXmlDocument(MagicentoProjectComponent.java:211)
    at com.magicento.models.layout.Template.getBlockElements(Template.java:51)
    at com.magicento.models.layout.Template.getBlocksClasses(Template.java:114)
    at com.magicento.extensions.BlockTypeProvider2.getBySignature(BlockTypeProvider2.java:76)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:398)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:284)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:80)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.globalLocationAware(PhpType.java:392)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveGlobal(MemberReferenceImpl.java:153)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:107)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:104)
    at com.intellij.psi.impl.source.resolve.ResolveCache$3.compute(ResolveCache.java:146)
    at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
    at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:143)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:171)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:163)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.multiResolve(PhpReferenceImpl.java:99)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.resolve(PhpReferenceImpl.java:85)
    at com.jetbrains.php.lang.inspections.PhpInternalEntityUsedInspection.check(PhpInternalEntityUsedInspection.java:56)
    at com.jetbrains.php.lang.inspections.PhpInternalEntityUsedInspection.access$000(PhpInternalEntityUsedInspection.java:15)
    at com.jetbrains.php.lang.inspections.PhpInternalEntityUsedInspection$1.visitPhpFieldReference(PhpInternalEntityUsedInspection.java:45)
    at com.jetbrains.php.lang.psi.elements.impl.FieldReferenceImpl.accept(FieldReferenceImpl.java:37)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:80)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:313)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$4.process(LocalInspectionsPass.java:308)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:122)
    at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:44)
    at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:85)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1146)
    at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:94)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:278)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
    at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:106)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:82)
    at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

Which results PhpStorm not to work correctly anymore:

08:20:26 com.intellij.diagnostic.MessagePool$TooManyErrorsException: Too many IDE fatal errors. Monitoring stopped.

zolthan avatar Jun 01 '15 06:06 zolthan

Hi, please could you provide more information about this? which .phtml are you opening? Can you try opening just one .phtml (and close the other files)? make sure you have only one project opened in PhpStorm too Is your Magento project "special" in some way? (modman, composer, n98, symlinks, virtual machine) Is this happening with all your Magento projects?

enriquepiatti avatar Jun 01 '15 14:06 enriquepiatti

It happens when I open errors/default/page.phtml or errors/default/report.phtml in CE and EE project. One of the projects it is happening: https://github.com/Zefiryn/2plus3d-sklep Fell free to fork/download for testing

Zefiryn avatar Jun 01 '15 15:06 Zefiryn

We have a nullpointer exception too, but in every template we open. We use modman.

PhpStorm 2016.1.1 Build #PS-145.970, built on May 3, 2016 JRE: 1.8.0_76-release-b162 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

java.lang.NullPointerException
    at com.magicento.models.xml.layout.MagentoLayoutXml.setArea(MagentoLayoutXml.java:252)
    at com.magicento.MagicentoProjectComponent.getCachedLayoutXmlDocument(MagicentoProjectComponent.java:211)
    at com.magicento.models.layout.Template.getBlockElements(Template.java:51)
    at com.magicento.models.layout.Template.getBlocksClasses(Template.java:114)
    at com.magicento.extensions.BlockTypeProvider2.getBySignature(BlockTypeProvider2.java:77)
    at com.jetbrains.php.PhpIndexImpl.getBySignatureInternal(PhpIndexImpl.java:420)
    at com.jetbrains.php.PhpIndexImpl.getBySignature(PhpIndexImpl.java:306)
    at com.jetbrains.php.PhpIndexImpl.completeType(PhpIndexImpl.java:79)
    at com.jetbrains.php.lang.psi.resolve.types.PhpType.globalLocationAware(PhpType.java:380)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.resolveGlobal(MemberReferenceImpl.java:145)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:144)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl$1.resolve(PhpReferenceImpl.java:141)
    at com.intellij.psi.impl.source.resolve.ResolveCache$3.compute(ResolveCache.java:142)
    at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
    at com.intellij.psi.impl.source.resolve.ResolveCache.a(ResolveCache.java:139)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:167)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:159)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.multiResolve(PhpReferenceImpl.java:136)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.resolve(PhpReferenceImpl.java:122)
    at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.checkAccessModifiers(PhpAnnotatorVisitor.java:411)
    at com.jetbrains.php.lang.annotator.PhpAnnotatorVisitor.visitPhpMethodReference(PhpAnnotatorVisitor.java:393)
    at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:29)
    at com.jetbrains.php.lang.annotator.PhpAnnotator.annotate(PhpAnnotator.java:19)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:135)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:99)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:351)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$100(GeneralHighlightingPass.java:62)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$3.run(GeneralHighlightingPass.java:280)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:305)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$200(GeneralHighlightingPass.java:62)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$4.run(GeneralHighlightingPass.java:311)
    at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:750)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:308)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$200(GeneralHighlightingPass.java:62)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$4.run(GeneralHighlightingPass.java:311)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:83)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:308)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:277)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:216)
    at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:444)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1178)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:435)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:432)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:408)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:206)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)

christian-forgacs avatar May 12 '16 08:05 christian-forgacs

Hi @christian-forgacs I'm working on a better method to detect the correct types in Layout files. If this problem is difficulting your development you can go to Magicento settings and disable the option "Automatic inspect for $this in templates" Also, could you please send me some details of your project settings to my email? ([email protected]) When you work with modman Magicento needs that you respect the normal folder structure from Magento too. The problem is happening with all the .phtml files or only the new ones you are adding or the .phtml original from Magento? (make sure you are opening just one file in the editor, just one.phtml at the time to make the test)

enriquepiatti avatar May 12 '16 10:05 enriquepiatti