NullPointerException when compiling with akka

14 views
Skip to first unread message

chrisichris

unread,
May 8, 2012, 4:32:23 PM5/8/12
to yeti...@googlegroups.com
Hi,
when compiling the following code with the akka libs (http://akka,io) - I use the akka-actor-2.0.1.jar and scala-library.jar I get NullpointerException from the compiler.

The code is:
module org.yeb.akka;

import akka.actor:Actor, UntypedActor, ActorSystem, UntypedActorFactory;
import yeti.lang:Fun;

newActor system receiveFn = 
   (class YebUntypedActor extends UntypedActor
        void onReceive(Object msg)
            receiveFn this msg,
            
    end;   
   
    class YebUntypedActorFactory extends UntypedActorFactory
        UntypedActor create()
            new YebUntypedActor();
                
    end;
    (system is ~ActorSystem)#actorOf(new Props(new YebUntypedActorFactory())));
    
newActor;

And the exception:

 [java] java.lang.NullPointerException
 [java]     at yeti.renamed.asm3.ClassReader.a(Unknown Source)
 [java]     at yeti.renamed.asm3.ClassReader.accept(Unknown Source)
 [java]     at yeti.lang.compiler.ClassFinder.readClass(ClassFinder.java:183)
 [java]     at yeti.lang.compiler.JavaType.resolve(JavaType.java:528)
 [java]     at yeti.lang.compiler.JavaType.resolve(JavaType.java:888)
 [java]     at yeti.lang.compiler.MethodDesc.defineClass(DefineClass.java:190)
 [java]     at yeti.lang.compiler.YetiAnalyzer.analSeq(YetiAnalyzer.java:1017)
 [java]     at yeti.lang.compiler.YetiAnalyzer.analyze(YetiAnalyzer.java:80)
 [java]     at yeti.lang.compiler.YetiAnalyzer.lambda(YetiAnalyzer.java:1096)
 [java]     at yeti.lang.compiler.YetiAnalyzer.lambda(YetiAnalyzer.java:1093)
 [java]     at yeti.lang.compiler.YetiAnalyzer.lambdaBind(YetiAnalyzer.java:1055)
 [java]     at yeti.lang.compiler.YetiAnalyzer.singleBind(YetiAnalyzer.java:796)
 [java]     at yeti.lang.compiler.YetiAnalyzer.analSeq(YetiAnalyzer.java:972)
 [java]     at yeti.lang.compiler.YetiAnalyzer.analyze(YetiAnalyzer.java:80)
 [java]     at yeti.lang.compiler.YetiAnalyzer.toCode(YetiAnalyzer.java:1659)
 [java]     at yeti.lang.compiler.CompileCtx.compile(YetiCode.java:355)
 [java]     at yeti.lang.compiler.CompileCtx.compile(YetiCode.java:323)
 [java]     at yeti.lang.compiler.CompileCtx.compileAll(YetiCode.java:266)
 [java]     at yeti.lang.compiler.eval$compileYetiFiles$._0(eval.yeti:250)
 [java]     at yeti.lang.compiler.eval$compileYetiFiles$.apply(eval.yeti:245)
 [java]     at code._0(<>:7)
 [java]     at code.apply(<>)
 [java]     at yeti.lang.compiler.eval._1(eval.yeti:85)
 [java]     at yeti.lang.compiler.eval.execClass(eval.yeti:63)
 [java]     at yeti.lang.compiler.eval$evaluateYetiCode$._0(eval.yeti:354)
 [java]     at yeti.lang.compiler.eval$evaluateYetiCode$.apply(eval.yeti:331)
 [java]     at yeti.lang.Fun2_.apply(Unknown Source)
 [java]     at yeti.lang.compiler.yeti.main(yeti.yeti:193)


The same excptions also happens when I put all the class code in a Java-File. Only referencing the akka classes seems to cause the NullPointerException

Madis

unread,
May 9, 2012, 8:15:52 AM5/9/12
to yeti...@googlegroups.com

On Tue, 8 May 2012, chrisichris wrote:

> Hi,when compiling the following code with the akka libs (http://akka,io) - I
> use the akka-actor-2.0.1.jar and scala-library.jar I get
> NullpointerException from the compiler.
>
> The code is:
> module org.yeb.akka;
>
> import akka.actor:Actor, UntypedActor, ActorSystem, UntypedActorFactory;
> import yeti.lang:Fun;
>
> newActor system receiveFn = 
>    (class YebUntypedActor extends UntypedActor
>         void onReceive(Object msg)
>             receiveFn this msg,
>             
>     end;   
>    
>     class YebUntypedActorFactory extends UntypedActorFactory
>         UntypedActor create()
>             new YebUntypedActor();
>                 
>     end;
>     (system is ~ActorSystem)#actorOf(new Props(new
> YebUntypedActorFactory())));
>     
> newActor;
>
> And the exception:
>
>  [java] java.lang.NullPointerException

Seems that it was a bug in the asm 3.1 library used by Yeti compiler.
Hopefully patched with additional null-pointer check, try updated jar.

chrisichris

unread,
May 9, 2012, 11:58:15 AM5/9/12
to yeti...@googlegroups.com
Thanks a lot works greate
Reply all
Reply to author
Forward
0 new messages