Anonymous Window Generates Exception Anytime Running Apex Script in the Debugger

Issue #553 resolved
Max Ramezan created an issue

The attached exception is thrown anytime I run an Apex script in the Anonymous Window debugger. Tried regenerating offline symbol table and re-indexing, but that didn't help.

The Anonymous Window debugger is completely useless for me now!

Using Windows 7 IntelliJ IDEA 2016.3.4 Build #IC-163.12024.16, built on January 31, 2017 JRE: 1.8.0_112-release-408-b6 x86 JVM: OpenJDK Server VM by JetBrains s.r.o

Comments (7)

  1. Scott Wells repo owner

    Mohammed, do you mind providing your idea.log when this occurs? You can find it using Help>Show Log in Explorer/Finder. This error seems to be coming from the Salesforce org in response to a request to run anonymous Apex, but I'd like to verify that by seeing the full stack trace.

  2. Scott Wells repo owner

    Thanks, Mohammed. I see two things in this log, one related to the reported problem and one that's not but that could be causing other issues. Regarding the latter, I see a ton of these:

    2017-02-24 22:25:37,142 [ 818127]   WARN - .intellij.psi.util.ApexPsiUtil - Caught an invalid element access exception trying to find the containing file.  Looking up the tree. 
    

    I've mostly addressed the issues that could cause stale caches, but looks like there may still be a few instances of the problem. I'd recommend you rebuild caches and either close/reopen the project or allow the IDE to restart. You can do that under Illuminated Cloud>Configure Project by clicking Rebuild Caches and Indices.

    Regarding the reported problem, I see the following stack trace:

    javax.xml.ws.soap.SOAPFaultException: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1758623662-12810 (-156473882)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
        at com.sun.proxy.$Proxy163.executeAnonymous(Unknown Source)
        at com.illuminatedcloud.intellij.toolwindow.apex.AnonymousApexToolWindow$17$1.compute(SourceFile:725)
        at com.illuminatedcloud.intellij.toolwindow.apex.AnonymousApexToolWindow$17$1.compute(SourceFile:721)
        at com.illuminatedcloud.client.ForceComApiClient.runWithClient(SourceFile:208)
        at com.illuminatedcloud.intellij.toolwindow.apex.AnonymousApexToolWindow$17.run(SourceFile:720)
    

    That's basically showing an error that's returned from Salesforce's Apex SOAP API for anonymous Apex execution. To know more about the root cause of the error, you'd need to provide the error ID to Salesforce. Do you see this issue if you execute anonymous Apex from another tool, e.g., Developer Console or Workbench? If not, I'll also need to talk to Salesforce to understand why this error would be raised through the API that I'm using.

    Please let me know if it's reproducible outside of Illuminated Cloud and also whether you're able to get any details on the error from Salesforce.

  3. Max Ramezan reporter

    Thanks. I finished rebuilding caches and indices. Is it different than generating offline symbols? How often should we rebuild caches?

    For the UNKNOWN_EXCEPTION, you are right, I got the same error via the developer console. I will open a case with Salesforce to address that issue.

  4. Scott Wells repo owner

    Mohammad, you really shouldn't have to rebuild caches & indices at all these days. I think this is the second time or so I've had to ask anyone to do it in a long while.

    Thanks for confirming that the same issue does in fact occur in other tooling. I'll be interested to know what Salesforce finds to be the issue.

  5. Log in to comment