Results 1 to 2 of 2

Thread: ObjectInputStream class loading problem

  1. #1

    Question ObjectInputStream class loading problem

    I've encountered this a couple times now in dm Server 1 where ObjectInputStream will use the classloader of the bundle who exports the class instead of the caller. Looking at the source code for ObectInputStream I've tracked it down to a native method called latestUserDefinedLoader which seems to be grabbing the wrong classloader. I think a few other people have experienced a similiar issue. This more than likely is an issue with ObjectInputStream rather than with dm Server, but does anyone know a workaround?

    This is also related to "Ehcache Persistence Class Loading Issue".

  2. #2
    Join Date
    Sep 2008
    Posts
    26

    Default

    Quote Originally Posted by kierann View Post
    I've encountered this a couple times now in dm Server 1 where ObjectInputStream will use the classloader of the bundle who exports the class instead of the caller. Looking at the source code for ObectInputStream I've tracked it down to a native method called latestUserDefinedLoader which seems to be grabbing the wrong classloader. I think a few other people have experienced a similiar issue. This more than likely is an issue with ObjectInputStream rather than with dm Server, but does anyone know a workaround?

    This is also related to "Ehcache Persistence Class Loading Issue".

    My solution is to create a ValueObject class that contains byte[] field and my cache facade do the serialize/deserialize works with correct class loader before really send data to the cache server.

    Hope that helps.

    Shawn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •