The method get(ActorSystem) is ambiguous for the type Tcp

java
eclipse

(Alex) #1

how fix this error in eclipse?
java 8, eclipse Version: 2018-09 (4.9.0)

public class Server extends AbstractActor {

	private ActorRef manager;

	public Server(ActorRef manager) {
		this.manager = manager;
	}

	public static Props props(ActorRef manager) {
		return Props.create(Server.class, manager);
	}

	@Override
	public void preStart() throws Exception {

		final ActorRef tcp = Tcp.get(context().system()).manager();
		tcp.tell(TcpMessage.bind(getSelf(), new InetSocketAddress("localhost", 0), 100), getSelf());
	}

	@Override
	public Receive createReceive() {
		// TODO Auto-generated method stub
		return null;
	}

}

(Patrik Nordwall) #2

This problem was unfortunately introduced in Akka 2.5.18 and mentioned in the release notes. We are sorry for that. We have worked with the Scala compiler team to find a solution and it looks like we can release the fix soon (perhaps next week?). Until then I’d recommend that you use Akka 2.5.17 if you are using Eclipse.