function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CloudyCloudy 

dataloader Failed to get next element

Hi,

I'm changed my password and I'm trying to renew my code to connect dataloader in command line with the encrypt command
I can use encrypt -d to decrypt my password and that seems to decrypt correctly the code I use un the config file but when trying to lauch a process command, I get the following error:
Failed to get next element
com.sforce.ws.ConnectionException: Failed to get next element
        at com.sforce.ws.parser.XmlInputStream.nextTag(XmlInputStream.java:169)
        at com.sforce.ws.transport.SoapConnection.readSoapEnvelopeStart(SoapConnection.java:258)
        at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:170)
        at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:154)
        at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
        at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:818)
        at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:177)
        at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:168)
        at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerClient.java:345)
        at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerClient.java:545)
        at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.java:513)
        at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.java:229)
        at com.salesforce.dataloader.controller.Controller.login(Controller.java:208)
        at com.salesforce.dataloader.controller.Controller.login(Controller.java:203)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:135)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:107)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:266)
Caused by: com.sforce.ws.parser.XmlPullParserException: only whitespace content allowed before start tag and not T (position: START_DOCUMENT seen T... @1:1)
        at com.sforce.ws.parser.MXParser.parseProlog(MXParser.java:1532)
        at com.sforce.ws.parser.MXParser.nextImpl(MXParser.java:1408)
        at com.sforce.ws.parser.MXParser.next(MXParser.java:1111)
        at com.sforce.ws.parser.MXParser.nextTag(MXParser.java:1096)
        at com.sforce.ws.parser.XmlInputStream.nextTag(XmlInputStream.java:167)
        ... 16 more

I never get this one before, what does this message mean?

thanks
Jean
 
Best Answer chosen by Cloudy
VinayVinay (Salesforce Developers) 
Nice and Good to know its working now.

Java version shouldn't be a issue here and you might have already using version 8.  Might be because of some critical updates in org you might see this and not sure if below link relates to that.

https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_security_domains_stabilized_sandbox_URLs.htm

However instead of hard coding endpoint with your sandbox name try to use the generic one which is test.salesforce.com going forward.

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Jean,

Check and edit the Salesforce connection and change production Salesforce Service URL to https://login.salesforce.com/services/Soap/u/41.0 and try running the job.

Try to check below things.

>> Make sure the salesforce connection credentials are provided correctly.
>> Please test the connectivity to the salesforce by doing ping to the endpoint service URL. provided it should be dome from agent hosted server.
>> ​Please check whether you have whitelisted the IPs at the salesforce end. >> You can use the attachment for testing the connectivity to the Salesforce. This will do the curl test every 2 mins to the endpoint URls from the agent hosted server and create a log file.

Review below links which has workaround for similar issue.

https://salesforce.stackexchange.com/questions/215750/talend-ioexception-com-sforce-sw-connectionexception-failed-to-get-next-elem
https://salesforce.stackexchange.com/questions/140574/getting-the-com-sforce-ws-connectionexception-failed-to-parse-detail-start-ta

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
CloudyCloudy
Hi,

Thanks Vinay that was very helpful, I changed my endpoint from customurl--sandboxname.my.salesforce.com to test.salesforce.com and it worked.
I'm using the custom url for months and never get any issue, I still don't undestand why I'm getting this error now

I've made another test, created a new sandbox and keep the production password, then used the same encrypted code to do the same operation and it worked with the custom url.
I tried with an old sandbox which was working in the past, I haven't changes neither the password nor the encrypted code in my config and It's not working
I'm wondering what's changed (java version?), any idea?
VinayVinay (Salesforce Developers) 
Nice and Good to know its working now.

Java version shouldn't be a issue here and you might have already using version 8.  Might be because of some critical updates in org you might see this and not sure if below link relates to that.

https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_security_domains_stabilized_sandbox_URLs.htm

However instead of hard coding endpoint with your sandbox name try to use the generic one which is test.salesforce.com going forward.

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer