[OJB-developers] oql exception
Brought to you by:
thma
From: Georg S. <ge...@me...> - 2002-03-13 10:10:07
|
Hi, When doing a query like select allX from X where ... and putting an invalid X classname a NullPointerException is thrown in OQLQueryImpl at this.bindIterator = this.flatten(this.query.getCriteria(), new Vector()).iterator(); The reason is that in OQLParser at method fromClause() try { clazz = Class.forName(id.getText(), true, Thread.currentThread().getContextClassLoader()); } catch (Exception e) {} The ClassNotFoundException is simply ignored. I just put throw new TokenStreamException(id.getText() + " is not a valid classname"); into the catch clause, which is then propagated up to the application as a QueryInvalidException, which for me does make sense in this case. Regards Georg |