IC Throws error saving component but SF UI saves just fine

Issue #477 wontfix
Eric Alexander created an issue

Attempting to save this visual force Component:

<apex:component id="orderedLineItems" controller="orderedLineItems_Controller" access="global">
    <apex:attribute name="OppId" type="Id" description="Opportunity id"/>
    <apex:attribute name="varName" type="String" description="The variable to represent a single line item in the iteration."/>

    <apex:componentBody >
        <apex:repeat var="o" value="{!lineItems}">
            <apex:variable var="{!varName}" value="{!o}"/>
        </apex:repeat>
    </apex:componentBody>


</apex:component>

And IC throws the following error on save:

Error:(1, 1) common.apex.runtime.bytecode.BytecodeExecutionContext cannot be cast to common.apex.runtime.impl.Execution

Yet, copying and pasting the component directly in the salesforce UI saves just fine.

I then did a retrieve and attempted to save again thinking there was an unseen character but same error was thrown

Comments (8)

  1. Scott Wells repo owner

    Eric, can you provide the associated stack trace from the log? Also, have you tried deploying this via the metadata API to see if it saves properly? The Setup UI seems to use the metadata API while Developer Console uses the tooling API, and I've already reported some differences between the two to Salesforce where something that works in the metadata API fails with a false negative in the tooling API. It's possible this is another one of those, but it's also possible that it's just a bug in IC. The stack trace plus some A/B testing of tooling vs. metadata APIs should help to determine which it is.

  2. Eric Alexander reporter

    Metadata API save correctly. How do I get the "Stack Trace Log"? are you talking about the idea.log?

    Here is the controller class as well. This way you can recreate it as needed on your end:

    public class orderedLineItems_Controller {
    
        public Id oId { get; set; }
    
        private OpportunityLineItem[] oppLineItems;
    
        public OpportunityLineItem[] getLineItems() {
            if(string.isBlank(oId)){
                return New OpportunityLineItem[]{};
            }
    
            oppLineItems = [
                    Select
                            Product2.Name,
                            ServiceDate,
                            Quantity,
                            UnitPrice,
                            TotalPrice,
                            Product2.Family
                    From OpportunityLineItem
                    Where OpportunityId = :oId
                    ORDER BY ServiceDate DESC
                            NULLS LAST
            ];
    
            return oppLineItems;
        }
    
    
    }
    
  3. Scott Wells repo owner

    Yeah, I meant stack trace from idea.log. Can you confirm one other thing? Does the component save properly in Developer Console or fail with the same error?

  4. Eric Alexander reporter

    Dev console throws the same error. Guess you can close it out as won't fix. no way I am going through the pain of submitting a case either lol

  5. Scott Wells repo owner

    Eric, I'm able to reproduce this with the provided component markup. Do you mind if I include the component and controller in a dialog with Salesforce? It seems like a bug they need to fix on their side and this represents a standalone reproducible case. I don't mind managing the support aspects myself.

  6. Scott Wells repo owner

    Okay. I just sent the relevant info to some folks at Salesforce. Let's see how they want to manage it. The good news is that it's completely reproducible.

  7. Scott Wells repo owner

    As agreed, resolving as won't fix since this is an issue with the Tooling API that's reproducible outside of IC.

  8. Log in to comment