aspose file tools*
The moose likes Web Services and the fly likes long[] class cast exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "long[] class cast exception" Watch "long[] class cast exception" New topic
Author

long[] class cast exception

Markus Schmider
Ranch Hand

Joined: Feb 25, 2007
Posts: 89
Hello,

I have a webservice deployed on JBoss EAP 6.1


this produces the following wsdl:



For a client I have generated classes with wsimport
Among which is:


First of all I am a bit surprised that
public List<Long> getAllIds();
has been generated instead of returning long[]

Then when I run


I get on the client side


on the server side


Any ideas how to solve this would be greatly appreciated
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 761
    
    9
It looks like this line is the problem

The call is returning an Object[] and you are trying to cast that into a long[] which is not allowed by Java rules

To make the values get copied to a Long[] you can use
and they would need to all be longs. Note also that you get a Long[] from that not a long[].
Markus Schmider
Ranch Hand

Joined: Feb 25, 2007
Posts: 89
Grate, Yes this was the problem.

Many Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: long[] class cast exception
 
Similar Threads
Need help, backwards compatiblity between cxf-2.7.3 and cxf-2.3.1
axis2/webshpere response != axis2/glassfish response........ why?
Java class to WSDL
XmlException on calling WSDL2Java
Getting exception org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected