Opened 5 years ago

Closed 5 years ago

#2187 closed defect (fixed)

ClassCastException when trying to create a new item

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.15.1
Component: web Version:
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

UPDATE It seems that the same error can happen in many other places as well if a filter is present in a column that is listing a linked item. For example, in the "Samples" list if there is a filter in the "Protocol" or "Kit" column.

If there is a filter on the "Plugin definition" column in the "Plugin configurations" list when the "New" button is clicked in order to create a new configuration a popup window is opened with an error message:

class java.lang.String cannot be cast to class net.sf.basedb.core.Type ...
java.lang.ClassCastException net.sf.basedb.clients.web.Base.getFirstMatching( org.apache.jsp.admin.pluginconfigurations.edit_005fconfiguration_jsp._jspService( org.apache.jasper.runtime.HttpJspBase.service(

The error goes away if the filter in the "Plugin definition" column is removed.

Change History (2)

comment:1 by Nicklas Nordborg, 5 years ago

Description: modified (diff)
Summary: ClassCastException when trying to create a new plug-in configurationClassCastException when trying to create a new item

comment:2 by Nicklas Nordborg, 5 years ago

Resolution: fixed
Status: newclosed

In 7733:

Fixes #2187: ClassCastException when trying to create a new item

It seems like the issue was caused by a side-effect to the changes made in [7605] #2151. The introduction of implicit casting to the PropertyFilter.getValueAsObject() caused the compiler to select the Expressions.parameter(String, Type) method instead of the Expressions.parameter(String, Object) method. Solved by using Expressions.parameter(String, Object, Type) instead.

Note: See TracTickets for help on using tickets.