Re: [akka-user] Cant send and receive other messages than Strings between AKKA actors

2014-04-30 Thread Akka Team
Hi Matthias,


On Tue, Apr 29, 2014 at 8:38 PM, Matthias Heininger <
muenchn...@googlemail.com> wrote:

> Hi Endre,
>
> Thanks for your reply.
>
> The weird thing is the fact that a String works as message.
> Can you give me a hint where to look for the internationalization
> configuration or how to figure out what is wrong with it?
>

Unfortunately I don't know, since it is coming from Play. You should
probably ask on the Play mailing list.

-Endre


>
> You are totally right. It should go back to the sender..
>
> class ErrorHandlerActor extends Actor {
>
>   val log = Logging(context.system, this)
>
>   def receive: Receive = {
> case e:Error => handleError(e)
> case _ => handleError(Error("UNEXPECTED ERROR!"/*,new
> Exception("UNEXPECTED ERROR! The Error Handler received an unknown
> message!")*/))
>   }
>
>   def handleError(e:Error) = {
> log.error(e.message)
> sender ! BadRequest(Json.obj("status" ->"Error"))
>   }
> }
>
>
>
> On Tuesday, April 29, 2014 8:11:26 PM UTC+2, drewhk wrote:
>
>> Hi Matthias,
>>
>>
>> On Tue, Apr 29, 2014 at 7:47 PM, Matthias Heininger <
>> muenc...@googlemail.com> wrote:
>>
>>> If try to run my application which uses akka it shows me the following
>>> error:
>>>
>>>  play.api.i18n.Messages$MessagesParser$$anon$1: Configuration
>>> error[`=' expected but `
>>> ' found]
>>> at play.api.i18n.Messages$MessagesParser.parse(Messages.scala:219)
>>> ~[play_2.10-2.2.1.jar:2.2.1]
>>>
>>
>> Looking at the line above, this is somehow related to Play's
>> internationalization support, and seems to be something related to its
>> configuration. I don't think this error is related to Akka at all.
>>
>>
>>
>>> I built a case class with the purpose to send it as a Message to an
>>> Actor:
>>>
>>> package messages
>>>
>>> object ErrorHandlerMessages {
>>>   case class Error (message:String, exception:Exception)
>>> }
>>>
>>> When I run my application and try to send the message to my actor...:
>>>
>>> class ErrorHandlerActor extends Actor {
>>>
>>>   val log = Logging(context.system, this)
>>>
>>>   def receive: Receive = {
>>> case e:Error => handleError(e)
>>> case _ => handleError(Error("UNEXPECTED ERROR!",new
>>> Exception("UNEXPECTED ERROR! The Error Handler received an unknown
>>> message!")))
>>>   }
>>>
>>>   def handleError(e:Error):SimpleResult = {
>>> log.error(e.message,e.exception)
>>> BadRequest(Json.obj("status" ->"Error", "message" -> e.message))
>>>
>>
>> Where does this BadRequest instance go? The receive block does not return
>> anything and you call it from there... I suspect that you want to somehow
>> propagate this object to somewhere.
>>
>> -Endre
>>
>>
>>>   }
>>> }
>>>
>>> ... it throws the error you see above.
>>>
>>> When I change the code a bit so my actor receives a String it works well.
>>> Can somebody tell me what I am missing?
>>>
>>> Thanks in advance
>>>
>>> --
>>> >> 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+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> >> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>  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 

Re: [akka-user] Cant send and receive other messages than Strings between AKKA actors

2014-04-29 Thread Matthias Heininger
Hi Endre,

Thanks for your reply.

The weird thing is the fact that a String works as message. 
Can you give me a hint where to look for the internationalization 
configuration or how to figure out what is wrong with it?

You are totally right. It should go back to the sender..

class ErrorHandlerActor extends Actor {

  val log = Logging(context.system, this)

  def receive: Receive = {
case e:Error => handleError(e)
case _ => handleError(Error("UNEXPECTED ERROR!"/*,new 
Exception("UNEXPECTED ERROR! The Error Handler received an unknown 
message!")*/))
  }

  def handleError(e:Error) = {
log.error(e.message)
sender ! BadRequest(Json.obj("status" ->"Error"))
  }
}



On Tuesday, April 29, 2014 8:11:26 PM UTC+2, drewhk wrote:
>
> Hi Matthias,
>
>
> On Tue, Apr 29, 2014 at 7:47 PM, Matthias Heininger <
> muenc...@googlemail.com > wrote:
>
>> If try to run my application which uses akka it shows me the following 
>> error:
>>
>> play.api.i18n.Messages$MessagesParser$$anon$1: Configuration 
>> error[`=' expected but `
>> ' found]
>> at play.api.i18n.Messages$MessagesParser.parse(Messages.scala:219) 
>> ~[play_2.10-2.2.1.jar:2.2.1]
>>
>
> Looking at the line above, this is somehow related to Play's 
> internationalization support, and seems to be something related to its 
> configuration. I don't think this error is related to Akka at all.
>
>  
>
>> I built a case class with the purpose to send it as a Message to an Actor:
>>
>> package messages
>>
>> object ErrorHandlerMessages {
>>   case class Error (message:String, exception:Exception)
>> }
>>
>> When I run my application and try to send the message to my actor...:
>>
>> class ErrorHandlerActor extends Actor {
>>
>>   val log = Logging(context.system, this)
>>
>>   def receive: Receive = {
>> case e:Error => handleError(e)
>> case _ => handleError(Error("UNEXPECTED ERROR!",new 
>> Exception("UNEXPECTED ERROR! The Error Handler received an unknown 
>> message!")))
>>   }
>>
>>   def handleError(e:Error):SimpleResult = {
>> log.error(e.message,e.exception)
>> BadRequest(Json.obj("status" ->"Error", "message" -> e.message))
>>
>
> Where does this BadRequest instance go? The receive block does not return 
> anything and you call it from there... I suspect that you want to somehow 
> propagate this object to somewhere.
>
> -Endre
>  
>
>>   }
>> }
>>
>> ... it throws the error you see above.
>>
>> When I change the code a bit so my actor receives a String it works well.
>> Can somebody tell me what I am missing? 
>>
>> Thanks in advance
>>
>> -- 
>> >> 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+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [akka-user] Cant send and receive other messages than Strings between AKKA actors

2014-04-29 Thread Endre Varga
Hi Matthias,


On Tue, Apr 29, 2014 at 7:47 PM, Matthias Heininger <
muenchn...@googlemail.com> wrote:

> If try to run my application which uses akka it shows me the following
> error:
>
> play.api.i18n.Messages$MessagesParser$$anon$1: Configuration error[`='
> expected but `
> ' found]
> at play.api.i18n.Messages$MessagesParser.parse(Messages.scala:219)
> ~[play_2.10-2.2.1.jar:2.2.1]
>

Looking at the line above, this is somehow related to Play's
internationalization support, and seems to be something related to its
configuration. I don't think this error is related to Akka at all.



> I built a case class with the purpose to send it as a Message to an Actor:
>
> package messages
>
> object ErrorHandlerMessages {
>   case class Error (message:String, exception:Exception)
> }
>
> When I run my application and try to send the message to my actor...:
>
> class ErrorHandlerActor extends Actor {
>
>   val log = Logging(context.system, this)
>
>   def receive: Receive = {
> case e:Error => handleError(e)
> case _ => handleError(Error("UNEXPECTED ERROR!",new
> Exception("UNEXPECTED ERROR! The Error Handler received an unknown
> message!")))
>   }
>
>   def handleError(e:Error):SimpleResult = {
> log.error(e.message,e.exception)
> BadRequest(Json.obj("status" ->"Error", "message" -> e.message))
>

Where does this BadRequest instance go? The receive block does not return
anything and you call it from there... I suspect that you want to somehow
propagate this object to somewhere.

-Endre


>   }
> }
>
> ... it throws the error you see above.
>
> When I change the code a bit so my actor receives a String it works well.
> Can somebody tell me what I am missing?
>
> Thanks in advance
>
> --
> >> 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 http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

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


[akka-user] Cant send and receive other messages than Strings between AKKA actors

2014-04-29 Thread Matthias Heininger
If try to run my application which uses akka it shows me the following 
error:

play.api.i18n.Messages$MessagesParser$$anon$1: Configuration error[`=' 
expected but `
' found]
at play.api.i18n.Messages$MessagesParser.parse(Messages.scala:219) 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.api.i18n.MessagesPlugin$$anonfun$play$api$i18n$MessagesPlugin$$loadMessages$1.apply(Messages.scala:286)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.api.i18n.MessagesPlugin$$anonfun$play$api$i18n$MessagesPlugin$$loadMessages$1.apply(Messages.scala:285)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
 
~[scala-library.jar:na]
at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
 
~[scala-library.jar:na]
at scala.collection.immutable.List.foreach(List.scala:318) 
~[scala-library.jar:na]
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) 
~[scala-library.jar:na]
at scala.collection.AbstractTraversable.map(Traversable.scala:105) 
~[scala-library.jar:na]
at 
play.api.i18n.MessagesPlugin.play$api$i18n$MessagesPlugin$$loadMessages(Messages.scala:285)
 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.i18n.MessagesPlugin.messages$lzycompute(Messages.scala:296) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.i18n.MessagesPlugin.messages(Messages.scala:292) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.i18n.MessagesPlugin.onStart(Messages.scala:309) 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88) 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88) 
~[play_2.10-2.2.1.jar:2.2.1]
at scala.collection.immutable.List.foreach(List.scala:318) 
~[scala-library.jar:na]
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.Play$$anonfun$start$1.apply(Play.scala:88) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.Play$$anonfun$start$1.apply(Play.scala:88) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.utils.Threads$.withContextClassLoader(Threads.scala:18) 
~[play_2.10-2.2.1.jar:2.2.1]
at play.api.Play$.start(Play.scala:87) ~[play_2.10-2.2.1.jar:2.2.1]
at 
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:139)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:112)
 
~[play_2.10-2.2.1.jar:2.2.1]
at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
at 
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:112)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:110)
 
~[play_2.10-2.2.1.jar:2.2.1]
at scala.util.Success.flatMap(Try.scala:200) ~[scala-library.jar:na]
at 
play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:102)
 
~[play_2.10-2.2.1.jar:2.2.1]
at 
scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
 
~[scala-library.jar:na]
at 
scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) 
~[scala-library.jar:na]
at 
scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361)
 
~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
~[scala-library.jar:na]
at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 
~[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
~[scala-library.jar:na]
at 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
 
~[scala-library.jar:na]

I built a case class with the purpose to send it as a Message to an Actor:

package messages

object ErrorHandlerMessages {
  case class Error (message:String, exception:Exception)
}

When I run my application and try to send the message to my actor...:

class ErrorHandlerActor extends Actor {

  val log = Logging(context.system, this)

  def receive: Receive = {
case e:Error => handleError(e)
case _ => handleError(Error("UNEXPECTED ERROR!",new 
Exception("UNEXPECTED ERROR! The Error Handler received an unknown 
message!")))
  }

  def handleError(e:Error):SimpleResult = {
log.error(e.message,e.exception)
BadRequest(Json.obj("status" ->"Error", "message" -> e.message))
  }
}

... it throws the error you see above.

When I change the code a bit so my actor receives a String it works well.
Can somebody tell me what I am missing? 

Thanks in advance

-- 
>>  Read the docs: http://akka.io/docs/
>>  Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.htm