Archives

Salesforce Exception Collections Internal Error

February 19, 2016

We had some legacy code which was storing exceptions happening during future methods into Salesforce custom object.
This tool had some code which was converting a single exception into a list and then iteration over the list was performed.

This issue could be reproduced by the following snippet:

try {
String testString;
Boolean testBool = testString.startsWith( 'text' );
} catch ( Exception e ) {
for ( System.Exception anExToLog : new List{ e } ) {
System.debug(LoggingLevel.ERROR, '@@@ anExToLog: ' + anExToLog );
}
}

When we tried to execute this code, the following exception was raised:

System.QueryException: Dynamic query yields incompatible SObject type System.NullPointerException for loop variable of type java.lang.Exception

We have opened a ticket against Salesforce support on 9th of February.

Finally today, in about two weeks, Salesforce has acknowledged this as an issue and provided a link for us to click “This issue affects me” to get email alert when the issue is fixed. If this issue affects you then you can also subscribe to it.

If you notice some other internal error issue then you can also open Salesforce support ticket by following the link being logged in to Salesforce. You may find the open cases by this link and your closed cases by this link.

Tags



Share


2 replies
  1. Ac
    Ac says:

    Were you able to fix this issue? I’m also having this error on the test class of a scheduler class wherein on the finish method we are inserting a record if there’s an exception. Calling the finish method causes a null pointer with the same issue you encountered.
    Do you have solution for this?

    Reply
    • Bohdan Dovhan
      Bohdan Dovhan says:

      Due to this link https://success.salesforce.com/issues_view?id=a1p30000000eVDM, the issue is fixed.
      I used workaround

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Articles

9 Big Things about Java 9

September 15, 2017 | Andrew Petryk

According to the latest Tiobe index of programming language popularity, Java tops the list.  No wonder there is so much buzz around the new Java 9 release, set for September 21, 2017.  Take a walk through with our expert.     1. JSHELL Many compiled languages include tools for statements interpretation. By using these REPL tools […]

What are your customers telling you? Maximize the effectiveness of sentiment analysis by using simple tips

September 7, 2017 | Lily Smirnova

Sentiment analysis is one method to gather and process customer-supplied information, and then convert it to a quality customer experience. Gartner predicts that 85% of all businesses will compete in the area of customer experience by 2020. As sentiment analysis explodes onto the scene, what can technology actually do to enhance business efforts? Hints on […]