• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

ClassCastException Help!!!!!!

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm working in WL6.1 sp3 and I have a webapp deployed alone (without any ear). This Web app access an EJB Module inside an separate ear. The Web app calls an EJB Method and pass a Collection of Value Objects as parameter. I have an EJB Client Jar in the web app that have inside the Value Object class.
When I call the method and inside the EJB Bean Class I try to cast every element I get an ClassCastException.
Thanks a lot.
Cristian.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what may be happening is that WebLogic is not Serializing the collection. WLS will serialize things if it can't see the same class from both ClassLoaders.
Maybe because the Collection is in java.util it is not actually serializing that object, so its contents (your Value objects) are not being serialized and thus you get the ClassCastException.
I can think of three ideas. You can force the serialization with a switch in the weblogic-ejb-jar.xml (I forget exactly, but check e-docs.bea.com).
Or you could put your value class in system classpath.
Or you could create a subclass of the Collection that you put in your ejb jar and client jar in the webapp. Pass the "MyCollection" rather than the java.util.Collection and maybe WLS will be "tricked" into serializing the thing. It could be as simple as

I think the force serialization switch is probably the best bet.
[ November 22, 2002: Message edited by: Dave Landers ]
 
Cristian Cardenas
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dave for your reply.
But, I couldn't find the switch in the Weblogic 6.1 documentation but I couldn't find it.
Are you sure is part of the weblogic-ejb-jar-xml?
Thanks a lot
Cristian.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic