Download Blaze Trial
Follow FICO
LinkedIn   Twitter   Youtube
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Reply
Contributor
ssah
Posts: 15
Registered: ‎03-13-2012
Accepted Solution

Error: An external class following 'a/an' must have an accessible default constructor

I am using Blaze Advisor 7.0. I am trying to create an object and declare values in it so that I can test my rules. This is the code that I have:

 


recAccountData = a RecAccountData initially { accountData = a AccountData initially {
  creditScore = 100.
  originalTransactionAmount =100 as a BigDecimal.
  }}

 

 

The AccountData class above is declared as an abstract class in the Object model. I am getting the following error for this class when I compile.

 

 

Error: An external class following 'a/an' must have an accessible default constructor.

 

 

 

 

 

 

Kindly advise.

 

Thanks,

Shubham 

Credit Risk Analyst
PayPal, Inc.
Valued Contributor
Posts: 169
Registered: ‎03-12-2009

Re: Error: An external class following 'a/an' must have an accessible default constructor

Hi,

No one else has offered an answer, so I will give it a try. 

 

My thought is that you say that the accountData object is an abstract class.  An abstract class cannot be instantiated.  You will need to subclass it into a a real class that can be instantiated.  Then, another piece of the puzzle is that your class will need a default constructor with no parameters and may have additional constructures which take parameters.

 

Tom Sheckells

Business Rules Consulting, Inc.

Contributor
ssah
Posts: 15
Registered: ‎03-13-2012

Re: Error: An external class following 'a/an' must have an accessible default constructor

Hi Tom,

 

Thanks for the reply. I did try to use a sub-class of the AccountData class. I declare an object of the subclass and am able to instantiate values in it. However, it runs for the first time but second time if throws an exception.

 

Here is my object for the subclass. It is called testCaseConsumer

 

try {
setCreditLine(1000.00).
}
catch an Exception with
{}

 

Here is the exception...

 

Exception:Failed to remove external object 'testCaseConsumer' of class 'testCaseConsumer'.

The object's hash code has probably changed.

 

 

Kindly advise.

 

 

Thanks,

 

Shubham

 

 

 

 

 

Credit Risk Analyst
PayPal, Inc.
DM-Forums Moderator
Posts: 472
Registered: ‎10-02-2008

Re: Error: An external class following 'a/an' must have an accessible default constructor

Try to implement your hashCode/equals according to the contract specified for Java classes: they should be based on immutable properties of the objects. In other words, the values used to compute the hashCode should not be changed during the lifetime of the object. The same applies to equals (hashCode/equals should be based on the same set of properties, pretty much).

 

Regards,

Jostein