Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastException Help!!!!!!

 
Cristian Cardenas
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • 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.
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!