Opened 3 years ago

Closed 3 years ago

#2265 closed defect (fixed)

Reporter search in Experiment explorer is broken

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.19
Component: core Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

If a search condition is entered an error message is displayed and the list is not filtered. The actual class may very between String, Integer, etc. depending on the data type of the column.

ClassCastException: class java.lang.String cannot 
be cast to class net.sf.basedb.core.Type
.....

In the log file there is a full stacktrace:

java.lang.ClassCastException: class java.lang.String cannot be cast to class net.sf.basedb.core.Type (java.lang.String is in module java.base of loader 'bootstrap'; net.sf.basedb.core.Type is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @45a37759)
	at net.sf.basedb.core.PropertyFilter.getDynamicRestriction(PropertyFilter.java:1264)
	at net.sf.basedb.core.ItemContext.configureQuery(ItemContext.java:1986)
	at net.sf.basedb.clients.web.ExperimentExplorer.getReporterQuery(ExperimentExplorer.java:720)
	at org.apache.jsp.views.experiments.explorer.search.list_jsp._jspService(list_jsp.java:337)
...

Update The same problem is present in other lists as well:

  • Spot data
  • Cloned reporter
  • And possibly in other places that also use the affected API.

Change History (2)

comment:1 by Nicklas Nordborg, 3 years ago

In 8005:

References #2265: Reporter search in Experiment explorer is broken

Seems like the problem was a side-effect from changes in #2207 [7799] that changed the PropertyFilter.getValueAsObject() method to return a parameterized object instead of a plain Object. This caused the compiler to select the Expressions.parameter(String, Type) method instead of the Expressions.parameter(String, Object) method. Fixed by calling the Expressions.parameter(String, Object, Type) method instead.

comment:2 by Nicklas Nordborg, 3 years ago

Component: webcore
Description: modified (diff)
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.