function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

Receiving this error when editing a visualforce page in sandbox through developer console or third party IDE.  This page has been working in production for some time. Both page and controller are set to version 32 in sandbox and production. 
The page can be edited directly through Develop->Pages.

Here's a very simplified version of the page which produces the error
<apex:page standardController="User" extensions="SalesRepGoalController2"> 

<b>Hello World!</b>
and controller
public with sharing class SalesRepGoalController2{
private String userID = '' ; 	
public SalesRepGoalController2(ApexPages.StandardController c)
		userID = c.getId(); 

Java 1.7 was installed, but has been uninstalled.

Windows 8 Enterprise,  64bit
IE 10
JRE none

ShashankShashank (Salesforce Developers) 
Please let me know if you are still facing this issue or if you found a solution.
This still happens when User standard controller is used with an extension
ShashankShashank (Salesforce Developers) 
This has been identified by Salesforce R&D and they are working on a fix for it. As a workaround, please create/use another user to do the same as it seems to be user specific.
Prathap I am :)Prathap I am :)
Even I am getting the same error for the below page and i observed that it is generating when we use standard controller as "User" object.
Please let me know if we find anyother workarounds.

<apex:page standardController="User" extensions="HSvc_UserFAPConfigurationController" showHeader="false" sidebar="false">

Error: common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

Natalie GuntherNatalie Gunther
Any additional information on this? I'm on api version 35 and I get this error, preventing me from being able to save my page....Rrrrgh.
ShashankShashank (Salesforce Developers) 
It is still being worked upon. I will leave a note for the product team to expedite. As a workaround, Saving the same code via the Setup menu works.
Renan MoreiraRenan Moreira
Interesting coincedence that this scenarios is required for October 2015 Advance Dev certification assignment. 
Still broken as of today.  I have a page that's been in-use for years that I can't modify.
Ale ManciniAle Mancini
For me it doesn't work  neither in the setup menu, because it looks for the method only in the controller and not in the extensions, the result is that can't find the variable "UserStandardController.VariableName". Very annoying
We are also facing similar issue with Idea standardcontroller and extensions...

Sample 1
ext. Controller:
public class IdeaDetail_XT {
    public HROIdeaDetail_XT (ApexPages.IdeaStandardController controller) {}
VF page:
<apex:page standardController="Idea">
    <!-- nothing here -->

Sample 2
ext. Controller:
public class HROIdeaHome_XT {
    public HROIdeaHome_XT(ApexPages.IdeaStandardSetController controller) {
        //nothing here
VF page:
<apex:page sidebar="false" standardController="Idea">
   <!-- nothing here -->

Both samples produce the same error when VF page is saved: 
common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

NOTE: Tried in 3 different sandboxes (two production orgs), same result.

Thomas EkstrandThomas Ekstrand
Still seeing this issue. Seems like such a ridiculous oversight. The only solution for now is to go through the editor under Visualforce Pages in setup(Which currently takes anywhere from 10 seconds to 5 minutes to load...)
Jorge Ortega TraversoJorge Ortega Traverso
I was facing this issue for a while, but it was my fault, beacuse my VF Page was requiring an extension controller, and I changed my controller to be a Custom controller, by removing the ApexPages.StandardSetController constructor.
Sailakshmi Madhuri GurujuSailakshmi Madhuri Guruju
Even I'm facing the same issue when i use controller extension with my standardController as Contact Object in Cf page.
Are these experiences related to the following known issue?
Tooling API - Bytecode Exception from Tooling API with VF Component
Attempt to save a VF page or a VF component via Tooling API and you will get this compiler exception: java.lang.ClassCastException: common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType

I've encountered a similar error that seems related to the Tooling API:

Visualforce Page
<apex:page >
  <c:ListComponent var="c">
    <p><apex:outputText value="{!c.Id}"/></p>
Visualforce Component
<apex:component controller="ComponentListController">
  <apex:attribute name="var" type="String" assignTo="{!var}"/>
  <apex:repeat var="child" value="{!children}">
    <apex:componentBody >
      <apex:variable var="{!var}" value="{!child}"/>
Error Message on Compile
common.apex.runtime.bytecode.BytecodeExecutionContext cannot be cast to common.apex.runtime.impl.Execution
My Workaround
My Apex controller saves fine, but to save the Visualforce, I have to go old-school and use the editing pane from the setup menu.
Still an issue for me.
This is now an issue for me with Knowledgebase article controller on the CS83 instance. Suddenly appeared and very annoying.
To specify my error message: common.apex.runtime.bytecode.BytecodeApexObjectType cannot be cast to common.apex.runtime.impl.ApexType