• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • Eclipse Plugin
  • kkannaiy
  • Reporter: hmak
  • September 05, 2008
  • 0
  • Watchers: 0
  • February 12, 2013
  • October 27, 2008

Attachments

Description

Eclipse plugin throws NPE when using annotation to mark DSO roots

Reproduce case:

  1. Compile + run Eclipse project using attached sources

  2. Output on successive runs will be:

    counter is: 1
    counter is: 2
    ...
    

    Indicates that Shared.s_instance is indeed a DSO root

  3. Close Shared.java tab

  4. Open Shared.java

    Error logs will show:

    Error
    Exception occurred in listener of Java element change notification
    
    java.lang.NullPointerException
        at org.terracotta.dso.ClassInfoFactory.getClassInfo(ClassInfoFactory.java:40)
        at org.terracotta.dso.JavaModelFieldInfo.getType(JavaModelFieldInfo.java:32)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:488)
        at com.tc.aspectwerkz.expression.ast.ASTFieldPattern.jjtAccept(ASTFieldPattern.java:28)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1016)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:171)
        at com.tc.aspectwerkz.expression.ast.ASTGet.jjtAccept(ASTGet.java:22)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)
        at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
        at org.terracotta.dso.PatternHelper.matchesField(PatternHelper.java:72)
        at org.terracotta.dso.ConfigurationHelper.isRoot(ConfigurationHelper.java:1234)
        at org.terracotta.dso.ConfigurationHelper.isRoot(ConfigurationHelper.java:1248)
        at org.terracotta.dso.CompilationUnitVisitor.visit(CompilationUnitVisitor.java:435)
        at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:220)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.FieldDeclaration.accept0(FieldDeclaration.java:286)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:213)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.terracotta.dso.CompilationUnitVisitor$InspectionAction.run(CompilationUnitVisitor.java:191)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
        at org.terracotta.dso.CompilationUnitVisitor.inspect(CompilationUnitVisitor.java:167)
        at org.terracotta.dso.TcPlugin.inspect(TcPlugin.java:1411)
        at org.terracotta.dso.ElementChangedListener.elementChanged(ElementChangedListener.java:51)
        at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1552)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1542)
        at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1395)
        at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1350)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:761)
        at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:780)
        at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1169)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:101)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:176)
        at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
        at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:122)
        at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:103)
        at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:362)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:170) and
    Error
    Problems occurred when invoking code from plug-in: "org.eclipse.jdt.core".
    
    java.lang.NullPointerException
        at org.terracotta.dso.ClassInfoFactory.getClassInfo(ClassInfoFactory.java:40)
        at org.terracotta.dso.JavaModelFieldInfo.getType(JavaModelFieldInfo.java:32)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:488)
        at com.tc.aspectwerkz.expression.ast.ASTFieldPattern.jjtAccept(ASTFieldPattern.java:28)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1016)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:171)
        at com.tc.aspectwerkz.expression.ast.ASTGet.jjtAccept(ASTGet.java:22)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)
        at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
        at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
        at org.terracotta.dso.PatternHelper.matchesField(PatternHelper.java:72)
        at org.terracotta.dso.ConfigurationHelper.isRoot(ConfigurationHelper.java:1234)
        at org.terracotta.dso.ConfigurationHelper.isRoot(ConfigurationHelper.java:1248)
        at org.terracotta.dso.CompilationUnitVisitor.visit(CompilationUnitVisitor.java:435)
        at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:220)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.FieldDeclaration.accept0(FieldDeclaration.java:286)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2546)
        at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:213)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2476)
        at org.terracotta.dso.CompilationUnitVisitor$InspectionAction.run(CompilationUnitVisitor.java:191)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
        at org.terracotta.dso.CompilationUnitVisitor.inspect(CompilationUnitVisitor.java:167)
        at org.terracotta.dso.TcPlugin.inspect(TcPlugin.java:1411)
        at org.terracotta.dso.ElementChangedListener.elementChanged(ElementChangedListener.java:51)
        at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1552)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1542)
        at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1395)
        at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1350)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:761)
        at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:780)
        at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1169)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:101)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82)
        at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:176)
        at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
        at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:122)
        at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:103)
        at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:362)
        at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:170)
    

Also, am not sure how, but after some series of interactions w/ Eclipse, Eclipse will display a “NullPointerException” error in a error/warning dialog box.

Comments

Howard Mak 2008-09-09

Clarifications:

  • only plugin has problems … final runtime DSO-clustering works fine
  • problem seems to occur when tc-config.xml roots are tagged with [instead of ]

Howard Mak 2008-09-09

Also, specific use case problem affects is: use of @Root annotation from tim-annotations (http://forge.terracotta.org/releases/projects/tim-annotations/)

Howard Mak 2008-09-11

Error also prevents disabling of “Automatically start the Terracotta Server when necessary” for Terracotta project

Fiona OShea 2008-10-08

Isn’t this fixed in 2.7?

Kalai Kannaiyan 2008-11-03

Tested with Terracotta 2.7.1-nightly, as of 20081030-161010 (Revision 10718 by [email protected] from 2.7), NPE is not thrown when using annotation to mark DSO roots, it is working as expected.

Steps:

  1. Install the eclipse plugin
  2. Add Terracotta Nature
  3. Compile + run as Terracotta DSO project using attached sources

Actual: NPE is not thrown, shared root is displayed in the admin console