Overridden method does not throw exception

127 views
Skip to first unread message

Ankush Thakur

unread,
Dec 10, 2016, 3:40:54 AM12/10/16
to play-fr...@googlegroups.com
I have run into a number of problems when trying to schedule periodic tasks with Play Framework (2.5.10) actors. In this email I describe the first one. I defined an actor like this in my application:

package services.ecwid.db;

import akka.actor.UntypedActor;

public class UserImportActor extends UntypedActor {
public static final String ACTOR_NAME = "user_import_actor";

@Override
public void onReceive(Object message) throws Exception{
}
}

I'm using the IntelliJ IDE, and it tells me that there's an error in the onReceive() method: 'onReceive(Object)' in 'services.ecwid.db.UserImportActor' clashes with 'onReceive(Object)' in 'akka.actor.UntypedActor'; overridden method does not throw 'java.lang.Exception'.

I have no clue what's going on! Please help.

Regards,
Ankush Thakur

Igmar Palsenberg

unread,
Dec 12, 2016, 11:18:05 AM12/12/16
to Play Framework
 
package services.ecwid.db;

import akka.actor.UntypedActor;

public class UserImportActor extends UntypedActor {
public static final String ACTOR_NAME = "user_import_actor";

@Override
public void onReceive(Object message) throws Exception{
}
}

I'm using the IntelliJ IDE, and it tells me that there's an error in the onReceive() method: 'onReceive(Object)' in 'services.ecwid.db.UserImportActor' clashes with 'onReceive(Object)' in 'akka.actor.UntypedActor'; overridden method does not throw 'java.lang.Exception'.

Try just compiling it : 

activator compile

If that works, it's an IntelliJ issue. I've seen the code completion being wrong on multiple occasions.


Igmar 
Reply all
Reply to author
Forward
0 new messages