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
gireeshzgireeshz 

Deploy error in IDE

Hello all,

I am trying to deploy a class via the Force.com IDE - Summer '08 version.

In the deployment wizard, Step 3, I choose JUST the class that I want to deploy.  When I click the 'Validate deployment' button, the results say the deployment would fail.  This is the error log (names xxx'ed out) :

*** Deployment Log ***
Result: FAILED
Date: July 26, 2008 2:33:42 PM EDT

# Deployed From:
   Project name: Sandbox
   Username: xxx@xxx.com.xxx
   Endpoint: test.salesforce.com

# Deployed To:
   Username: xxx@xxx.com
   Endpoint: www.salesforce.com

# Deploy Results:
   Name:    unpackaged/classes/weeklyStatusQuery.cls
   Action:  NO ACTION
   Result:  FAILED
   Problem: An error occurred on your page.

   Name:    unpackaged/package.xml
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a

# Test Results:
   n/a




The only error indication is 'An error occured on your page'.  This class saves properly (to the Sandbox) through the IDE, the code coverage is above 85%, and it works fine in the Sandbox.  Is there any way of finding out what the 'error on page' is????  This is giving me nothing to go on...

Any help would be greatly appreciated. 

Regards,

Gireesh
gireeshzgireeshz
Update: 

Getting the exact same error from deploy test with ANT:
Code:
Buildfile: build.xml

deployCode:

BUILD FAILED
C:\code\SFant\xxx\build.xml:10: Failures:
classes/weeklyStatusQuery.cls(weeklyStatusQuery):An error occurred on your page.

package.xml(weeklyStatusQuery):An object 'weeklyStatusQuery' of type ApexClass w
as named in manifest but was not found in zipped directory


Total time: 8 seconds

 
what could this 'error occurred on your page' be indicating?  is there any way to know where this error is coming from?

Thanks

gireeshzgireeshz
Okay, here is the code for the class (with the test method at the bottom):

Code:
public class weeklyStatusQuery {
 
 class ReportAccount {
  Account raLine;
  String styleClass; 
    
  public ReportAccount(Account acc) { raLine = acc;} 
  public Account getraLine() { return raLine;}
  
  public void setStyleClass(String styleClass){
   this.styleClass = styleClass; 
  }
  
  public String getStyleClass() {
   if (raLine.Investment_Status__c.equals('Exited')) {
    return 'data1';
   } else if (raLine.Investment_Status__c.equals('Portfolio Company')) { 
    return 'data2';
   } else if(raLine.Investment_Status__c.equals('Signed Term Sheet')) { 
    return 'data3'; 
   } else if(raLine.Investment_Status__c.equals('Terms Proposed')) { 
    return 'data4';
   } else if(raLine.Investment_Status__c.equals('Due Dilligence')) { 
    return 'data5';
   } else if(raLine.Investment_Status__c.equals('Visit- Multiple')) { 
    return 'data6';
   } else if(raLine.Investment_Status__c.equals('Visit - Once')) { 
    return 'data7';
   } else if(raLine.Investment_Status__c.equals('For Discussion')) { 
    return 'data8';
   } else if(raLine.Investment_Status__c.equals('Conference Call')) { 
    return 'data9';
   } else { 
    return 'color:black';
   }
   
  }
  
 }
 
 
 ReportAccount [] RepAccts; 
 
 public List<ReportAccount> getRepAccts(){
  if (RepAccts == null) {
   RepAccts = new ReportAccount[]{};
    for  (Account raLine: getRecords() ) {
     RepAccts.add( new ReportAccount(raLine) ); 
    }
  }
  return RepAccts;
 }
 
 
    private Account[] getRecords() { 
                List<String> reportStatus = new List<String>();
                
                if (ApexPages.currentPage().getParameters().get('type').equals('deal')) { 
                        reportStatus.add('Signed Term Sheet');
                        reportStatus.add('Terms Proposed');
                        reportStatus.add('Due Diligence');
                        reportStatus.add('Visit- Multiple');
                        reportStatus.add('Visit - Once');
                        reportStatus.add('For Discussion');
                        reportStatus.add('Conference Call');
                } else if (ApexPages.currentPage().getParameters().get('type').equals('monitor')) {
                        reportStatus.add('Monitor');
                } else if (ApexPages.currentPage().getParameters().get('type').equals('portfolio')) {
                        reportStatus.add('Portfolio Company');
                } else {
                        reportStatus.add('Exited');
                        reportStatus.add('Portfolio Company');
                        reportStatus.add('Signed Term Sheet');
                        reportStatus.add('Terms Proposed');
                        reportStatus.add('Due Diligence');
                        reportStatus.add('Visit- Multiple');
                        reportStatus.add('Visit - Once');
                        reportStatus.add('For Discussion');
                        reportStatus.add('Conference Call');
                        reportStatus.add('Monitor');
                }                    
                                
        return [Select a.Id, a.Amount_of_Funding__c, a.BillingCity, a.Business_Stage__c, a.Criteria_Beta_Customers__c, a.Criteria_Breakeven__c, a.Criteria_Capital_Efficient__c, a.Criteria_Live_Technology__c, a.Criteria_Management__c, a.Criteria_Mkt_Size__c, a.Criteria_Recurring_Revenue_Model__c, a.Criteria_Revenue__c, a.Criteria_Short__c, a.Criteria_Strong_Partners__c, a.Criteria_TES_BIS__c, a.Date_of_Initial_Contact__c, a.Deal_Monitor_Primary__c, a.Description, a.GSAVP_Proposed_Actual__c, a.Investment_Status__c, a.Name, a.Pre_Money_valuation__c, a.Type, 
                        a.LFY_LTM_Revenue__c, a.Management_Score__c, a.Criteria_Percent__c, a.Criteria_Sum__c, a.Valuation__c, a.Ownership_Percent__c, a.Original_Investment_Date__c, a.vced2__Date_of_Last_Round__c 
                        from Account a WHERE a.Investment_Status__c in :reportStatus  
                        order by a.Investment_Status__c];
    }
 
 public static testMethod void testMyController()  {
      
        ReportAccount [] testRepAccts; 
  String testStyleClass; 
  weeklyStatusQuery controller = new weeklyStatusQuery();
  Account [] testRecords; 
  
  PageReference pageRef = Page.weeklyStatus4;
        Test.setCurrentPage(pageRef);
      
       // Add parameters to page URL
        ApexPages.currentPage().getParameters().put('type', 'deal');
        
        //get the records for this page parameter
  testRepAccts = controller.getRepAccts(); 
  testRecords = controller.getRecords(); 
  testStyleClass = testRepAccts[0].getStyleClass();
        // Verify that page fails without parameters
        System.assert(testRepAccts[0].raLine.Name <> '' );
        System.assert(testStyleClass <> '' );
        System.assert(testRepAccts[0].raLine.Investment_Status__c <> '' );
        system.assert(testRecords[0].Name <> ''); 
        
        
        PageReference pageRef2 = Page.weeklyStatus4;
        Test.setCurrentPage(pageRef2);
       weeklyStatusQuery controller2 = new weeklyStatusQuery();
       // Add parameters to page URL
        ApexPages.currentPage().getParameters().put('type', 'portfolio');
        
        //get the records for this page parameter
  testRepAccts = controller2.getRepAccts(); 
  testStyleClass = testRepAccts[0].getStyleClass();
        // Verify that page fails without parameters
        System.assert(testRepAccts[0].raLine.Name <> '' );
        System.assert(testStyleClass <> '' );
        System.assert(testRepAccts[0].raLine.Investment_Status__c <> '' );
      
      
        PageReference pageRef3 = Page.weeklyStatus4;
        Test.setCurrentPage(pageRef3);
       weeklyStatusQuery controller3 = new weeklyStatusQuery();
       // Add parameters to page URL
        ApexPages.currentPage().getParameters().put('type', 'other');
        
        //get the records for this page parameter
  testRepAccts = controller3.getRepAccts(); 
  testStyleClass = testRepAccts[0].getStyleClass();
        // Verify that page fails without parameters
        System.assert(testRepAccts[0].raLine.Name <> '' );
        System.assert(testStyleClass <> '' );
        System.assert(testRepAccts[0].raLine.Investment_Status__c <> '' );
        
        
        PageReference pageRef4 = Page.weeklyStatus4;
        Test.setCurrentPage(pageRef4);
       weeklyStatusQuery controller4 = new weeklyStatusQuery();
       // Add parameters to page URL
        ApexPages.currentPage().getParameters().put('type', 'monitor');
        
        //get the records for this page parameter
  testRepAccts = controller4.getRepAccts(); 
  testStyleClass = testRepAccts[0].getStyleClass();
        // Verify that page fails without parameters
        System.assert(testRepAccts[0].raLine.Name <> '' );
        System.assert(testStyleClass <> '' );
        System.assert(testRepAccts[0].raLine.Investment_Status__c <> '' );
      
    }    
}

 

gireeshzgireeshz
so, this had become a thread to myself, but hey good for posterity, right?

I found the problem.  My test/coverage class referenced an Apex page that only existed in the Sandbox, not in Production.  When i tried to deploy, the tests presumably didn't run since they couldn't find the page that was referenced.  Once I created a dummy page in production with the same name , the code deployed.

So, I have a few remaining questions for the SF expert community at large:

-shouldn't one of the deploy tools been able to report this error a little bit more verbosely?  I would have been nice to know that this file was the reason for the deploy error, rather than just 'there was an error on your page"

-Should I be  referencing some 'built-in' page name when testing page parameters in a controller?  was it wrong to use the name of an actual file??


thanks!
jgreenejgreene
Hi Gireesh,

I came across the same problem today. I had an Apex test that referenced an Apex Page that did not yet exist in my Production instance. It did not yet exist, because its existence depended on the Apex Class that was being tested :-)

I tried the workaround you suggested and it worked. I created dummy Apex Pages in my production instance. After I did this, I was able to deploy from my Sandbox to my Production instance.

I hope someone can explain whether this is a bug, or whether we're just doing something wrong.

Thanks,
Jeremy
vasanth2009vasanth2009

Yes,we need a proper error message for this error."An Error occured on your page" will not make any sense.

 

I also face similar type of issue,and fixed the same after looking into this thread.

 

Tx

Vasanth