Hi B,

I can confirm that I can reproduce this issue. Eclipse JDT generates
different bytecode than javac. The modifier of the anonymous class is 8
(STATIC) for javac, but 0 for JDT. You might want to file a bug
report<https://bugs.eclipse.org/bugs/>to Eclipse.

/Patrik



On Mon, Apr 14, 2014 at 6:37 AM, Boney Sekh <boneys...@gmail.com> wrote:

>
> Hi,
>
> I was trying use the recommended practice of having a creator as part of
> the untyped actors to have a compile time validation of the actor
> constructors.
> However running JUnits against such classes from *Eclipse *is giving me
> this error:
>
> java.lang.IllegalArgumentException: cannot use non-static local Creator to
> create actors; make it static (e.g. local to a static method) or top-level
>     at akka.actor.Props$.create(Props.scala:112)
>     at akka.actor.Props.create(Props.scala)
>
> This doesn't happen when using the command line javac (from Maven) or when
> using IntelliJ IDEA.
>
> Since there are many eclipse users in our group, I'd like to check if
> there is a way to work around this? Is this some sort of scala eclipse
> plugin issue?
>
> Also this seems to happen only when I use the Creator as an inline
> instance.
>
>
> This works:
> public static Props props( final String param1, final String param2) {
>         return Props.create( new MyActorCreator( param1, param2) );
>     }
>
> This fails in eclipse with the error above when running JUnits.
> public static Props props( final String param1, final String param2) {
>         return Props.create( new Creator<MyActor>() {
>                @Override
>         public MyActorcreate() throws Exception {
>             return new MyActor( param1, param2);
>         }
>     });
> }
>
> Any help would be appreciated.
>
> Cheers,
> B
>
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw
JOIN US. REGISTER TODAY! <http://www.scaladays.org/>
Scala <http://www.scaladays.org/>
Days <http://www.scaladays.org/>
June 16th-18th, <http://www.scaladays.org/>
Berlin <http://www.scaladays.org/>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to