Then you must avoid sending ClassPathXmlApplicationContext. It's not
serializable, and should not be, so you can't send it.

On Wed, Aug 24, 2016 at 10:08 AM, vipin mandloi <vipinmandl...@gmail.com>
wrote:

> Hello,
>
>
> Thanks a lot for the response.
>
> *Enabled remote debugging , Error - "Failed to write message to Transport
> " is  occurring due to Spring Class (ClassPathXmlApplicationContext)
> serialization failure. *
>
> Please let me know whether *Akka Cluster Remote Routess  usages support
> spring configuration ?*
>
>  if yes then how can i fix *Spring Class (ClassPathXmlApplicationContext)
> serialization failure ? *
>
>
> *Logged error message:-*
>
>
> *[ERROR] [08/24/2016 03:03:13.934]
> [ClusterSystem-akka.remote.default-remote-dispatcher-23]
> [akka.tcp://ClusterSystem*
>
>
> *@localhost:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40localhost%3A2552-0/en*
>
> *dpointWriter] AssociationError [akka.tcp://ClusterSystem@localhost:2551]
> -> [akka.tcp://ClusterSystem@localhost:2552*
>
> *]: Error [Failed to write message to the transport] [*
>
> *akka.remote.EndpointException: Failed to write message to the transport*
>
> *Caused by: java.lang.IllegalArgumentException: Can't serialize object of
> type class org.springframework.context.supp*
>
> *ort.ClassPathXmlApplicationContext*
>
>         at akka.cluster.protobuf.ClusterMessageSerializer.toBinary(
> ClusterMessageSerializer.scala:74)
>
>         at akka.serialization.Serialization$$anonfun$serialize$1.apply(
> Serialization.scala:90)
>
>         at akka.serialization.Serialization$$anonfun$serialize$1.apply(
> Serialization.scala:90)
>
>         at scala.util.Try$.apply(Try.scala:161)
>
>         at akka.serialization.Serialization.serialize(
> Serialization.scala:90)
>
>         at akka.remote.serialization.DaemonMsgCreateSerializer.serialize(
> DaemonMsgCreateSerializer.scala:107)
>
>         at akka.remote.serialization.DaemonMsgCreateSerializer$$
> anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ
>
> er.scala:56)
>
>         at akka.remote.serialization.DaemonMsgCreateSerializer$$
> anonfun$propsProto$1$1.apply(DaemonMsgCreateSerializ
>
> er.scala:56)
>
>         at scala.collection.TraversableLike$$anonfun$map$
> 1.apply(TraversableLike.scala:244)
>
>         at scala.collection.TraversableLike$$anonfun$map$
> 1.apply(TraversableLike.scala:244)
>
>         at scala.collection.immutable.List.foreach(List.scala:318)
>
>         at scala.collection.TraversableLike$class.map(
> TraversableLike.scala:244)
>
>         at scala.collection.AbstractTraversable.map(Traversable.scala:105)
>
>         at akka.remote.serialization.DaemonMsgCreateSerializer.
> propsProto$1(DaemonMsgCreateSerializer.scala:56)
>
>         at akka.remote.serialization.DaemonMsgCreateSerializer.toBinary(
> DaemonMsgCreateSerializer.scala:62)
>
>         at akka.remote.MessageSerializer$.serialize(MessageSerializer.
> scala:36)
>
>         at akka.remote.EndpointWriter$$anonfun$serializeMessage$1.
> apply(Endpoint.scala:842)
>
>         at akka.remote.EndpointWriter$$anonfun$serializeMessage$1.
> apply(Endpoint.scala:842)
>
>         at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
>
>         at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:841)
>
>         at akka.remote.EndpointWriter.writeSend(Endpoint.scala:742)
>
>         at akka.remote.EndpointWriter$$anonfun$2.applyOrElse(
> Endpoint.scala:717)
>
>         at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
>
>         at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:410)
>
>         at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
>
>         at akka.actor.ActorCell.invoke(ActorCell.scala:487)
>
>         at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
>
>         at akka.dispatch.Mailbox.run(Mailbox.scala:221)
>
>         at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
>
>         at scala.concurrent.forkjoin.ForkJoinTask.doExec(
> ForkJoinTask.java:260)
>
>         at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.
> pollAndExecAll(ForkJoinPool.java:1253)
>
>         at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.
> runTask(ForkJoinPool.java:1346)
>
>         at scala.concurrent.forkjoin.ForkJoinPool.runWorker(
> ForkJoinPool.java:1979)
>
>         at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
> ForkJoinWorkerThread.java:107)
>
>
>
> Thanks,
> Vipin Mandloi
>
> On Tuesday, August 23, 2016 at 11:33:43 PM UTC+5:30, Patrik Nordwall wrote:
>>
>> I would suggest that you turn on remote debug logging and hopefully find
>> the root cause of the "Failed to write message to the transport":
>> http://doc.akka.io/docs/akka/2.4/java/logging.ht
>> ml#Auxiliary_remote_logging_options
>>
>> /Patrik
>>
>> On Tue, Aug 23, 2016 at 5:27 PM, Rob Crawford <rob...@gmail.com> wrote:
>>
>>> Trying to pass around an entire Spring context is a bad idea. It
>>> contains MANY objects -- you're serializing your entire application.
>>>
>>> Focus on serializing the state -- changeable data -- of your actor, and
>>> let Spring wire up the dependencies on the other node.
>>>
>>>
>>> On Tuesday, August 23, 2016 at 10:19:35 AM UTC-4, vipin mandloi wrote:
>>>>
>>>> Hello,
>>>>
>>>> Thanks for your quick response.
>>>>
>>>>
>>>> As soon i add 3rd node, i am getting this* unreachable/reachable
>>>> message . and cluster is getting deformed*. till 2 nodes there is no
>>>> issue.
>>>>
>>>> One more things added *serialize-creators = on and serialize-messages
>>>> = **on* to verify serialization for props and message. although i have
>>>> added serialize for *ClassPathXmlApplicationContext (refer 1st email
>>>> application.conf) getting serialization error*
>>>>
>>>>
>>>> *Error:-*
>>>>
>>>> ERROR] [08/23/2016 07:02:10.705] 
>>>> [ClusterSystem-akka.actor.default-dispatcher-5]
>>>> [akka://ClusterSystem/user/singleton] pre-creation serialization check
>>>> failed at [akka://ClusterSystem/user/singleton/ConsumerActor]
>>>>
>>>> java.lang.IllegalArgumentException: pre-creation serialization check
>>>> failed at [akka://ClusterSystem/user/singleton/ConsumerActor]
>>>>
>>>>                at akka.actor.dungeon.Children$cl
>>>> ass.makeChild(Children.scala:193)
>>>>
>>>>                at akka.actor.dungeon.Children$cl
>>>> ass.actorOf(Children.scala:37)
>>>>
>>>>                at akka.actor.ActorCell.actorOf(ActorCell.scala:369)
>>>>
>>>>                at akka.contrib.pattern.ClusterSi
>>>> ngletonManager.gotoOldest(ClusterSingletonManager.scala:516)
>>>>
>>>>                at akka.contrib.pattern.ClusterSi
>>>> ngletonManager$$anonfun$6.applyOrElse(ClusterSingletonMa
>>>> nager.scala:428)
>>>>
>>>>                at akka.contrib.pattern.ClusterSi
>>>> ngletonManager$$anonfun$6.applyOrElse(ClusterSingletonMa
>>>> nager.scala:417)
>>>>
>>>>                at scala.runtime.AbstractPartialF
>>>> unction.apply(AbstractPartialFunction.scala:33)
>>>>
>>>>                at akka.actor.FSM$class.processEvent(FSM.scala:604)
>>>>
>>>>                at akka.contrib.pattern.ClusterSi
>>>> ngletonManager.processEvent(ClusterSingletonManager.scala:336)
>>>>
>>>>                at akka.actor.FSM$class.akka$acto
>>>> r$FSM$$processMsg(FSM.scala:598)
>>>>
>>>>                at akka.actor.FSM$$anonfun$receiv
>>>> e$1.applyOrElse(FSM.scala:592)
>>>>
>>>>                at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
>>>>
>>>>                at akka.contrib.pattern.ClusterSi
>>>> ngletonManager.aroundReceive(ClusterSingletonManager.scala:336)
>>>>
>>>>                at akka.actor.ActorCell.receiveMe
>>>> ssage(ActorCell.scala:516)
>>>>
>>>>                at akka.actor.ActorCell.invoke(ActorCell.scala:487)
>>>>
>>>>                at akka.dispatch.Mailbox.processM
>>>> ailbox(Mailbox.scala:254)
>>>>
>>>>                at akka.dispatch.Mailbox.run(Mailbox.scala:221)
>>>>
>>>>                at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
>>>>
>>>>                at scala.concurrent.forkjoin.Fork
>>>> JoinTask.doExec(ForkJoinTask.java:260)
>>>>
>>>>                at scala.concurrent.forkjoin.Fork
>>>> JoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
>>>>
>>>>                at scala.concurrent.forkjoin.Fork
>>>> JoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
>>>>
>>>>                at scala.concurrent.forkjoin.Fork
>>>> JoinPool.runWorker(ForkJoinPool.java:1979)
>>>>
>>>>                at scala.concurrent.forkjoin.Fork
>>>> JoinWorkerThread.run(ForkJoinWorkerThread.java:107)
>>>>
>>>> *Caused by: java.lang.IllegalArgumentException: Can't serialize object
>>>> of type class org.springframework.context.su
>>>> <http://org.springframework.context.su>pport.ClassPathXmlApplicationContext*
>>>>
>>>>                at akka.cluster.protobuf.ClusterM
>>>> essageSerializer.toBinary(ClusterMessageSerializer.scala:74)
>>>>
>>>>                at akka.serialization.Serializati
>>>> on$$anonfun$serialize$1.apply(Serialization.scala:90)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Monday, August 22, 2016 at 10:22:49 PM UTC+5:30, Justin du coeur
>>>> wrote:
>>>>>
>>>>> On Mon, Aug 22, 2016 at 11:09 AM, vipin mandloi <vipinm...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Please let me know if i am missing any configuration.
>>>>>>
>>>>>
>>>>> It's not a matter of *missing* -- the problem is that this:
>>>>>
>>>>>
>>>>>> *My application.conf is configured as below-*
>>>>>>
>>>>>>
>>>>>>   cluster {
>>>>>>     auto-down-unreachable-after = 10s
>>>>>>   }
>>>>>>
>>>>>
>>>>> Should never, ever, *ever* be used except for initial testing.
>>>>> Auto-down is intended just as a way to get you started, but it's very
>>>>> primitive and dumb, and must *never* be used in production.  Auto-downing
>>>>> is always likely to cause cluster disasters, and having such a short
>>>>> auto-down timeout essentially guarantees it.
>>>>>
>>>>> Basically, you're getting split-brain -- you need to replace auto-down
>>>>> with a more-sophisticated downing strategy.  See this section of the
>>>>> documentation
>>>>> <http://doc.akka.io/docs/akka/2.4.9-RC2/scala/cluster-usage.html#automatic-vs-manual-downing-scala>
>>>>> for more information.
>>>>>
>>>> --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>>> urrent/additional/faq.html
>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou
>>> p/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+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Patrik Nordwall
>> Akka Tech Lead
>> Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
>> Twitter: @patriknw
>>
>> --
> >>>>>>>>>> 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 https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to