I am getting a NullPointerException and cant find the reason why its
doing... looks to me my typecasting is fine...
Please see error line
public void validate(Object domainObject, String action,
MessageAccumulator errors) throws ApplicationException
{
Facility facility = (Facility) domainObject;
String name = facility.getName();
String typeIdentifier =
facility.getFacilityType().getTypeIdentifier(); <b>(error line) </b>
int nameSize = name.length();
FacilityType facilityType =
facilityTypeDAO.findByTypeIdentifier(typeIdentifier);
String facilityTypeId = facilityType.getFacilityTypeId();
:
:
:
}
Facility.java -> getFacilityType(),
FacilityType.java -> getTypeIdentifier()
Any help would be great...Thanks all
Mike Schilling - 21 Jun 2006 21:26 GMT
>I am getting a NullPointerException and cant find the reason why its
> doing... looks to me my typecasting is fine...
[quoted text clipped - 8 lines]
> String typeIdentifier =
> facility.getFacilityType().getTypeIdentifier(); <b>(error line) </b>
Either facility or facility.getFacilityType() is null. Either use a
debugger or println to determine which. Type casting is irrelevant.
> int nameSize = name.length();
> FacilityType facilityType =
[quoted text clipped - 9 lines]
>
> Any help would be great...Thanks all
lordy - 22 Jun 2006 00:45 GMT
>> String name = facility.getName();
>> String typeIdentifier =
>> facility.getFacilityType().getTypeIdentifier(); <b>(error line) </b>
>
> Either facility or facility.getFacilityType() is null. Either use a
> debugger or println to determine which.
The latter.
Lordy
Mike Schilling - 22 Jun 2006 01:04 GMT
>>> String name = facility.getName();
>>> String typeIdentifier =
[quoted text clipped - 4 lines]
>
> The latter.
Yes, of course.