[SalesForce] ‘java.io.StreamCorruptedException: invalid type code: 00’ Error during new VF page creation

I am getting the following visualforce error while trying to save a new/existing visual force page. java.io.StreamCorruptedException: invalid type code: 00.

I use Notepad++ to edit the markup. While trying to save it to the VF page sometimes I encounter this situation. Has anybody got some clue where I go wrong?

I copy/paste the source from Notepad++ to web-based page editor.

Below is the source for your reference. (Changed the business object names)

<apex:page controller="mycontroller" extensions="extone,exttwo" showheader="false" title="foo" standardstylesheets="false">
<head>
    <title>foo</title>
</head>

<!--***************** For enabling JQuery validations compatible with IE9 ***************** -->
<apex:outputText escape="false" value="{!'<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE8\" />'}"/>
<apex:outputText escape="false" value="{!'<ext:ResourcePlaceHolder runat=\"client\" Mode=\"Style\" />'}"/>

<!--***************** Redirecting to foo page starts***************** -->
<form id="submitForm" name="submitForm"  method="post" action=" ">
    <input type="hidden" id="hdnfooid" name="fooid" />
    <input type="hidden" id="hdnaction" name="action" />
</form>
<!--***************** Redirecting to foo page ends ***************** -->

<apex:form id="theForm"> 

    <!--***************** Adding Page Header component starts***************** -->
    <c:PageHeader sObject="{!sec}" />

    <apex:stylesheet value="{!URLFOR($Resource.Styles, 'CSS/PageStyles.css')}" />

    <div class="menu_div">
    <center>
        <div class="menu_center_div">
            <c:Menu sControlValue="{!obj}" CurrentMenuItem="foo" CId="{CId}" />
        </div>    
    </center>
    </div>
    <!--***************** Adding Page Header component ends ***************** -->

    <!--***************** CSS and for base information in all the pages (Ex: Menu, Header, cimage, etc.)***************** -->
    <apex:stylesheet value="{!URLFOR($Resource.Styles, 'CSS/ExportExcel.css')}" />
    <apex:stylesheet value="{!URLFOR($Resource.Styles, 'CSS/' + browserType + '_StyleSheet.css')}" />
    <apex:stylesheet value="{!URLFOR($Resource.Styles, 'CSS/' + browserType + '_HomeLayoutStyleSheet.css')}" />
    <!--***************** CSS and for base information in all the pages ends ***************** -->

    <!--***************** JQuery Framework reference starts ***************** -->
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/jquery-1.7.2.min.js')}"  />

    <!--*****************  CSS and JavaScript files for using Jquery functionalities like grid with Paging, sorting, etc. - Starts -->
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/jquery.jqGrid.min.js')}"  />
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/json2.js')}"  />
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/underscore-min.js')}"  />
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/backbone-min.js')}"  />
    <apex:includeScript value="{!URLFOR($Resource.JQGrid, '/js/grid.locale-en.js')}"  />

    <!--***************** CSS and JavaScript files for using Jquery functionalities like grid with Paging, sorting, etc. - Ends -->
    <apex:stylesheet value="{!URLFOR($Resource.JQGrid, '/css/jquery-ui-1.8.20.custom.css')}"  />
    <apex:stylesheet value="{!URLFOR($Resource.JQGrid, '/css/ui.jqgrid.css')}"  />

    <apex:includeScript value="{!URLFOR($Resource.test, '/JS/foo.js')}"  />
    <!--***************** JQuery Framework reference starts ends ***************** -->

    <!--***************** Script Functions***************** -->
    <script type="text/javascript">
        "use strict";

        //JS variable to hold the controller variable values in javascript
        var PageVariables = new Object();
        setJSVariablesWithApexVariableValues();

        //Assign controller properties to javascript object
        function setJSVariablesWithApexVariableValues()
        {
            PageVariables.sPrefix = '{!$Prefix}';
            PageVariables.selectedTab = '{!sTab}';

            SetVariableValues(PageVariables);
        }
    </script>

    <!--***************** HTML content begins ***************** -->           
    <body class="body" onload="pageload();callNavigationProperty();">                
        <center>

            <!--***************** Loading image ends ***************** -->
            <div id="loadingStatus">
                <div class="centeredAlt">
                    <img style="loadingStatusdivimg" src="{!URLFOR($Resource.Styles, 'CSS/Images/loading.gif')}" />
                    <br />
                    Loading....         
                </div>
            </div>
            <!--***************** Loading image ends ***************** -->

            <apex:pageMessages />

            <div id="companyId" class="emptydiv">{!cId}</div>
            <div id="maincontent" class="shadow shadowdiv" >
                <div id="Navcontainer">
                    <div class="Navcontainerdiv">
                        <c:SiteNavigation id="NavigationComponents" sObject="{!sec}" SelectedMenuItem="foo"/> 
                    </div>
                    <!--pnlHeader Starts-->                
                    <div class="errorbox" id="errorbox"><ul></ul></div>
                    <!--pnlHeader Ends--> 
                </div>

                <!--***************** Information Bar starts ***************** -->
                <apex:outputPanel id="errorMsg" rendered="{!RenderInfoBar}">
                    <div id="informationBar">
                        <div>
                            <apex:outputText value="{!errMsg}" styleclass="infoText"/>
                        </div>
                    </div>
                </apex:outputPanel>
                <!--***************** Information Bar ends ***************** -->

                <!--***************** Popup panel while Requesting a foo ***************** -->   
                <div id="declinePanel" style="display:none;">
                    <div id="simplemodal-overlay" class="simplemodal-overlay" style="opacity: 0.5;filter:alpha(opacity=50); height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 1001;"></div>
                    <div style="width:100%; float:left;">
                        <div style="width:600px; margin:0 auto;">
                            <div id="simplemodal-container" class="simplemodal-container" style="position: fixed; top:20%; z-index: 1002; height: 260px; width: 600px; margin:0 auto;">
                            <a title="Close" class="modalCloseImg modal_box_close" onclick="docCancel()"></a>
                            <div tabindex="-1" class="simplemodal-wrap" style="height: 100%; outline: 0px none; width: 100%; overflow: visible;">
                                <div style="" id="user-request-reject-dialog" class="simplemodal-data">
                                    <div id="popUpTitle" Class="popUpTitle">
                                        <span>Request a foo</span>
                                    </div>
                                    <div id="popUpTextAreaDiv" style="margin:0px 30px 5px 0px;">
                                        <apex:inputTextarea id="popUpTextArea" cols="40" rows="20" styleClass="popUpTextArea" value="{!requestfoo}" />
                                        <apex:outputText id="popUpErrorText" style="display:none;padding:5px;color:red;" value="Please enter reason for request."></apex:outputText>
                                    </div>
                                    <div id="popUpButtonDiv">
                                        <apex:commandButton id="decline_popUp_Submit" value="Submit" action="{!Requestfoo}" onclick="return fooSubmit();" style="margin-right:5px;"/>
                                        <input type="button" id="decline_popUp_Cancel" value="Cancel" class="cancel" onclick="docCancel()" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    </div>
                </div>
                <!--***************** Popup panel while Requesting a foo starts***************** -->

                <!--***************** foo sub tabs starts ***************** -->

                <br /><br /><br /><br />
                <div class="inner_tabs clearfix">
                    <div id="ALL" class="inner_tab inactivetab"  onclick="j$('[id$=errorMsg]').hide();setSelectedTab('ALL');"><span >ALL ({!AllfoosCount})</span></div>
                    <div id="foo1" class="inner_tab inactivetab" style="display:{! IF((obj.View||obj.all),'block','none')};" onclick="j$('[id$=errorMsg]').hide();setSelectedTab('foo');"><span >foo ({!foocount})</span></div>               
                </div>
                <!--***************** foo sub tabs ends ***************** -->
            </div>

            <div class="fullwidth">
                <div class="fullwidth_div" >
                    <!--***************** Export to Excel starts ***************** -->   
                    <center>
                        <apex:commandLink id="ExportLink" value="Export" styleClass="ExportExcel emptydiv" onClick="setselectedtabvalue1(seltab, 'Excel');" onComplete="getJQGridurl();">  
                            <apex:actionFunction name="setselectedtabvalue1" rerender="RenderInfoBar" timeout="600000" action="{!saveExportList}" >
                                <apex:param name="selectedtab" value="" assignTo="{!selectedTab}"/>
                                <apex:param name="returnType" value="" assignTo="{!returnType}"/>
                            </apex:actionFunction>
                        </apex:commandLink>
                    </center>
                    <!--***************** Export to Excel section end ***************** -->   

                    <a class="glyphLink right fooLinkFirst" style="display:{!IF((obj.Request && Usr=='xxx'),'block','none')};" onclick="requestfoo();return false" >Request a foo</a>
                </div>
            </div>

            <!--***************** Tracking starts ***************** -->  
            <div class="emptydiv">
                <apex:outputPanel id="testpanel" rendered="true"></apex:outputPanel>
                <apex:actionFunction action="{!dosth}" name="dosth" rerender="testpanel" status="donesth" timeout="600000">
                    <apex:param name="fooid" assignTo="{!ID}" value="" />
                    <apex:param name="Title" assignTo="{!Name}" value="" />
                    <apex:param name="Link" assignTo="{!Link}" value="" />
                </apex:actionFunction>
                <apex:actionStatus id="donesth">
                    <apex:facet name="start"></apex:facet>
                    <apex:facet name="stop"></apex:facet>
                </apex:actionStatus>
            </div>

            <br />
            <br />
            <div id="GridDiv">

                <!--***************** Asset Grid starts ***************** -->       
                <table id="objectList"></table>
                <div id="objectListpager2"></div>

            </div>    

            <!--***************** Asset Grid ends ***************** -->
            <apex:outputpanel id="EmptyDiv" styleclass="emptydiv">
                <div class="Emptyouterdiv">
                    <div class="Emptyinnerdiv">
                    Sorry, we did not find any results. 
                    </div>
                </div>
            </apex:outputpanel>

        </center>

        <div class="footerdiv">
            <!--***************** Footer Component starts ***************** --> 
            <center>
                <div class="footerdivdiv">
                    <c:FooterMenu sControlValue="{!Obj}" CId="{!CId}" sMatrixId="{!MatrixId}" />
                </div>
            </center>
        </div>
    <!--***************** Footer Component ends ***************** -->
    </body>

    <apex:pagemessages ></apex:pagemessages>

</apex:form>
</apex:page>

Best Answer

This is not an issue in your code. I usually get a similar Null Pointer Exception error that you got.

Error: Java.lang.NullPointerException
Error: null

I tried saving the page again after a couple of minutes and it got saved.

This might work for you too.

Related Topic