cancel
Showing results for 
Search instead for 
Did you mean: 

2211 Media indexing from backoffice - "getClass() cannot be found on type MediaModel"

nirajkrm
Explorer
0 Kudos

While doing Media indexing from backoffice for migration from 1811 to 2211. I am getting below error.

ERROR [solr indexer thread] [DefaultIndexerWorker] [Indexer worker 0 (FULL index operation on testMediaIndex/Media)] failed to process index items due to Failed to index item with PK 8817274191902: Failed to resolve values for item with PK: 8817274191902, by resolver: springELValueProvider, for property: externalURL, reason: EL1004E: Method call: Method getClass() cannot be found on type de.hybris.platform.core.model.media.MediaModel de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException: Failed to index item with PK 8817274191902: Failed to resolve values for item with PK: 8817274191902, by resolver: springELValueProvider, for property: externalURL, reason: EL1004E: Method call: Method getClass() cannot be found on type de.hybris.platform.core.model.media.MediaModel at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.handleError(DefaultIndexer.java:304) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.indexItems(DefaultIndexer.java:207) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.DefaultIndexerBatchStrategy.executeIndexerOperation(DefaultIndexerBatchStrategy.java:245) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.DefaultIndexerBatchStrategy.execute(DefaultIndexerBatchStrategy.java:210) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.workers.impl.DefaultIndexerWorker.doRun(DefaultIndexerWorker.java:197) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.workers.impl.DefaultIndexerWorker.run(DefaultIndexerWorker.java:153) ~[solrfacetsearchserver.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: de.hybris.platform.solrfacetsearch.config.exceptions.FieldValueProviderException: Failed to resolve values for item with PK: 8817274191902, by resolver: springELValueProvider, for property: externalURL, reason: EL1004E: Method call: Method getClass() cannot be found on type de.hybris.platform.core.model.media.MediaModel at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.handleError(DefaultIndexer.java:662) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.addIndexedPropertyFieldsForOldApi(DefaultIndexer.java:473) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.addIndexedPropertyFields(DefaultIndexer.java:436) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.createInputDocument(DefaultIndexer.java:334) ~[solrfacetsearchserver.jar:?] at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexer.indexItems(DefaultIndexer.java:201) ~[solrfacetsearchserver.jar:?]

I am using the below impex. INSERT_UPDATE SolrIndexedProperty; solrIndexedType(identifier)[unique = true]; name[unique = true]; type(code); sortableType(code); currency[default = false]; localized[default = false]; multiValue[default = false]; useForSpellchecking[default = false]; useForAutocomplete[default = false]; fieldValueProvider; valueProviderParameter; facet[default = false]; ; $solrIndexedMediaType ; externalURL ; string ; ; ; ; ; ; ; springELValueProvider ; getClass().toString().contains("ExternalMedia") ? externalURL : null ; ;

I think it's an issue with spring expression getClass().toString().contains("ExternalMedia"), same expression is working in 1811.

Any suggestions would be appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

nirajkrm
Explorer

This issue is fixed by "solrfacetsearch.fullSpELSupport=true" in local.properties file by default it's false.

romitchhabra
Participant
0 Kudos

Hi Niraj,

Thanks for providing the fix. If you don't mind can you tell how you found out about this solution?