You need to sign in to do that
Don't have an account?

Login into Salesforce.com Java Program.
Hi,
I am getting below error while login into Salesforce.com from Java. Its working fine in other network, but when I try from different network i am getting below error. Can you please tell what can be the issue is?
16-Feb-2011 15:35:37 NIE login
INFO: LOGGING IN NOW....
16-Feb-2011 15:35:38 NIE login
INFO: An unexpected error has occurred: ; nested exception is:
AxisFault
faultCode: {
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?http://schemas.xmlsoap.org/soap/envelope/}Server.userExceptionfaultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
{
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.axis.components.net.JSSESocketFactory.create(
at org.apache.axis.transport.http.HTTPSender.getSocket(
at org.apache.axis.transport.http.HTTPSender.writeToSocket(
at org.apache.axis.transport.http.HTTPSender.invoke(
at org.apache.axis.strategies.InvocationStrategy.visit(
at org.apache.axis.SimpleChain.doVisiting(
at org.apache.axis.SimpleChain.invoke(
at org.apache.axis.client.AxisClient.invoke(
at org.apache.axis.client.Call.invokeEngine(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at com.sforce.soap.enterprise.SoapBindingStub.login(
at NIE.login(
at NIE.getData(
at NIE.main(
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?JSSESocketFactory.java:186)HTTPSender.java:191)HTTPSender.java:404)HTTPSender.java:138)InvocationStrategy.java:32)SimpleChain.java:118)SimpleChain.java:83)AxisClient.java:165)Call.java:2784)Call.java:2767)Call.java:2443)Call.java:2366)Call.java:1812)SoapBindingStub.java:3386)NIE.java:113)NIE.java:243)NIE.java:75)
{http://xml.apache.org/axis/}hostname:EA-A32140
javax.net.ssl.SSLException
at org.apache.axis.AxisFault.makeFault(
at org.apache.axis.transport.http.HTTPSender.invoke(
at org.apache.axis.strategies.InvocationStrategy.visit(
at org.apache.axis.SimpleChain.doVisiting(
at org.apache.axis.SimpleChain.invoke(
at org.apache.axis.client.AxisClient.invoke(
at org.apache.axis.client.Call.invokeEngine(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
at com.sforce.soap.enterprise.SoapBindingStub.login(
at NIE.login(
at NIE.getData(
at NIE.main(
Caused by:
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.axis.components.net.JSSESocketFactory.create(
at org.apache.axis.transport.http.HTTPSender.getSocket(
at org.apache.axis.transport.http.HTTPSender.writeToSocket(
at org.apache.axis.transport.http.HTTPSender.invoke(
... 13 more
: Unrecognized SSL message, plaintext connection?AxisFault.java:101)HTTPSender.java:154)InvocationStrategy.java:32)SimpleChain.java:118)SimpleChain.java:83)AxisClient.java:165)Call.java:2784)Call.java:2767)Call.java:2443)Call.java:2366)Call.java:1812)SoapBindingStub.java:3386)NIE.java:113)NIE.java:243)NIE.java:75)javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?JSSESocketFactory.java:186)HTTPSender.java:191)HTTPSender.java:404)HTTPSender.java:138)
The error message seems to indicate that its likely that you're using SSL (aka https) but connecting to a unsecreted endpoint, perhaps you have a config problem, and are trying to connect to https://login.salesforce.com:80, which would result in that.
I have converted Eneterprise WSDL to Java classes. I used standard login method to login.
Am getting this error.
Is there anything to do with changing the https to http.
here is my java login code
binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
// login.. the userid/pw is supplied in the config object
loginResult= binding.login(externalConnection.getUsername(), externalConnection.getPassword()+ token);//token);
// set the api endpoint url
// the login api only does login
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());
// Create a new session header object
// add the session ID returned from the login
SessionHeader sh = new SessionHeader();
sh.setSessionId(loginResult.getSessionId());
sessionId = loginResult.getSessionId();
// Set the session header for subsequent call authentication
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader", sh);
Are you connecting via a proxy? does that support SSL (aka CONNECT at the proxy server), is the login that fails, or the subsequent request ?
Yes. I am connecting via proxy. Proxy supports SSL.
do you mind sharing your code??