johvargas / sfdc-wsc

Automatically exported from code.google.com/p/sfdc-wsc
0 stars 0 forks source link

java.lang.ClassCastException: com.sforce.soap.partner.LoginResult cannot be cast to com.sforce.ws.bind.XMLizable #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to run the Bulk API xample

What is the expected output? What do you see instead?
Expect to log in, but instead, see this:

Exception in thread "main" java.lang.ClassCastException:
com.sforce.soap.partner.LoginResult cannot be cast to
com.sforce.ws.bind.XMLizable
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:618)
    at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:495)
    at
com.sforce.soap.partner.LoginResponse_element.loadFields(LoginResponse_element.j
ava:68)
    at
com.sforce.soap.partner.LoginResponse_element.load(LoginResponse_element.java:59
)
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:619)
    at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:495)
    at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:154)
    at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:128)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:103)
    at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:791)
    at
com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:315)
    at BulkExample.getRestConnection(BulkExample.java:171)
    at BulkExample.runSample(BulkExample.java:43)
    at BulkExample.main(BulkExample.java:34)

Problem shows up here in PartnerConnection.class on line 791:
 __response = (com.sforce.soap.partner.LoginResponse_element)
__connection.send("",
       login_qname, __request, loginResponse_qname,
       com.sforce.soap.partner.LoginResponse_element.class);

What version of the product are you using? On what operating system?
17.0 on Mac OS X Snow Leopard
Java 1.6

Please provide any additional information below.
Username and password are correct. The Bulk API documentation references
wsc-18_0.jar, but that jar does not exist on the google site. Not sure why
there's documentation, but no jar file. So, we're using the example from a
previous version of the bulk api documentation (version 17.0).

No matter what we do, we get this ClassCastException error and there's no
way for us to get around it.

Original issue reported on code.google.com by jlc...@gmail.com on 3 Feb 2010 at 8:15

GoogleCodeExporter commented 8 years ago
I just uploaded WSC version 18. Please try it out.

Original comment by manoj.ch...@gmail.com on 6 Apr 2010 at 11:03

GoogleCodeExporter commented 8 years ago
Still getting the same error, using wsc-18.jar and have tried both 
partner-18.jar and generating new partner.jar from wsc-18.jar.

Original comment by rohitfor...@gmail.com on 11 Jun 2010 at 11:59

GoogleCodeExporter commented 8 years ago
@rohitforever You can use the wsc-17.jar instead of the wsc-18.jar. They work 
essentially the same with the Bulk API. There is a working project that I did 
with the Bulk Api here: http://code.google.com/p/sfdc-bulkapi-demo/. My 
accompanying article should be posted on developer.force.com soon.

Original comment by jeff%jef...@gtempaccount.com on 17 Jul 2010 at 2:49

GoogleCodeExporter commented 8 years ago
I found an easy way to fix this, to know how : http://goo.gl/fb/oIqRb

Original comment by abhinavgupta697 on 4 Aug 2010 at 5:22