This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Services and the fly likes ClassCastException for SOAP message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "ClassCastException for SOAP message" Watch "ClassCastException for SOAP message" New topic
Author

ClassCastException for SOAP message

Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 129
Hii i have a java client which connects to our webservices.when i run this i get a ClassCastException here is the stack trace.



i have new saaj.jar,saaj-api.jar, and saaj-impl.jar in path. And iam using jre 1.6.

Any ideas on how to resolve this ?

Thanks,

Vinod
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
i have new saaj.jar,saaj-api.jar, and saaj-impl.jar in path.

This sounds fishy. First of all, I'm assuming you have those in the classpath, not the path (where they wouldn't do any good). Secondly, I think Java 1.6 comes with SAAJ, so if you want to use a different version than the one built in, just adding them to the classpath will cause confusion.

You need to put these classes in the bootclasspath; this is discussed in more detail here.
Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 129
Sorry for the confusion. I put those jars in \Java\jre1.6.0_01\lib\ext folder.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
I put those jars in \Java\jre1.6.0_01\lib\ext folder.


That won't do. They need to be in the bootclasspath.
Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 129
i tried -bootclasspath. but its not working

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

try c:\progra~1\etc rather than "Program Files", the space will cause you issues.
Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 129
Thanks Ulf and David, i replaced the older saaj-api.jar and saaj-impl.jar with new jars. And this solved the issue.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm glad you got it working, and thanks for taking the time to update us!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: ClassCastException for SOAP message
 
It's not a secret anymore!