SmartGWT Version: v11.0p_2016-09-27/LGPL Development Only
Browser: IE11
Not a Server issue
We just tried upgrading from a 5.0p build to 6.0p and started getting an exception in some of our code that was working with the older build. The code is below, but basically it attempts to get the criteria from a ListGrid and then determine if a Record object matches that criteria before adding the new record. The code snippet looks like (this code is in a class derived from ListGrid):
The code exceptions on the line "c.addCriteria(criteria).
It appears to be dying in the addCriteria class in the last line of code where it tries to cast the incoming parameter to an AdvancedCriteria object:
The log out from the exception looks like:
Notice that the criteria object I got back from the grid shows that isAdvanced is true, but it is not an instance of an AdvancedCriteria object. This doesn't correct. The JSON representation seems to indicate that it is an AdvancedCriteria object.
Help would be appreciated.
Browser: IE11
Not a Server issue
We just tried upgrading from a 5.0p build to 6.0p and started getting an exception in some of our code that was working with the older build. The code is below, but basically it attempts to get the criteria from a ListGrid and then determine if a Record object matches that criteria before adding the new record. The code snippet looks like (this code is in a class derived from ListGrid):
Code:
Criteria criteria = getCriteria(); Criterion c = new Criterion(); try { // HACK-POG: We are getting some strange cast exceptions on this addCriteria call so protecting against them c.addCriteria(criteria); if (dataSource.evaluateCriterion(entry.getRecord(), c)) { addRecords.add(entry.getRecord()); } else { logger.finer("PMTableListGrid-" + gridId + ": Record " + recordId + " does not match criteria, ignoring add/update"); } } catch (Throwable caught) { logger.log(Level.WARNING, "PMTableListGrid-" + gridId + ": Record " + recordId + " unexpected error evaluating criteria:\n" + "c.isAdvanced(): " + criteria.isAdvanced() + ", c instanceof AdvancedCriteria: " + (criteria instanceof AdvancedCriteria) + "\n" + JSON.encode(criteria.getJsObj()), caught); addRecords.add(entry.getRecord()); }
It appears to be dying in the addCriteria class in the last line of code where it tries to cast the incoming parameter to an AdvancedCriteria object:
Code:
public void addCriteria(Criteria c) { if (!c.isAdvanced() && !(c instanceof AdvancedCriteria)) { addCriteria(c.asAdvancedCriteria()); } else { addCriteria((AdvancedCriteria)c); } }
Code:
clientHost: 15.86.204.43, clientUser: PC-DEMO-LATEST\Unicorn, PMTableListGrid-jvJobsListGrid: Record a5a26e5ec21c4d9b807572b9b6a1e8c7 unexpected error evaluating criteria: c.isAdvanced(): true, c instanceof AdvancedCriteria: false { "operator":"and", "criteria":[ { "operator":"and", "criteria":[ { "fieldName":"job_status", "operator":"iNotEqual", "value":"Completed" }, { "fieldName":"job_status", "operator":"iNotEqual", "value":"Aborted" } ] }, { "fieldName":"job_deleting", "operator":"iEquals", "value":"false" } ], "_constructor":"AdvancedCriteria" } <log4j:throwable><![CDATA[java.lang.ClassCastException at Unknown.fillInStackTrace(Throwable.java:116) at Unknown.Throwable(Throwable.java:55) at Unknown.Exception(Exception.java:25) at Unknown.RuntimeException(RuntimeException.java:25) at Unknown.ClassCastException(ClassCastException.java:23) at Unknown.dynamicCast(Cast.java:59) at Unknown.addCriteria_1(Criterion.java:482) at Unknown.run_69(PMTableListGrid.java:754) at Unknown.fire_3(Timer.java:135) at Unknown.anonymous(Timer.java:139) at Unknown.apply_0(Impl.java:247) at Unknown.entry0(Impl.java:299) at Unknown.anonymous(Impl.java:72) ]]></log4j:throwable>
Help would be appreciated.
Comment