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
Pankaj Singh 6Pankaj Singh 6 

Not able to Connect to SDFC through java code

Hi All,
Sometime before i was able to connect to SFDC through my java code..
https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_code_walkthrough.htm

But now I am getting below error
2015-01-13 15:21:32,642 [main           ] INFO  SpringCamelContext             - Apache Camel 2.12.1 (CamelContext: camel) is shutting down
Exception in thread "main" org.apache.camel.RuntimeCamelException: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]
]

    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1344)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:186)
    at org.apache.camel.spring.Main.doStart(Main.java:140)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:148)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:343)
    at org.genpact.onedb.eapp.MyRouteBuilder.main(MyRouteBuilder.java:35)
Caused by: [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'
]

Pls help.
Best Answer chosen by Pankaj Singh 6
Bhawani SharmaBhawani Sharma
If I am not wrong, there was recently a server update by Salesforce. I saw this issue in the other instance  also. I would say you can verify your "Endpoint" again. If it has been changed from what it was earlier, you need to create your web service client again.

All Answers

MithunPMithunP
Hi Pankaj,

Double check following things

1. SFDC UserName, Password, and updated Security token.
2. Make sure user is Active.
3. Verify RemoteSiteSettings.

Best Regards,
Mithun.
Pankaj Singh 6Pankaj Singh 6
Hi Mithun,
I am able to login through my browser with the same cridentials.

Thanks,
Pankaj
MithunPMithunP
Ok then. Can you Refresh your security token and use updated one.

Best Regards,
Mithun.
Pankaj Singh 6Pankaj Singh 6
Already tried with new security tokens.. :(

 
Bhawani SharmaBhawani Sharma
If I am not wrong, there was recently a server update by Salesforce. I saw this issue in the other instance  also. I would say you can verify your "Endpoint" again. If it has been changed from what it was earlier, you need to create your web service client again.
This was selected as the best answer
Pankaj Singh 6Pankaj Singh 6
Till Yesterday evening I was able connect but from today morning I am facing this issue..
can u please let me know how can i check my "Endpoint" of current version as m very new for SFDC.
Bhawani SharmaBhawani Sharma
You can enable the logs in java. Also see in the login history in Salesforce, if it is actually trying to hit salesforce or not.
Pankaj Singh 6Pankaj Singh 6
this is hitting SFDC but not able to connect...
getting following error "LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'
 exceptionMessage='Invalid username, password, security token; or user locked out.'"
but with same cridentials m able to connect through browser..
Pankaj Singh 6Pankaj Singh 6
Thanks a lot Bhawani
I have changed my authenticationEndPoint
https://login.salesforce.com/services/Soap/u/32.0
and this is working for me now previously i was using
https://login.salesforce.com/services/Soap/u/30.0
 
Bhawani SharmaBhawani Sharma
Then I am pretty much sure about the endpoint issue. Can you import your enterprise jar again and then try?
Bhawani SharmaBhawani Sharma
Perfect. Finally it worked :).
Pankaj Singh 6Pankaj Singh 6
Yes.. :-)
Bhawani SharmaBhawani Sharma
Please don't forget to mark this resolved.