This particular ELException
is a wrapper exception. This is usually only thrown when invoking the getter method itself has thrown an exception. Something like the following is happening under the covers when this ELException
is been thrown:
Object bean;
String property;
Method getter;
// ...
try {
getter.invoke(bean);
} catch (Exception e) {
String message = String.format("Error reading '%s' on type %s", property, bean.getClass().getName());
throw new ELException(message, e);
}
You should look further down in the stacktrace for the real root cause. The complete stacktrace is usually just available in server logs. The real root cause is the bottommost exception of the stacktrace. E.g. the below one is caused by a NullPointerException
being thrown in the getter method.
javax.el.ELException: Error reading 'currentlocation' on type **.person.Person
at ...
at ...
at ...
Caused by: java.lang.NullPointerException
at **.person.Person.getCurrentlocation(Person.java:42)
at ...
at ...
The information about the real root cause (the exception type and the line number) should give you enough clues to nail down the problem.
Again, this is not a problem with EL in general. It's just your own code which caused the problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…