diff --git a/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala index 185f0d2799..d168361bd4 100644 --- a/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala @@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap import java.io.{PrintWriter, PrintStream} trait RemoteModule { - val UUID_PREFIX = "uuid:" + val UUID_PREFIX = "uuid:".intern def optimizeLocalScoped_?(): Boolean //Apply optimizations for remote operations in local scope protected[akka] def notifyListeners(message: => Any): Unit @@ -84,7 +84,6 @@ case class RemoteClientWriteFailed( @BeanProperty client: RemoteClientModule, @BeanProperty remoteAddress: InetSocketAddress) extends RemoteClientLifeCycleEvent - /** * Life-cycle events for RemoteServer. */ @@ -120,7 +119,12 @@ class RemoteClientException private[akka] ( val remoteAddress: InetSocketAddress) extends AkkaException(message) /** - * Returned when a remote exception sent over the wire cannot be loaded and instantiated + * Thrown when the remote server actor dispatching fails for some reason. + */ +class RemoteServerException private[akka] (message: String) extends AkkaException(message) + +/** + * Thrown when a remote exception sent over the wire cannot be loaded and instantiated */ case class CannotInstantiateRemoteExceptionDueToRemoteProtocolParsingErrorException private[akka] (cause: Throwable, originalClassName: String, originalMessage: String) extends AkkaException("\nParsingError[%s]\nOriginalException[%s]\nOriginalMessage[%s]" diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index dd7a22df52..d9ded4b0e2 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -1049,7 +1049,7 @@ class RemoteServerHandler( throw firstException targetMethod - } + } try { val messageReceiver = resolveMethod(typedActor.getClass, ownerTypeHint, typedActorInfo.getMethod, argClasses) @@ -1230,7 +1230,14 @@ class RemoteServerHandler( server.findTypedActorByIdOrUuid(actorInfo.getId, parseUuid(uuid).toString) match { case null => // the actor has not been registered globally. See if we have it in the session createTypedSessionActor(actorInfo, channel) match { - case null => createClientManagedTypedActor(actorInfo) //Maybe client managed actor? + case null => + // FIXME this is broken, if a user tries to get a server-managed typed actor and that is not registered then a client-managed typed actor is created, but just throwing an exception here causes client-managed typed actors to fail + +/* val e = new RemoteServerException("Can't load remote Typed Actor for [" + actorInfo.getId + "]") + EventHandler.error(e, this, e.getMessage) + server.notifyListeners(RemoteServerError(e, server)) + throw e +*/ createClientManagedTypedActor(actorInfo) // client-managed actor case sessionActor => sessionActor } case typedActor => typedActor