Re: enum serialization

2016-03-08 Thread Gilberto
When I used GWT-RPC (nowadays I use REST) I solved the problem simply by 
not using inner enums. Another way is to overwrite the server code that 
handles the serialization policy to skip the check of your enums.

On Saturday, March 5, 2016 at 7:38:34 PM UTC-3, vikash joshi wrote:
>
> Even i am facing the same issue with GWT 2.6
>
> I have a class in shared package that implements Serializable but it has 
> inner Enums which also has a default constructor and which implements 
> Serializable interface but still i get Serializable Exception when i try to 
> use the Parent class during RPC call.
>
> On Tuesday, 10 August 2010 15:22:23 UTC+5:30, Rodrigo wrote:
>>
>> I'm running into the same problem... 
>>
>> I have an inner enum inside a class in the shared package (which is 
>> accessible to the client). 
>>
>> I tried making the enum implement IsSerializable, Serializable, adding 
>> a default constructor, to no avail... 
>>
>> BTW, my code works in development mode, presumably because it actually 
>> runs from the java code instead of from javascript (right?). But in 
>> production mode, it fails. It actually fails silently, which made it 
>> even harder to diagnose this problem, but that's a different story... 
>>
>> Any ideas? 
>>
>> On Jul 28, 10:39 am, Raphaël Brugier  
>> wrote: 
>> > The serialization of innerenumworks for me, 
>> > 
>> > Be sure to have a default constructor in yourenum. 
>> > Maybe also non-final fields. 
>> > 
>> > Does your class is on a serializable package, usually the client or 
>> > shared ? 
>> > 
>> > On 28 juil, 06:35, Mike Heath  wrote: 
>> > 
>> > 
>> > 
>> > > Allenumextend java.lang.Enumwhich implements java.io.Serializable so 
>> > > explicitly implementing Serializable shouldn't make a difference. 
>> > 
>> > > On Tue, Jul 27, 2010 at 9:15 AM, Prashant  
>> wrote: 
>> > > > try 
>> > 
>> > > > publicenumStatus *implements **java.io.**Serializable* { 
>> > > >  ACTIVE, INACTIVE, NA 
>> > > > } 
>> > 
>> > > > -- 
>> > > > Prashant 
>> > > >www.claymus.com 
>> > 
>> > > >  -- 
>> > > > You received this message because you are subscribed to the Google 
>> Groups 
>> > > > "Google Web Toolkit" group. 
>> > > > To post to this group, send email to google-we...@googlegroups.com. 
>>
>> > > > To unsubscribe from this group, send email to 
>> > > > google-web-toolkit+unsubscr...@googlegroups.com> > > >  
>> cr...@googlegroups.com> 
>> > > > . 
>> > > > For more options, visit this group at 
>> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: enum serialization

2016-03-05 Thread vikash joshi
Even i am facing the same issue with GWT 2.6

I have a class in shared package that implements Serializable but it has 
inner Enums which also has a default constructor and which implements 
Serializable interface but still i get Serializable Exception when i try to 
use the Parent class during RPC call.

On Tuesday, 10 August 2010 15:22:23 UTC+5:30, Rodrigo wrote:
>
> I'm running into the same problem... 
>
> I have an inner enum inside a class in the shared package (which is 
> accessible to the client). 
>
> I tried making the enum implement IsSerializable, Serializable, adding 
> a default constructor, to no avail... 
>
> BTW, my code works in development mode, presumably because it actually 
> runs from the java code instead of from javascript (right?). But in 
> production mode, it fails. It actually fails silently, which made it 
> even harder to diagnose this problem, but that's a different story... 
>
> Any ideas? 
>
> On Jul 28, 10:39 am, Raphaël Brugier  
> wrote: 
> > The serialization of innerenumworks for me, 
> > 
> > Be sure to have a default constructor in yourenum. 
> > Maybe also non-final fields. 
> > 
> > Does your class is on a serializable package, usually the client or 
> > shared ? 
> > 
> > On 28 juil, 06:35, Mike Heath  wrote: 
> > 
> > 
> > 
> > > Allenumextend java.lang.Enumwhich implements java.io.Serializable so 
> > > explicitly implementing Serializable shouldn't make a difference. 
> > 
> > > On Tue, Jul 27, 2010 at 9:15 AM, Prashant  
> wrote: 
> > > > try 
> > 
> > > > publicenumStatus *implements **java.io.**Serializable* { 
> > > >  ACTIVE, INACTIVE, NA 
> > > > } 
> > 
> > > > -- 
> > > > Prashant 
> > > >www.claymus.com 
> > 
> > > >  -- 
> > > > You received this message because you are subscribed to the Google 
> Groups 
> > > > "Google Web Toolkit" group. 
> > > > To post to this group, send email to google-we...@googlegroups.com 
> . 
> > > > To unsubscribe from this group, send email to 
> > > > google-web-toolkit+unsubscr...@googlegroups.com 
> > > >  cr...@googlegroups.com > 
> > > > . 
> > > > For more options, visit this group at 
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


enum Serialization problem

2010-10-07 Thread javest
Hi

I have enum in my class which is passed through RPC. when I am looking
into the .gwt.rpc and rpc.log files my enum is there, seems
Serialization is ok. Till now my application is working fine (actually
that enum is not used on the client's side, only on the server layer),
but recently I noticed couple of exceptions in the logs :
Type 'package.MyClassName$MyEnumName' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
custom field serializer.  For security purposes, this type will not be
serialized.

I don't know why it wasn't a problem before, and I don't even know
when on runtime this exception accrued. But it seems very weird to me.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: enum serialization

2010-08-10 Thread Rodrigo
I'm running into the same problem...

I have an inner enum inside a class in the shared package (which is
accessible to the client).

I tried making the enum implement IsSerializable, Serializable, adding
a default constructor, to no avail...

BTW, my code works in development mode, presumably because it actually
runs from the java code instead of from javascript (right?). But in
production mode, it fails. It actually fails silently, which made it
even harder to diagnose this problem, but that's a different story...

Any ideas?

On Jul 28, 10:39 am, Raphaël Brugier 
wrote:
> The serialization of innerenumworks for me,
>
> Be sure to have a default constructor in yourenum.
> Maybe also non-final fields.
>
> Does your class is on a serializable package, usually the client or
> shared ?
>
> On 28 juil, 06:35, Mike Heath  wrote:
>
>
>
> > Allenumextend java.lang.Enumwhich implements java.io.Serializable so
> > explicitly implementing Serializable shouldn't make a difference.
>
> > On Tue, Jul 27, 2010 at 9:15 AM, Prashant  wrote:
> > > try
>
> > > publicenumStatus *implements **java.io.**Serializable* {
> > >  ACTIVE, INACTIVE, NA
> > > }
>
> > > --
> > > Prashant
> > >www.claymus.com
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Web Toolkit" group.
> > > To post to this group, send email to google-web-tool...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-web-toolkit+unsubscr...@googlegroups.com > >  cr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: enum serialization

2010-07-28 Thread Raphaël Brugier
The serialization of inner enum works for me,

Be sure to have a default constructor in your enum.
Maybe also non-final fields.

Does your class is on a serializable package, usually the client or
shared ?

On 28 juil, 06:35, Mike Heath  wrote:
> All enum extend java.lang.Enum which implements java.io.Serializable so
> explicitly implementing Serializable shouldn't make a difference.
>
>
>
> On Tue, Jul 27, 2010 at 9:15 AM, Prashant  wrote:
> > try
>
> > public enum Status *implements **java.io.**Serializable* {
> >  ACTIVE, INACTIVE, NA
> > }
>
> > --
> > Prashant
> >www.claymus.com
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-tool...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: enum serialization

2010-07-28 Thread Mike Heath
All enum extend java.lang.Enum which implements java.io.Serializable so
explicitly implementing Serializable shouldn't make a difference.

On Tue, Jul 27, 2010 at 9:15 AM, Prashant  wrote:

> try
>
> public enum Status *implements **java.io.**Serializable* {
>  ACTIVE, INACTIVE, NA
> }
>
> --
> Prashant
> www.claymus.com
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: enum serialization

2010-07-27 Thread Prashant
try

public enum Status *implements **java.io.**Serializable* {
 ACTIVE, INACTIVE, NA
}

-- 
Prashant
www.claymus.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



enum serialization

2010-07-27 Thread mbstiburon
I have classes with inner enums such as
public class Foo implements java.io.Serializable {
  public enum Status {
ACTIVE, INACTIVE, NA
  }

  private Status status;
  public Foo() {}

  public Status getStatus(){
return this.status;
  }
  
}

When I compile (gwtc), it does not complain; however, I get the
following exception during runtime.

Caused by: com.google.gwt.user.client.rpc.SerializationException: Type
'com.mycompany.gwt.Foo$Status' was not included in the set of types
which can be serialized by this SerializationPolicy or its Class
object could not be loaded. For security purposes, this type will not
be serialized.: instance = ACTIVE
...

Any idea?
Does gwt not able to serialize enums defined as an inner class? Do I
have to create top level enum classes?

BTW, I am using GWT 2.0.3 on OS X.

Any help on this would be greatly appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.