That was exactly the solution I found. Tnks ayway for pointing out!
Confirms I found the right solution. Still getting up to speed on Scala,
its a whole different world from C# and .NET...:)

Cheers,
Rod

On Tue, Sep 16, 2014 at 9:12 AM, Patrik Nordwall <[email protected]>
wrote:

> You can solve this by adding the needed default constructor in
> StateCategory:
>
> sealed abstract class StateCategory(val color: Color, val light: Color) {
>   // needed for serialization
>   def this() = this(Color.BLACK, Color.BLACK)
> }
>
> Cheers,
> Patrik
>
> On Mon, Sep 15, 2014 at 3:00 PM, √iktor Ҡlang <[email protected]>
> wrote:
>
>> Tried making StateCategory extends Serializable?
>>
>> On Mon, Sep 15, 2014 at 2:43 PM, Rodrigo Boavida <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> I had similiar problem with case classes which also derive from an
>>> abstract one. Did you get around it?
>>>
>>> tnks.
>>> Rod
>>>
>>> On Tuesday, December 11, 2012 10:58:33 AM UTC, rkuhn wrote:
>>>>
>>>> Hi,
>>>>
>>>> case objects are still objects (i.e. not static), so they will be
>>>> serialized. Are you sure that java.awt.Color is serializable? If not you
>>>> should register your own serializer for StateCategory or implement
>>>> writeReplace (e.g. something wrapping a string).
>>>>
>>>> Regards,
>>>>
>>>> Roland
>>>>
>>>> 11 dec 2012 kl. 11:00 skrev wookietreiber:
>>>>
>>>> Hello,
>>>>
>>>> I have the following case objects:
>>>>
>>>>   package ckit
>>>>
>>>>   import java.awt.Color
>>>>
>>>>   sealed abstract class StateCategory(val color: Color, val light:
>>>> Color)
>>>>
>>>>   case object Deleted   extends StateCategory(Color.ORANGE, new
>>>> Color(255, 225, 140))
>>>>   case object Error     extends StateCategory(Color.RED,    new
>>>> Color(255, 200, 200))
>>>>   case object Pending   extends StateCategory(Color.BLUE,   new
>>>> Color(200, 200, 255))
>>>>   case object Running   extends StateCategory(Color.GREEN,  new
>>>> Color(200, 255, 200))
>>>>   case object Suspended extends StateCategory(Color.YELLOW, new
>>>> Color(255, 255, 200))
>>>>   case object Unknown   extends StateCategory(Color.GRAY,   new
>>>> Color(200, 200, 200))
>>>>
>>>> I want to send these as parts of other messages with akka, but I get
>>>> InvalidClassException (IP addresses omitted):
>>>>
>>>> [ERROR] [12/11/2012 10:15:18.856] [ckit-4] [NettyRemoteTransport(
>>>> akka://ckit@...:2552)] RemoteClientError@akka://ckit@...:2552: Error[
>>>> java.io.InvalidClassException: ckit.Running$; no valid constructor
>>>>         at java.io.ObjectStreamClass$ExceptionInfo.
>>>> newInvalidClassException(ObjectStreamClass.java:147)
>>>>         at java.io.ObjectStreamClass.checkDeserialize(
>>>> ObjectStreamClass.java:755)
>>>>         at java.io.ObjectInputStream.readOrdinaryObject(
>>>> ObjectInputStream.java:1751)
>>>>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.
>>>> java:1347)
>>>>         at java.io.ObjectInputStream.defaultReadFields(
>>>> ObjectInputStream.java:1964)
>>>>         at java.io.ObjectInputStream.readSerialData(
>>>> ObjectInputStream.java:1888)
>>>>         at java.io.ObjectInputStream.readOrdinaryObject(
>>>> ObjectInputStream.java:1771)
>>>>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.
>>>> java:1347)
>>>>         at java.io.ObjectInputStream.defaultReadFields(
>>>> ObjectInputStream.java:1964)
>>>>         at java.io.ObjectInputStream.readSerialData(
>>>> ObjectInputStream.java:1888)
>>>>         at java.io.ObjectInputStream.readOrdinaryObject(
>>>> ObjectInputStream.java:1771)
>>>>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.
>>>> java:1347)
>>>>         at java.io.ObjectInputStream.readObject(ObjectInputStream.
>>>> java:369)
>>>>         at scala.collection.immutable.$colon$colon.readObject(List.
>>>> scala:361)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>>>> NativeMethodAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>>> DelegatingMethodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>>>         at java.io.ObjectStreamClass.invokeReadObject(
>>>> ObjectStreamClass.java:1004)
>>>>         at java.io.ObjectInputStream.readSerialData(
>>>> ObjectInputStream.java:1866)
>>>>         at java.io.ObjectInputStream.readOrdinaryObject(
>>>> ObjectInputStream.java:1771)
>>>>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.
>>>> java:1347)
>>>>         at java.io.ObjectInputStream.defaultReadFields(
>>>> ObjectInputStream.java:1964)
>>>>         at java.io.ObjectInputStream.readSerialData(
>>>> ObjectInputStream.java:1888)
>>>>         at java.io.ObjectInputStream.readOrdinaryObject(
>>>> ObjectInputStream.java:1771)
>>>>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.
>>>> java:1347)
>>>>         at java.io.ObjectInputStream.readObject(ObjectInputStream.
>>>> java:369)
>>>>         at akka.serialization.JavaSerializer$$anonfun$1.
>>>> apply(Serializer.scala:120)
>>>>         at scala.util.DynamicVariable.withValue(DynamicVariable.
>>>> scala:57)
>>>>         at akka.serialization.JavaSerializer.fromBinary(
>>>> Serializer.scala:120)
>>>>         at akka.serialization.Serialization$$anonfun$
>>>> deserialize$1.apply(Serialization.scala:67)
>>>>         at scala.util.Try$.apply(Try.scala:161)
>>>>         at akka.serialization.Serialization.deserialize(
>>>> Serialization.scala:67)
>>>>         at akka.remote.MessageSerializer$.deserialize(
>>>> MessageSerializer.scala:23)
>>>>         at akka.remote.RemoteMessage.payload$lzycompute(
>>>> RemoteTransport.scala:338)
>>>>         at akka.remote.RemoteMessage.payload(RemoteTransport.scala:338)
>>>>         at akka.remote.RemoteTransport.receiveMessage(
>>>> RemoteTransport.scala:284)
>>>>         at akka.remote.netty.ActiveRemoteClientHandler.
>>>> messageReceived(Client.scala:270)
>>>>         at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(
>>>> SimpleChannelHandler.java:95)
>>>>         at org.jboss.netty.handler.timeout.
>>>> IdleStateAwareChannelHandler.handleUpstream(
>>>> IdleStateAwareChannelHandler.java:43)
>>>>         at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(
>>>> DefaultChannelPipeline.java:565)
>>>>         at org.jboss.netty.channel.DefaultChannelPipeline$
>>>> DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:
>>>> 793)
>>>>         at org.jboss.netty.handler.execution.
>>>> ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.
>>>> java:45)
>>>>         at org.jboss.netty.handler.execution.ChannelEventRunnable.run(
>>>> ChannelEventRunnable.java:69)
>>>>         at org.jboss.netty.handler.execution.
>>>> OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(
>>>> OrderedMemoryAwareThreadPoolExecutor.java:315)
>>>>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>>>> ThreadPoolExecutor.java:1110)
>>>>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>>> ThreadPoolExecutor.java:603)
>>>>         at java.lang.Thread.run(Thread.java:722)
>>>>
>>>> What can I do to fix this? Is this akka-serialization related or is
>>>> this a general problem of case objects?
>>>>
>>>>
>>>> Best Regards
>>>>
>>>> --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>> >>>>>>>>>> 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 post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to akka-user+...@
>>>> googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/akka-user?hl=en.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *Dr. Roland Kuhn*
>>>> *Akka Tech Lead*
>>>> Typesafe <http://typesafe.com/> – The software stack for applications
>>>> that scale.
>>>> twitter: @rolandkuhn <http://twitter.com/#!/rolandkuhn>
>>>>
>>>>  --
>>> >>>>>>>>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Cheers,
>> √
>>
>> --
>> >>>>>>>>>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/3Q_qid0NnjU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to