Not found: value AuditEvent

96 views
Skip to first unread message

Nikoh

unread,
Jun 7, 2012, 4:18:12 AM6/7/12
to scala-i...@googlegroups.com
Hello,

I'm afflicted by red squiggles in the editor quite often. It's often under a class name with the text "Not found: value AuditEvent". What's weird is that doing a clean often doesn't fix it, but if I open up my AuditEvent.scala in the editor, and then save a minor change to the first file that had the error, it goes away.

Sometimes I get similarly behaving errors relating to a method or property not found on a class.

The other weird thing is that these errors don't show up as Errors in the Problems tab, which normal compilation errors do. Don't think I have any Scala jar mismatches - the project has the IDE-provided Scala Library entry.

Anything I could be doing wrong in my project setup, or a possible IDE bug?

Scala plugin version: 2.1.0.nightly-2_09-201205310533-41ab35e
Scala compiler version: 2.9.3.v20120524-152029-6891caaf29
Scala library version: 2.9.3.v20120524-152029-6891caaf29
Eclipse version: 3.7.2.v201202080800

Mirco Dotta

unread,
Jun 7, 2012, 5:07:09 AM6/7/12
to scala-i...@googlegroups.com
Hi Nikoh,

What you are seeing is most likely an issue with the Presentation Compiler. 
These are the sort of issues that are very difficult to reproduce for us without a clear test case, and your help would be extremely useful to narrow this down. 

But let's proceed by steps, here is what I'd do:

* Open AuditEvent.scala and check in the editor's first line, do you see an error marker? (something on the line of "the presentation compiler crashed. This compilation unit was removed..."
* Open the Error Log View (Window > Show View > Error Log), anything interesting there?
* Close all open editors. Close the project. Re-open the project. Do a full project clean. Wait until the build is finished. Now open AuditEvent.scala. Do you still see the red squiggles?

Hopefully you will still see the red squiggles. If that is the case, then it would be good if you could reduce the problem its simpler form. By reducing the problem, I mean you should start removing all code that is not needed by AuditEvent.scala (though, be careful not to remove too much, implicit conversions and default arguments are often at the root of problems such as the one you are experiencing).

If the red squiggles don't show up, it means there is some dependency between AuditEvent.scala and some other source. Usually, you need to find the set of sources such that by opening them (sometimes order counts) *before* AuditEvent.scala, it will cause AuditEvent.scala to show red squiggles after it is opened.

When you think you have found the right order, make sure to: Close all open editors. Close the project. Re-open the project. Do a full project clean. Wait until the build is finished. Re-open the sources in the sequence you believe will display the red squiggles in AuditEvent.scala.

If you can reproduce the issue consistently after doing the above actions, chances are (very high) that we can reproduce it ourselves.

At this point, you should work on reducing the problem, but this is usually easy once you have found the correct incantation for bringing the Presentation Compiler in a stale state.

At any rate, file a ticket as soon as you have a way to reproduce this consistently (and don't forget to attach the code ;)).


Hope this helps.

-- Mirco

Nikoh

unread,
Jun 7, 2012, 6:03:46 AM6/7/12
to scala-i...@googlegroups.com
Thanks Mirco - It's part of a fairly large project and usually pops up after a session of editing many files so who knows what is triggering it but I'll try to follow your instructions in narrowing it down to the smallest reproducible case.

Nick

iulian dragos

unread,
Jun 7, 2012, 6:08:33 AM6/7/12
to scala-i...@googlegroups.com
On Thu, Jun 7, 2012 at 12:03 PM, Nikoh <nick...@gmail.com> wrote:
Thanks Mirco - It's part of a fairly large project and usually pops up after a session of editing many files so who knows what is triggering it but I'll try to follow your instructions in narrowing it down to the smallest reproducible case.

Number one culprit is a mistmatch between package names and the directory structure where you place your sources. This is particularly tricky if you have package objects (place them in `package.scala`, under the directory composed of the full name of the package you're defining). Otherwise, you can follow Mirco's advice on how to track it down. It would be very helpful to know more about this.

cheers,
iulian
 

Nick


On Thursday, 7 June 2012 10:07:09 UTC+1, Mirco Dotta wrote:
Hi Nikoh,

What you are seeing is most likely an issue with the Presentation Compiler. 
These are the sort of issues that are very difficult to reproduce for us without a clear test case, and your help would be extremely useful to narrow this down. 



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Nikoh

unread,
Jun 7, 2012, 6:54:25 AM6/7/12
to scala-i...@googlegroups.com
On Thursday, 7 June 2012 11:08:33 UTC+1, Iulian Dragos wrote:

On Thu, Jun 7, 2012 at 12:03 PM, Nikoh wrote:
Thanks Mirco - It's part of a fairly large project and usually pops up after a session of editing many files so who knows what is triggering it but I'll try to follow your instructions in narrowing it down to the smallest reproducible case.

Number one culprit is a mistmatch between package names and the directory structure where you place your sources. This is particularly tricky if you have package objects (place them in `package.scala`, under the directory composed of the full name of the package you're defining). Otherwise, you can follow Mirco's advice on how to track it down. It would be very helpful to know more about this.

I did have a couple of package/directory mismatches in the past but they've since been fixed. I'll keep an eye out for any I might have missed though.

Thanks
Nick

Jan van der Vorst

unread,
Nov 16, 2012, 8:05:47 AM11/16/12
to scala-i...@googlegroups.com

Hi,
 
I'm experiencing the same problem, also on a well compiling and running project.
 
I see in the error log an "Error during askOption" message whenever I open the source file containing the class for which in the other window the presentation compiler claims erronously that there is a missing member.
 
It is a fairly large project so isolating the problem will take some time.
Meanwhile I hope this stackdump will give a hint.
 
great work you'r doing!
Jan
 
java.lang.NullPointerException
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2$$anonfun$apply$14.apply(Namers.scala:1169)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2.apply(Namers.scala:1102)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2.apply(Namers.scala:1099)
 at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:110)
 at scala.collection.immutable.List.foldLeft(List.scala:78)
 at scala.tools.nsc.typechecker.Namers$Namer.addDefaultGetters(Namers.scala:1099)
 at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1027)
 at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1305)
 at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1347)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:709)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
 at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1385)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:708)
 at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:707)
 at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1496)
 at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1504)
 at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1494)
 at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1217)
 at scala.reflect.internal.Symbols$Symbol.paramss(Symbols.scala:1473)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$DefOwner$class.addDef(ScalaStructureBuilder.scala:668)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$Builder.addDef(ScalaStructureBuilder.scala:871)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$DefOwner$class.addDef(ScalaStructureBuilder.scala:658)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$Builder.addDef(ScalaStructureBuilder.scala:871)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:943)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.collection.immutable.List.foreach(List.scala:309)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.collection.immutable.List.foreach(List.scala:309)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:950)
 at scala.collection.immutable.List.foreach(List.scala:309)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:950)
 at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser.traverse(ScalaStructureBuilder.scala:903)
 at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$5$$anonfun$apply$1.apply$mcV$sp(ScalaCompilationUnit.scala:74)
 at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$5$$anonfun$apply$1.apply(ScalaCompilationUnit.scala:73)
 at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$5$$anonfun$apply$1.apply(ScalaCompilationUnit.scala:73)
 at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
 at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:331)
 at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
Reply all
Reply to author
Forward
0 new messages