Note that there are some explanatory texts on larger screens.

plurals
  1. POAkka TypedActor with abstract members from trait cause java.lang.AbstractMethodError
    text
    copied!<p>Given the following code:</p> <pre><code>import akka.actor._ object TraitTest { trait A { def something() } trait B extends A class C extends TypedActor with B { override def something() { println("Why am I not implemented?") } } def main(args: Array[String]) { val service = TypedActor.newInstance(classOf[B], classOf[C]) service.something() } } </code></pre> <p>When running the <code>main</code>, I get the following exception:</p> <pre><code>Exception in thread "main" java.lang.AbstractMethodError: TraitTest$B$$ProxiedByAWDelegation$$1322144340710.something()V at TraitTest$.main(TraitTest.scala:29) at TraitTest.main(TraitTest.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) </code></pre> <p>Now, google finally spat out <a href="https://www.assembla.com/spaces/akka/tickets/552-abstractmethoderror-when-invoking-method-not-in-interface-for-typedactor" rel="nofollow">this</a> link, however I don't understand how this 'works as designed'.</p> <p>Could anybody please shed some light on the issue?</p> <p>Thanks! </p> <p><strong>Edit</strong><br/> If I change my code as follows, I obviously do not get the error. However, this is of course not a solution, but more a temporary workaround.</p> <pre><code>trait B extends A { override def something() } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload