been running a java spring webservice application that runs on on a schedule, but for some reason the enterprise connection occasionally errors out.

2017-07-13 07:03:01 | ERROR | [http-nio-8090-exec-7] o.a.c.c.C.[.[.[.[dispatcherServlet]:181 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is [UnexpectedErrorFault [ApiFault  exceptionCode='INVALID_SESSION_ID'
 exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: 6gdt57/Pbxh3v4/yk9ooOmyQ44B0McQKrtUe7ZU8BMo=
This error usually occurs after a session expires or a user logs out. '
] with root cause
com.sforce.soap.enterprise.fault.UnexpectedErrorFault: null


public boolean login() {
    boolean success = false;

    try {
        ConnectorConfig config = new ConnectorConfig();
        if ((proxy!=null) && (!proxy.equals(""))) {
            config.setProxy(proxy, 5150);

        log.info("AuthEndPoint: " + authEndPoint);

        connection = new EnterpriseConnection(config);

        success = true;
        bulkConnection = new BulkConnection(config);

    } catch (ConnectionException ce) {
        log.info("oops~!: ");
    } catch (AsyncApiException e) {
        log.info("oops2~!: ");
        // TODO Auto-generated catch block

    return success;

I assume I need to handle that error, but I'm struggling to figure out where to handle it? I'm not seeing the "oops~" log messages in my code, so I assume its happening in the enterpriseconnection or bulk connection? Any tips on how to solve my issue? Still new to rest services. thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.