- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Error: An external class following 'a/an' must have an accessible default constructo r
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-13-2012 05:52 PM
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
PayPal, Inc.
Solved! Go to Solution.
Re: Error: An external class following 'a/an' must have an accessible default constructo r
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Not the Solution
- Email to a Friend
- Report Inappropriate Content
03-14-2012 08:29 PM
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.
Re: Error: An external class following 'a/an' must have an accessible default constructo r
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Not the Solution
- Email to a Friend
- Report Inappropriate Content
03-19-2012 09:53 AM
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
PayPal, Inc.
Re: Error: An external class following 'a/an' must have an accessible default constructo r
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content
03-22-2012 03:55 PM
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

