• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can enum define its serialVersionUID or it has by default?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I heard that there is by default 0 present as serialVersionUID for enum, but i am facing following problem in one of my RelType enum class

java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:
org.omg.CORBA.MARSHAL:
>> SERVER (id=4773e3aa, host=coimbatore.clr1968.mws.sutelab.blr) TRACE START:
>> org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (RepId RMI:com.nsn.oss.avg.avgxml.jaxb.RelType:22A6F48BE34B9767:FF87BD7BCD053D20) = FF87BD7BCD053D20 whereas Target (RepId RMI:com.nsn.oss.avg.avgxml.jaxb.RelType:22A6F48BE34B9767:762F93289AA86CDE) = 762F93289AA86CDE vmcid: IBM minor code: 89A completed: No
>> at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:2194)

in my webspehere server, i see different uids in client and server.

1. whats this problem?
2. how to resolve it?
3. can i manually add serialVersionUID=xxx to my enum?

please help in this regard

thanks
ramesh
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to javaranch Ramesh. You seem to have selected the wrong forum. This probably belongs in Java in general. A moderator will move it there shortly.

The serial version UID is not assigned to 0 by default. It is dynamically assigned each time. Have your tried assigning an ID for the enum ? Did it work ? Even if you do assign an ID, the problem seems to be with serializing and deserializing classes that were compiled with different javac versions. Can you elaborate about your problem a little more ?
 
Ramesh Babu K M
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi thank you so much,

My problem is, i have a xsd file which i will use to generate java classes from them using jaxb. In which there are some enum classes. all are serialized classes and have serialVersionUID assigned. but enums doesn't have these UIDs. and when i try to pass these objects from client to server i am getting the above error.
so whats the call?
can i assign manually one UID for enums also?

thanks in advance
Ramesh
reply
    Bookmark Topic Watch Topic
  • New Topic