1

I'm experiencing the following error during the test phase of a (check-only) ant deployment:

line -1, column -1: Previous load of class failed: ComplimentaryTestDomain: line 1, column 75: Invalid type: CaseDomainFactory.ComplimentaryTest

The "Invalid type" (CaseDomainFactory.ComplimentaryTest) is an inner interface of the following class, defined on the last line:

public class CaseDomainFactory {
    public static Cases createCaseDomain(List<CaseSubmission> caseSubmissionCollection){ 
        Cases caseCollection;
        String caseType = caseSubmissionCollection[0].caseToSubmit.Type;
        if(caseType == 'Duplicate Super Bills'){
            caseCollection = (Cases)DIContainer.getDependency('CaseDomainFactory.DuplicateSBs');
        } 
        else if(caseType == 'Recoupment' || caseType == 'Audit'){
            caseCollection = (Cases)DIContainer.getDependency('CaseDomainFactory.RecoupmentAudit');
        }
        else if(caseType == 'Incorrect Carrier Selected'){
            caseCollection = (Cases)DIContainer.getDependency('CaseDomainFactory.IncorrectCarrierCase');
        }
        else if(caseType == 'Complimentary Test'){
            caseCollection = (Cases)DIContainer.getDependency('CaseDomainFactory.ComplimentaryTest');
        }
        else {
            caseCollection = (Cases)DIContainer.getDependency('Cases');
        }
        caseCollection.construct(caseSubmissionCollection);
        return caseCollection;
    }

    public interface DuplicateSBs extends Cases{}

    public interface RecoupmentAudit extends Cases{}

    public interface IncorrectCarrierCase extends Cases{}

    public interface ComplimentaryTest extends Cases{}
}

The interface is implemented by the following class (from which the error is produced):

public class ComplimentaryTestDomain extends CaseDomain implements Cases, CaseDomainFactory.ComplimentaryTest {
   public override List<CaseSubmission> submit(){
        List<CaseSubmission> caseSubmissions = super.submit();
        ComplimentaryTestApproval approvalService = new ComplimentaryTestApproval(caseSubmissions);
        approvalService.processEmployeeTestCases();
        return caseSubmissions;
    }
}

The interface itself extends the following interface:

public interface Cases {
    void construct(List<CaseSubmission> caseSubmissions);
    List<CaseSubmission> submit();
}

Any information about what might be causing this error would be helpful.

  • What happens if you compile all classes? – Adrian Larson Jul 31 '17 at 19:35
  • 1
    Are the mentioned interfaces and classes part of the ant deployment? – Daniel Ballinger Jul 31 '17 at 19:40
  • Is it because ComplimentaryTestDomain doesn't implement the Cases.submit method? If not, it could be an issue with some cyclical dependencies. For example, class A depends on class B which depends on class C which references class A. We have experienced ANT deployment issues with complex class structures in the past. Is it possible to make Cases an inner interface as well? Alternatively, you could try to make the inner interfaces top level. – Zach Field Jul 31 '17 at 20:38
0

A bad git merge caused the "ApexClass" section of our continuous integration's package.xml to contain a second name tag for a different metadata type. It appears that this caused our new Apex code to not be deployed. Removing the tag resolved the issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.