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
smilo33smilo33 

Tomcat with Axis -- RemoteException, but no error message

I can login using the Getting Started java console example, but I'm not having luck with Tomcat. I created a servlet, but when login is called it keeps getting stuck on RemoteException, but ex.getMessage is always null, so it doesn't tell me what the problem is. I searched google and the message board for days, but I'm completely stuck. Any ideas? Anyone experience this before? Many thanks. ~Samantha

Background:
-- sforce API 4, XP Pro, Tomcat 5.0.18, Axis 1.1, Eclipse 3.0/MyEclipse, jdk 4.0.2.05
-- tried connecting to both: http(s)://www.salesforce.com/services/Soap/c/4.0/
-- Axis libraries were copied to Tomcat's /common/lib
-- tested both http://localhost:8080 & https://localhost:8443 (keytool generated cert was installed). Keep getting the same results. This is not the Handshake problem.

Code segment:

try{
loginResult = binding.login(userName,password);
}
catch(LoginFault ex){
out.println("

Login error: " + ex.getMessage() + "

");
return false;
}

///---PROGRAM DOESN'T GET PAST RemoteException.
///---ex.getMessage() IS ALWAYS NULL

catch(RemoteException ex){
out.println("

Login Remote Host error: " + ex.getMessage() + "

");
return false;
}
////---can't get this far
try{
binding = (SoapBindingStub)
new SforceServiceLocator().getSoap(new URL(loginResult.getServerUrl()));
}
catch(MalformedURLException ex){
out.println("An error: " + ex.getMessage());
return false;
}
catch(ServiceException jre){
out.println("An error: "+ jre.getMessage());
return false;

}
adamgadamg

Hmm.  Not sure what problem you are having, but i'd recommend taking a look at the JSP sample at sforce.sf.net - should make whatever you are building easier!  It includes some (slightly out of date) instructions on getting Eclipse, Tomcat, etc setup with sforce.

w/r/t your specific problem, try printing the stack trace instead of the error message.

FandangoFandango
how did you fix it ? I'm having the same problem.
DevAngelDevAngel

Hi fandango,

Sometimes the servlet containers and other wrappers will "handle" the errors.  You will need to go back through the stack trace to find where the error is thrown and inspect it from there.  Exception.getCause() may be able to take you back to the original error as well.

codekcodek
I've seen this too, also running under tomcat, the message is null.  So i'll print the stacktrace too.  It does seem like this is a bug though - there should be something in the message!