+ Start a Discussion
SFDC-SDSFDC-SD 

An internal server error has occurred - Lets see who wins! Dev Boards Vs Salesforce Support

 

 

public with sharing class IP_Authorization
{   
    private List<account> IPList;
    public List<account> CIDRList; 
    public Boolean ipFound = false;       
    private string Input_IP4{get; set;}

    public PageReference p = ApexPages.currentPage();
    public string IP_PatternV4='^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$';
    
//******************************************//    
    public pagereference VerifyIP()
    {
        Input_IP4=System.currentPageReference().getParameters().get('checkip');                              
        Boolean isValidIP = Pattern.matches(IP_PatternV4,Input_IP4); 
                                 
        if (isValidIP)                 
        {   
            integer SearchIP=0;            
            SearchIP=[SELECT COUNT() FROM account WHERE                               Static_IP_Address__c=:Input_IP4                                                           
            if( SearchIP > 0 )
            {   
                ipFound= true;                                    
            }
            else 
            {                
                ipFound=false;   
            }
        }                  
        if (ipFound) 
        {
             p.getHeaders().put('Found','200');
             ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, '200'));             
         }
         else    
         {
             p.getHeaders().put('NotFound','404');
             ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, '404'));              
         }    
        return p;
    }
}

I am receiving a IP from a client, salesforce has to verify if the IP is present in account and return back response 200 if IP

found. My TestClass runs good without any issues but when I try to access the VF page with it fails. Strange thing is it works fine in Developer Edition but it fails in Sandbox.

 

Below is my visualforce page I created to test this from controller.

 

<apex:page Controller="IP_Authorization" tabStyle="account" action="{!VerifyIP}">
<apex:pageMessages id="error"/>
</apex:page>

 

This is the error I got when I try to see the VF page.

 

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 Salesforce Support. 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.com!

Error ID: 1932924520-1277 (-2086038583) 

 

Best Answer chosen by Admin (Salesforce Developers) 
SFDC-SDSFDC-SD

This is an issue with Salesforce API version 26(Winter 13).

 

Below is the workaround...

I have used a edited a Class that was using Salesforce API version 25 and copied my new code to it and deployed, it worked fine. If you directly create this class in version 26 it still fails.

 

I have logged a case on 10/05/2012 and I am still waiting for them to resolve this issue.

All Answers

sfdcfoxsfdcfox

You code appears sound, and I see no particular reason why it would fail. If you had betting pools, I'd say that Salesforce Support will win. After all, they get debug logs that we mere mortals do not get to see, usually in the form of a Java stack trace from an unhandled exception.

SFDC-SDSFDC-SD

This is an issue with Salesforce API version 26(Winter 13).

 

Below is the workaround...

I have used a edited a Class that was using Salesforce API version 25 and copied my new code to it and deployed, it worked fine. If you directly create this class in version 26 it still fails.

 

I have logged a case on 10/05/2012 and I am still waiting for them to resolve this issue.

This was selected as the best answer