You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!javaimportjavax.ejb.EJB;
public classAnnotationTest {
public void withoutAnnotation(){}
@EJB
public void withAnnotation(){}
}
compiled with the annotation class available.
When I try to refer to this class the compiler errs out with
error: error while loading AnnotationTest, classfile'bin/AnnotationTest.class' is broken
(classjavax.ejb.EJB not found.)
but the compilers keeps on working BUT without 'knowing' the annotated methods.
See this scalac log:
$$ ~/dev/scala-2.7.1.final/bin/scala -classpath bin -YdebugWelcome to Scala version 2.7.1.final (OpenJDKServerVM, Java1.6.0).
Type in expressions to have them evaluated.
Type:help for more information.
scala>newAnnotationTest
[running phase parser on <console>]
[running phase namer on <console>]
[running phase typer on <console>]
<notype>
List()
scala.tools.nsc.FatalError:classjavax.ejb.EJB not found.
at scala.tools.nsc.symtab.Definitions$$definitions$$.getModuleOrClass(Definitions.scala:352)
at scala.tools.nsc.symtab.Definitions$$definitions$$.getClass(Definitions.scala:325)
at scala.tools.nsc.symtab.classfile.ClassfileParser.classNameToSymbol(ClassfileParser.scala:320)
at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$$1(ClassfileParser.scala:518)
at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$$tools$$nsc$$symtab$$classfile$$ClassfileParser$$$$sigToType(ClassfileParser.scala:574)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$ConstantPool.getType(ClassfileParser.scala:270)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAnnotation$$1(ClassfileParser.scala:695)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAnnotations$$1$$1.apply(ClassfileParser.scala:721)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAnnotations$$1$$1.apply(ClassfileParser.scala:720)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.RandomAccessSeq$$$$anon$$12.foreach(RandomAccessSeq.scala:136)
at scala.Iterable$$class.foreach(Iterable.scala:256)
at scala.Range.foreach(Range.scala:30)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAnnotations$$1(ClassfileParser.scala:720)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$$1(ClassfileParser.scala:649)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:765)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:765)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.RandomAccessSeq$$$$anon$$12.foreach(RandomAccessSeq.scala:136)
at scala.Iterable$$class.foreach(Iterable.scala:256)
at scala.Range.foreach(Range.scala:30)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:765)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:440)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseClass$$2.apply(ClassfileParser.scala:372)
at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseClass$$2.apply(ClassfileParser.scala:372)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.RandomAccessSeq$$$$anon$$12.foreach(RandomAccessSeq.scala:136)
at scala.Iterable$$class.foreach(Iterable.scala:256)
at scala.Range.foreach(Range.scala:30)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:372)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:83)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:292)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:292)
at scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:291)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100)
at scala.tools.nsc.symtab.Symbols$$Symbol.exists(Symbols.scala:371)
at scala.tools.nsc.typechecker.Typers$$Typer.qualifies$$1(Typers.scala:2767)
at scala.tools.nsc.typechecker.Typers$$Typer.typedIdent$$1(Typers.scala:2782)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3157)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTypeConstructor(Typers.scala:3309)
at scala.tools.nsc.typechecker.Typers$$Typer.typedNew$$1(Typers.scala:2359)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3062)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typedQualifier(Typers.scala:3285)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3145)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedApply$$1$$1.apply(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedApply$$1$$1.apply(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer.silent(Typers.scala:565)
at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3125)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3276)
at scala.tools.nsc.typechecker.Typers$$Typer.computeType(Typers.scala:3318)
at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:826)
at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:404)
at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:402)
at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:988)
at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:493)
at scala.tools.nsc.symtab.Symbols$$Symbol.initialize(Symbols.scala:607)
at scala.tools.nsc.typechecker.Typers$$Typer.addGetterSetter(Typers.scala:1088)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
at scala.List.flatMap(List.scala:1118)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1163)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1165)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1165)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2953)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$2.apply(Analyzer.scala:40)
at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:257)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:555)
at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:823)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:495)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:484)
at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:248)
at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:236)
at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:148)
at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:306)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:147)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
java.io.IOException:classfile'bin/AnnotationTest.class' is broken
(classjavax.ejb.EJB not found.)
at scala.tools.nsc.symtab.classfile.ClassfileParser.handleError$$1(ClassfileParser.scala:54)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:85)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:292)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:292)
at scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278)
at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:291)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80)
at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100)
at scala.tools.nsc.symtab.Symbols$$Symbol.exists(Symbols.scala:371)
at scala.tools.nsc.typechecker.Typers$$Typer.qualifies$$1(Typers.scala:2767)
at scala.tools.nsc.typechecker.Typers$$Typer.typedIdent$$1(Typers.scala:2782)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3157)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTypeConstructor(Typers.scala:3309)
at scala.tools.nsc.typechecker.Typers$$Typer.typedNew$$1(Typers.scala:2359)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3062)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typedQualifier(Typers.scala:3285)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3145)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedApply$$1$$1.apply(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedApply$$1$$1.apply(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer.silent(Typers.scala:565)
at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:2526)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3125)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3276)
at scala.tools.nsc.typechecker.Typers$$Typer.computeType(Typers.scala:3318)
at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:826)
at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:404)
at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$typeCompleter$$1.apply(Namers.scala:402)
at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:988)
at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:493)
at scala.tools.nsc.symtab.Symbols$$Symbol.initialize(Symbols.scala:607)
at scala.tools.nsc.typechecker.Typers$$Typer.addGetterSetter(Typers.scala:1088)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
at scala.List.flatMap(List.scala:1118)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1163)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1165)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1165)
at scala.tools.nsc.typechecker.Typers$$Typer.typedModuleDef(Typers.scala:1063)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2960)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
at scala.List$$.loop$$1(List.scala:293)
at scala.List$$.mapConserve(List.scala:310)
at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2953)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3228)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3265)
at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$2.apply(Analyzer.scala:40)
at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:257)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:555)
at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:823)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:495)
at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:484)
at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:248)
at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:236)
at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:148)
at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:306)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:147)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
error: error while loading AnnotationTest, classfile'bin/AnnotationTest.class' is broken
(classjavax.ejb.EJB not found.)
scala>deftest(x:AnnotationTest) = x.withoutAnnotation
test: (<empty>.this.AnnotationTest)scala.this.Unit
scala>deftest(x:AnnotationTest) = x.withAnnotation
<console>:4:error: value withAnnotation is not a member of <empty>.this.AnnotationTestdeftest(x:AnnotationTest) = x.withAnnotation
I attached a zip file with the source file and the compiled class.
The text was updated successfully, but these errors were encountered:
Given a class like that:
compiled with the annotation class available.
When I try to refer to this class the compiler errs out with
but the compilers keeps on working BUT without 'knowing' the annotated methods.
See this scalac log:
I attached a zip file with the source file and the compiled class.
The text was updated successfully, but these errors were encountered: