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
kickingboykickingboy 

Visualforce - An internal server error has occurred

A previously working Visualforce page now generates the following error message 

 

An internal server error has occurred

An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@emea.salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using Salesforce! 

Error ID: 984984142-6331 (-2071334022)

 

Run a second time it generated

 

n internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@emea.salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using Salesforce! 

Error ID: 984984142-6374 (-2071334022)

I get nothing in the  debug log. I am guessing that the last 4 digits are the error occurrence and that 984984142 is the internal error code which indicates which part of the interpreter generated the exception. Anyone any idea what is causing this?

 

I have raised a case 02763249

 

 

<apex:page controller="EquipmentOrderController" tabStyle="Contract"> <apex:outputPanel id="invalidContent" rendered="{!NOT(isValid)}"> <apex:sectionHeader title="Order Equipment" subtitle=""/> <apex:outputPanel layout="block"> <apex:outputText value="The SLA must be approved before you can order equipment."/> <br/> <br/> <apex:outputLink value="/{!sla.Id}">Return to SLA</apex:outputLink> </apex:outputPanel> </apex:outputPanel> <apex:outputPanel id="noRowsContent" rendered="{!AND(isValid,NOT(hasOrderRecs))}"> <apex:sectionHeader title="Order Equipment" subtitle=""/> <apex:outputPanel layout="block"> <apex:outputText value="There is no equipment needed."/> <br/> <apex:outputLink value="/{!sla.Id}">Return to SLA</apex:outputLink> </apex:outputPanel> </apex:outputPanel> <apex:outputPanel id="validContent" rendered="{!AND(isValid,hasOrderRecs)}"> <apex:sectionHeader title="Order Equipment" subtitle="" description=""/> <br/> <apex:form > <apex:outputPanel layout="block"> <apex:outputText style="font-weight: bold" value="{!$Label.Equipment_Order_Point_of_Contact_Name}"/>&nbsp;&nbsp;<apex:outputText value="{!sla.Point_of_Contact__c}"/> </apex:outputPanel> <br/> <br/> <apex:pageBlock title="Equipment Needed"> <apex:pageBlockButtons location="top"> <apex:commandButton value="Order" action="{!order}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:variable var="i" value="0"/> <table class="list" border="0" cellpadding="0" cellspacing="0"> <tr class="headerRow"> <th scope="col" width="10%">Needed</th> <th scope="col" width="10%">New</th> <th scope="col" width="10%">Recovered</th> <th scope="col" width="60%">{!$ObjectType.Equipment_Needed__c.fields.Type__c.label}</th> <th scope="col" width="10%">&nbsp;</th> </tr> <apex:repeat value="{!orderLines}" var="line" id="orderLines"> <tr class="dataRow {!IF(MOD(VALUE(i),2)==0,'even','odd')} {!IF(VALUE(i)==(orderLines.size-1), 'last','')} {!IF(VALUE(i)==0,'first','')}"> <td class="dataCell">{!line.quantity}</td> <td class="dataCell">{!line.ordered}</td> <td class="dataCell">{!line.spacer}{!line.recovered}</td> <td class="dataCell">{!line.lineType}</td> <td class="dataCell"> <apex:commandLink value="Search" action="{!search}"> <apex:param name="searchIndex" value="{!i}" assignTo="{!searchIndex}" /> </apex:commandLink> </td> </tr> <apex:outputPanel rendered="{!line.recoveredEquipment.size > 0}"> <tr class="dataRow {!IF(MOD(VALUE(i),2)==0,'even','odd')} {!IF(VALUE(i)==(orderLines.size-1), 'last','')} {!IF(VALUE(i)==0,'first','')}"> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td colspan="2"> <table class="list" border="0" cellpadding="0" cellspacing="0" align="right"> <apex:variable var="j" value="0"/> <apex:repeat value="{!line.recoveredEquipment}" var="equipment"> <tr class="dataRow {!IF(MOD(VALUE(j),2)==0,'even','odd')} {!IF(VALUE(j)==(line.recoveredEquipment.size-1), 'last','')} {!IF(VALUE(j)==0,'first','')}"> <td class="dataCell"> <apex:commandLink value="Del" action="{!deleteRecoveredEquipment}"> <apex:param name="equipmentLineRemovalIndex" value="{!VALUE(i)}" assignTo="{!equipmentLineRemovalIndex}" /> <apex:param name="equipmentRemovalIndex" value="{!VALUE(j)}" assignTo="{!equipmentRemovalIndex}" /> </apex:commandLink> </td> <td class="dataCell">{!equipment.Name}</td> <td class="dataCell"><apex:outputField value="{!equipment.Store__c}"/></td> <td class="dataCell">{!ROUND(equipment.Store__r.Store_Number__c,0)}</td> <td class="dataCell">{!equipment.Status__c}</td> </tr> <apex:variable var="j" value="{!VALUE(j)+1}"/> </apex:repeat> </table> </td> </tr> </apex:outputPanel> <apex:variable var="i" value="{!VALUE(i)+1}"/> </apex:repeat> </table> </apex:pageBlock> <br/> <apex:pageBlock id="resultsBlock" rendered="{!AND(displayResults, searchResults.size>0)}"> <apex:pageBlockButtons location="top"> <apex:commandButton value="Request Selected" action="{!requestRecoveredEquipment}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!searchResults}" var="result" id="results" rowClasses="odd,even" styleClass="list"> <apex:facet name="caption"> <apex:outputText value="You searched for equipment of type - {!searchTerm}"/> </apex:facet> <apex:column > <apex:inputCheckbox value="{!result.isSelected}"/> </apex:column> <apex:column > <apex:facet name="header">Name</apex:facet> <apex:outputText value="{!result.name}"/> </apex:column> <apex:column > <apex:facet name="header">Distance (km)</apex:facet> <apex:outputText value="{!ROUND(result.distance,2)}"/> </apex:column> <apex:column > <apex:facet name="header">Store</apex:facet> <apex:outputLink value="/{!result.store.Id}">{!result.store.Name}</apex:outputLink> </apex:column> <apex:column > <apex:facet name="header">Store Number</apex:facet> <apex:outputText value="{!ROUND(result.store.Store_Number__c,0)}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <apex:outputPanel layout="block" rendered="{!AND(displayResults, searchResults.size=0)}"> Sorry, your search returned no results. </apex:outputPanel> </apex:form> </apex:outputPanel></apex:page>

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
yagnayagna

I faced this problem, and I thought something was going wrong with my VF. But on scratching my head I found that a fundamental design change has hit me hard. 

 

Initially I was initializing a list of Product2 using a SOQL statement. But due to a change in requirement I had to change the initialization to Database.getQueryLocator(). 

 

When I made this change I didnt realise that I had a dependency for this change (To be frank, at that point of time I didnt realise that there can be a dependency).

 

Example:

Before:

 

// Below code does not throw an error.

 

List<Product2> queriedRecords = [select id,name from product2 limit 10];

 queriedRecords.clear();

 

// Below code does not throw an exception. But when the method is invoked it simply takes you to a "Internal Server error page"

 

ApexPages.standardSetController productListSetCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryBuildMethod()));; 

 

 List<Product2> queriedRecords = new List<Product2>((List<Product2>)productListSetCon.getRecords());

  queriedRecords.clear();

 

That is because (may be) SFDC keeps a cursor open and when you try to clear it, it just says, you are doing something that you shouldnt do !

 

But I hope SFDC give a clear and informative error message. It would have saved me lot of time finding this guy out !! 

Message Edited by yagna on 02-01-2010 05:25 AM

All Answers

wesnoltewesnolte

Hey

 

I get these from time to time but they usually fix themselves in a few minutes. There's one that I've gotten that is a bug, but that only occurs if you are trying to remove a managed package.

 

Cheers,

Wes 

kickingboykickingboy

For me it occurs everytime. I have tested it on both the sandbox and the live org. I suspect that SFDC have recently made a change to VF which is tripping up on this legacy VF code. I have seen other posts which suggest problems connected with output panel but none seem exactly the same.

 

Stuart 

mallikammallikam

You usually run into these when your code is having run time errors or exceptions...I would

suggest using try catch blocks whereever possible or wherever you have doubts about the code..

kickingboykickingboy

I dont understand how I can do that in Visualforce. Although there is a custom controller I dont think that it is getting as  far as  calling any of its methods. In fact I have just tried to save the VF page and its failing with the following exception java.lang.NumberFormatException but does not tell me which line is causing the error. I now suspect that the problem is caused by an implicit type conversion that was allowed (when it worked) but is no longer allowed.

 

Stuart

mallikammallikam
I know... I have never tried doing that yet either and I also wonder how the exceptions could help because I did not get to that point(writing exceptions) because as soon as I hit that internal server error I could just figure out which part of my caused it...but if your code is too big to figure, you have to rely on exceptions I guess...you can give it a try by writing try catch blocks from examples, building the code and then running the page..
wesnoltewesnolte

Yeah you won't be able to debug this one, and if you're getting Java exceptions you can be quite sure that something in the underlying system is being weird. I'd say try chase them up on the case you've logged, otherwise I don't think there's much you can do. Sorry man.

 

Wes

kickingboykickingboy

At the moment I am commenting out bits of the VF page to find out which line is causing the problem. I have seen on another thread that an illegal type cast causes an internal server error so I hope that will turn out to be the problem here. Otherwise I am not holding my breath for an SFDC fix.

Stuart

kickingboykickingboy

Here is the line that is causing the problem. It is used to iterate a local variable within a repeat block.

<apex:variable var="j" value="{!VALUE(j)+1}"/>

 

I am guessing that when this code was written the implied type of j was text but that it is now number because  the compiler accepts the following:

 

<apex:variable var="j" value="{j+1}"/>

wesnoltewesnolte
Very good! well done. Old school debugging :)
yagnayagna

I faced this problem, and I thought something was going wrong with my VF. But on scratching my head I found that a fundamental design change has hit me hard. 

 

Initially I was initializing a list of Product2 using a SOQL statement. But due to a change in requirement I had to change the initialization to Database.getQueryLocator(). 

 

When I made this change I didnt realise that I had a dependency for this change (To be frank, at that point of time I didnt realise that there can be a dependency).

 

Example:

Before:

 

// Below code does not throw an error.

 

List<Product2> queriedRecords = [select id,name from product2 limit 10];

 queriedRecords.clear();

 

// Below code does not throw an exception. But when the method is invoked it simply takes you to a "Internal Server error page"

 

ApexPages.standardSetController productListSetCon = new ApexPages.StandardSetController(Database.getQueryLocator(queryBuildMethod()));; 

 

 List<Product2> queriedRecords = new List<Product2>((List<Product2>)productListSetCon.getRecords());

  queriedRecords.clear();

 

That is because (may be) SFDC keeps a cursor open and when you try to clear it, it just says, you are doing something that you shouldnt do !

 

But I hope SFDC give a clear and informative error message. It would have saved me lot of time finding this guy out !! 

Message Edited by yagna on 02-01-2010 05:25 AM
This was selected as the best answer
SteveBowerSteveBower

Quick questions:  

 

Is it the case that queryBuildMethod is returning a String? 

 

Are you sure that it's returning any records instead of throwing an error?

 

How do you know it's barfing on the Clear()?  I presume that if you comment it out the rest of the code works?

 

Best Steve.

 

yagnayagna

Hi Steve,

 

I get that error if I try to tamper with the List, but I used a System.debug statement to  check that the query returned some records. I was able to print them out, but wasnt able to tamper with the list.

  

Message Edited by yagna on 02-01-2010 10:45 PM
SteveBowerSteveBower

Yep, you're right.  It makes a certain amount of sense when you realize it's all being passed by reference, but, as you said, it should give a better response than just throwing an internal error.

 

Either way, I don't think there is anyway around this other than creating your own copy of the list with:

 

mylist = setController.getrecords().deepclone(true)

 

 

Best, Steve.

yagnayagna
try..catch blocks dont catch these errors. I just had some system.debug's in place and figured out a possible reason. I am not really sure if thats the right reason, if some SFDC guy can confirm my assumption that would be great.
kickingboykickingboy

I am not sure this will help but as I started the thread I feel I should reply. It turned out that the problem that I experienced was caused by Salesforce changing the underlying data type to Double from Integer in a maintenance release.

So much for regression testing eh!