9

I'm calling a remote action which returns a wrapper. It works without any issues on most of the time. But sometimes, it throwing an error:

Error parsing json response: 'expected expression, got '<''. Logged in?.

This is usually happens if there's remote action call after the page is idle for sometime approx. 20 minutes.

I found a similar question. In my page I'm not using URLReWriter as mentioned. So it does not helping me to solve my issue.
Am I missing something? or Do I have to do it in another way?

Here's my code:

@RemoteAction
    public static SearchResult getAllInstructors(Boolean isConflictSearch, ConflictSearchParameter conflictSearch, SearchParameter parameters) {
    SearchResult contactList = new SearchResult();
    contactList = getAllInstructorsWithoutConflictCheck(parameters);
    if(isConflictSearch) {
        //Search Instructors without conflicts
        contactList.conflictCount = getInstructorsWithConflictsCheck(conflictSearch, parameters, getContactIdSet(contactList.instructors));
    }
    return contactList;
}
public class SearchResult {
    public List<Contact> instructors;
    public Map<Id, Integer> conflictCount;
    public Map<Id, Double> proximities;
    public Map<Id, Decimal> instructorScore;
    public Integer recordCount;
}
  • 1
    can you post your code snippet? – Pranay Jaiswal Jun 10 '16 at 12:39
  • 1
    Also could you please check what is your session timeout period? – Pranay Jaiswal Jun 10 '16 at 12:43
  • Session timeout period is 2 hours. – Melbin T Jun 10 '16 at 12:56
  • 1
    @jonathanwiesel We created a case regarding this. The response is to disable the Cross-Site Request Forgery from the Session Settings. After that we did not see the issue again so far. – Melbin T Oct 12 '16 at 14:06
  • 2
    @MelbinT would you mind posting your solution as an actual answer ? That'd be more obvious to other people running into this issue. – Samuel De Rycke Sep 2 '17 at 17:41

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.