Uncommented Bytes

Wednesday, July 30, 2008

Enum Serialization with Weblogic EJB Client

I was trying to setup an ejb client to connect to an ejb running on a Weblogic 9 app server. I could connect fine, but kept getting a Mismatched serialization uids error on a Java 5 Enum class. After some digging I found
a fix on JavaRanch. For whatever reason using the wlclient.jar will not work when serializing enums, but using the full blown weblogic.jar is fine. I'm going to ignore the details on this one and just move along, but maybe someone else understands the problem/workaround/fix better?

6 Comments:

  • Wlclient.jar uses IIOP. An since the RMI-IIOP specification doesn't say anything about Java enums. You'll run into problems using it.

    The weblogic.jar uses T3 which has no problems.

    I usually just store the ordinal of the enum when parsing stuff around

    By Blogger Kasper, at 31 July, 2008 05:40  

  • Interesting. So is there any way to force wlclient.jar to use T3? Otherwise I have to package the entire 50MB weblogic.jar with my small little client app.

    By Blogger Jeff Sheets, at 31 July, 2008 09:48  

  • I too have the same issue, therefore any fix would certainly be appreciated.

    I will post if I find anything other than this:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6277781

    There are some suggested work around that I have not yet tried.

    By Blogger jimby, at 07 August, 2008 19:42  

  • This comment has been removed by the author.

    By Blogger jimby, at 07 August, 2008 19:44  

  • Nice find on the Sun bug. Let me know if you figure anything out!

    By Blogger Jeff Sheets, at 07 August, 2008 20:32  

  • We had a similar issue with Collections over RMI and got round it by wrapping them inside another object.

    Seems strange but it worked. Eg.
    Instead of someMethod(Collection col )...

    someMethod( MyObject obj )

    Where object contains the Collection.

    I'n my communication with BEA they admit it to be an issue they have to fix for and pass the buck to Sun (technically theyre issue) but they surely could implimenent a workaround.

    I'm working trhough work arounds in bug thread, let you know how that goes.

    By Blogger jimby, at 15 August, 2008 18:56  

Post a Comment

Links to this post:

Create a Link

<< Home