• quietopus
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
(I also posted this to this forum.)

How do I eliminate or work around a 500 error preventing me from using Lightning components on a VisualForce page in a sandbox? Identical code works in a dev org but fails in a sandbox.

Note: In the sandbox I used, the "My Domain" feature is in a "Ready for Testing but Hidden from Users" state, whereas in the dev org I used, the "My Domain" feature is in a fully deployed state.

Only mentioning My Domain for good measure, since this document:

Finally, you don’t need to enable My Domain to use Lightning
components in the following contexts.
  •  Lightning components with Communities in Community Builder
  •  Lightning Components for Visualforce
Copious details below.

Inputs
Sample code taken verbatim from Lightning Components Developer Guide.

lcvfTest.app
<aura:application access="GLOBAL" extends="ltng:outApp"> 
    <aura:dependency resource="ui:button"/>
</aura:application>
lcvfTest.vfp
<apex:page >
    <apex:includeLightning />

    <div id="lightning" />

    <script>
        $Lightning.use("c:lcvfTest", function() {
          $Lightning.createComponent("ui:button",
          { label : "Press Me!" },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script>
</apex:page>
Results
Dev org succeeded but Sandbox failed.

Dev Org
Renders a button, just as described in the documentation.

Sandbox Org
No Button is rendered. The browser's debug console reveals a request which fails with a 500 error. 

(Note: In the following output, hash-like values were replaced with fictitious ones, since I do not know whether the hashes contain private information. Domain and sandbox names are also fictitious.)

The URL of the request which triggered a 500 error was:
https://my-custom-domain--my-sandbox-name.cs2.my.salesforce.com/l/%7B%22mode%22%3A%22PROD%22%2C%22app%22%3A%22c%3AlcvfTest%22%2C%22fwuid%22%3A%22FNQR24ngqrHzyBZ_Nh3ghS%22%2C%22loaded%22%3A%7B%22APPLICATION%40markup%3A%2F%2Fc%3AlcvfTest%22%3A%22N7gJLRFbk4dlneywPZJt2f%22%7D%2C%22requestedLocales%22%3A%5B%22en_US%22%2C%22en%22%5D%2C%22ls%22%3A%22YN%22%7D/inline.js

Opening this URL in its own browser tab yields the following content (indentation added by me):
aura.error(
{
    "exceptionEvent":true,
    "event": {
        "descriptor":"markup://aura:clientOutOfSync",
        "eventDef": {
            "s":1,
            "v": {
                "descriptor":"markup://aura:clientOutOfSync",
                "type":"APPLICATION",
                "superDef": {
                    "s":2,
                    "v": {
                        "descriptor":"markup://aura:applicationEvent",
                        "type":"APPLICATION",
                        "xs":"G",
                        "attributes":{}
                    }
                },
                "attributes":{}
            }
        }
    },
    "defaultHandler":"function() {$A.clientService.setOutdated()}"
});
The large URL-encoded portion of the URL above decodes to this (indentation added by me):
{
    "mode":"PROD",
    "app":"c:lcvfTest",
    "fwuid":"FNQR24ngqrHzyBZ_Nh3ghS",
    "loaded":
    {
        "APPLICATION@markup://c:lcvfTest":"N7gJLRFbk4dlneywPZJt2f"
    },
    "requestedLocales":["en_US","en"],
    "ls":"YN"
}

 

I have multiple specific questions of interest related to this post's main question (see title). I'm not sure that there are publicly available answers to these. If not, it would still be helpful to know which questions Salesforce explicitly (purposefully?) leaves unanswered.

 

First, I'll make my terminology explicit:

 

When I submit a large quantity of records for a single DML operation (e.g. through Apex or through the Web API), Salesforce divides the job into smaller groups of records (typically groups of 200 records) and hands each group the appropriate Triggers.

 

  • I shall refer to the larger, undivided list of records as the original list.
  • I shall refer to the smaller groups as Trigger Batches (not to be confused with Batches, as they relate to the Batchable interface).
  • When a Trigger Batch is passed into a single Trigger and the Trigger performs operations on the records in that Trigger Batch, I shall refer to this as a Trigger Batch Execution.

 

Now, the specific questions of interest:

 

  • Do Trigger Batch Executions always occur in the order implied by the original list? If not, under what conditions might they not?
  • Do the records within a Trigger Batch always appear in the same order implied by the original list? If not, under what conditions might they not?
  • If the original list contains multiple instances of the same record (as indicated by the record ID), can that record possibly occur multiple times within the same Trigger Batch? If so, which instance do Trigger.newMap and Trigger.oldMap return for that record's ID?
  • If the original list contains multiple instances of the same record (as indicated by the record ID), can that record possibly occur multiple times across multiple Trigger Batches for the same original list?
  • If one Trigger Batch Execution makes changes to a record by changing its Trigger.new instance, are those changes visible to subsequently run Trigger Batch Executions? If both yes and no, what conditions determine whether yes or no?
  • If one Trigger Batch Execution makes changes to the Database via DML operations, are those changes visible to subsequently run Trigger Batch Executions? If both yes and no, what conditions determine whether yes or no?

Using classic Eclipse 3.6.2 (helios) with latest IDE plugin.

 

1. I create a new Force.com project.

 

2. Enter name, password, login criteria, etc., click Next.

 

3. Click "Choose...", next to "Selected metadata components:"

 

4. Window titled "Progress Information" displays the message: 

"Fetching Component Metadata"

 

5. A few components flash by and the progress bar advances about 15%

 

6. 

An error message displays:

"Unable to refresh file metadata:

Connection timed out: connect"

 

- Error does not happen on cs9 but does happen on cs8 and tapp0.

- I am not behind a proxy.

- This happens even when my firewall and antivirus programs are turned off.

- Also got same error using Eclipse Helios for Java and Eclipse Ganymede Classic.

 

Can anyone help?

In the Force.com Apex Code Developer's Guide (Versions 18.0 and 19.0), the section on Collection Casting (p. 113 in 18.0 or p. 115 in 19.0) says the following:

 

"Note: Maps behave in the same way as lists with regards to the value side of the Map-if the value side of map A can be cast to the value side of map B, and they have the same key type, then map A can be cast to map B. A runtime error results if the casting is not valid with the particular map at runtime."

 

However,

 

 

// Create an sObject List
List<sOBject> objList = new List<Contact>();

// Cast the sObject List to a Contact List....
List<Contact> conList = (List<Contact>)objList;

// No Exception is thrown here.

// Create an sObject Map
Map<Id,sObject> objMap = new Map<Id,sObject>();

// Cast the sObject Map to a Contact Map...
Map<Id,Contact> conMap = (Map<Id,Contact>)objMap;

// System.TypeException: Invalid conversion from 
// runtime type Map<Id,sObject> tot Map<Id,Contact>

 

Have I missed something?

 

I know that I can construct the Contact map from scratch, casting each sObject element individually, but I would prefer a way to avaoid eating 2*n script statements for a single (supposedly legal) Collection cast.

 

Is this possible?

 

Note that changing the key type from Id to String does not eliminate the Exception.

 

Using classic Eclipse 3.6.2 (helios) with latest IDE plugin.

 

1. I create a new Force.com project.

 

2. Enter name, password, login criteria, etc., click Next.

 

3. Click "Choose...", next to "Selected metadata components:"

 

4. Window titled "Progress Information" displays the message: 

"Fetching Component Metadata"

 

5. A few components flash by and the progress bar advances about 15%

 

6. 

An error message displays:

"Unable to refresh file metadata:

Connection timed out: connect"

 

- Error does not happen on cs9 but does happen on cs8 and tapp0.

- I am not behind a proxy.

- This happens even when my firewall and antivirus programs are turned off.

- Also got same error using Eclipse Helios for Java and Eclipse Ganymede Classic.

 

Can anyone help?

I am getting a ‘Regex too complicated’ error below when loading data into our org using the following process:

 

1) an email service to receive the CSV data,

2) an APEX class to split and validate the CSV data, and then

3) a set of @future calls to upsert the data.

 

The same data works in smaller volumes, but not beyond a certain threshold. This applies whether we reduce the number of rows, or reduce the width of certain columns of data by truncating them to 3000 characters (a small number of columns have 10,000 characters of text included). When we do either or both of these steps in any combination to reduce the file size, we don't get this problem. It’s not a problem with a specific badly formatted row either, because reducing the number of rows in various combinations always causes the problem to go away.

 

So we don’t believe it is actually a regex problem, because the regular expression is just finding commas to split up a comma separated file/string - i.e. it's very simple.

 

This is why we think there's an undocumented storage or capacity limit somewhere within the APEX processing that is being exceeded - but one that doesn't have a governor limit associated with it, or indeed an accurate error message. We think it is an erroneous error message - i.e. it's not to do with complicated regex – and that this error message is a symptom of another issue.

 

This error has occurred in code that has been stable to date, but has appeared since the filesize we're uploading has increased to beyond about 4600-4800KB, which seems to be the threshold beyond which this problem occurs. There seem to be some undocumented limits in the volume of data than can be processed using the solution architecture we've designed.

 

We want to be able to code around this problem, but unless we know exactly what the error is, any changes we make to our code may not actually fix the problem and result in wasted effort. So I don't want to start changing this until I know exactly which part of the solution needs to be changed!

 

I’ve raised this with Salesforce as a potential bug or to see if they could clarify any undocumented limits on processing large volume datasets using the process we’ve designed, but they seem to have decided it’s a developer issue so won’t help.

 

The error message is below:

 

Apex script unhandled exception by user/organization: 

Failed to invoke future method 'public static void PrepareCSV(String, String, String, Integer, Boolean)'

caused by: System.Exception: Regex too complicated

Class.futureClassToProcess.GetList: line 98, column 17
Class.futureClassToProcess.parseCSV: line 53, column 38
Class.futureClassToProcess.PrepareCSV: line 35, column 20 External entry point

 The relevant code snippet is below:

 

 

 

public static list<List<String>> GetList(String Content)
        {
        Content = Content.replaceAll(',"""',',"DBLQT').replaceall('""",','DBLQT",');
            Content = Content.replaceAll('""','DBLQT');
            List<List<String>> lstCSV = new List<List<String>>();
            Boolean Cont = true;
            while (Cont == true){
                List<String> lstS = Content.Split('\r\n',500);
                if(lstS.size() == 500){
                    Content =lstS[499];
                    lstS.remove(499);
                }else{
                    Cont = false;
                }
                lstCSV.add(lstS);
            }
            return lstCSV;
        }

 

Any suggestions gratefully received as to whether we're missing something obvious, whether 4MB+ files just can't be processed this way, or whether this might actually be a SFDC APEX bug.

 

 

 

public static list<List<String>> GetList(String Content)
        {
            //Sanjeeb
            Log('GetList started.');
            Content = Content.replaceAll(',"""',',"DBLQT').replaceall('""",','DBLQT",');
            Log('Replaing DBLQT.');
            Content = Content.replaceAll('""','DBLQT');
            Log('Replaing DBLQT.');
            List<List<String>> lstCSV = new List<List<String>>();
            Boolean Cont = true;
            while (Cont == true){
                List<String> lstS = Content.Split('\r\n',500);
                Log('Split upto 500 Rows.');
                //List<String> lstS = Content.Split('\r\n',1000);
                if(lstS.size() == 500){
                    Content =lstS[499];
                    lstS.remove(499);
                }else{
                    Cont = false;
                }
                lstCSV.add(lstS);
            }
            Log('GetList ends.');
            return lstCSV;
        }

Hi,

 

I have just installed Eclipse 3.4 and the Force IDE but I have a problem accessing metadata for our production

site, when I goto 'choose' metadata componants when creating a new Force.com project I get an exception:

 

'unable to refresh file metadata list'.

 

The funny thing is I only get the issue with the production version, the Sandbox, and my developer account

seem to work fine?

 

Any ideas what this error could mean?

 

You can view the log file of the Exception here: http://pastebin.com/mfd0156d

 

Thanks for any help.

  • October 12, 2009
  • Like
  • 0