There was a need to upgrade our Hybris version from 2211.37 to 2211.41. In this new version, it includes Solr 9.8. There were some issues before I managed to run both build and deploy successfully. I was able to access HAC, Backoffice and SmartEdit which wasn't working before I did some fixes. I still can't access Solr as seen below. I'm still using the same link I used before this upgrade. I thought, maybe, I need to index first. I tried that and also got an error.
I came upon this thread, Indexing problem with SOLR (MultiMaxScoreQParserPlugin). I saw that MultiMaxScoreQParserPlugin is from solr-hybris-components-<version_of_solr>.jar. I checked this directory, /home/username/company/CX-2211/hybris/bin/modules/search-and-navigation/solrserver/resources/solr/9.8/server/modules/hybris/lib and it contains the jar file with version, 9.8.4.
I also saw this page from SAP, https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/aa417173fe4a4ba5a473c93eb730a417/6847333812f04dafb020841a61ab5ec2.html. I tried following it based on my understanding of what needs to change. Below, you can see the actions I did.
MOVED analysis-extras AND hybris FROM
/home/username/company/CX-2211/hybris/bin/modules/search-and-navigation/solrserver/resources/solr/9.8/server/modules
TO /home/username/company/commerce/core-customize/_SOLR_/server/solr/modules
REMOVE BELOW FROM /home/username/company/commerce/core-customize/_SOLR_/server/solr/configsets/default/conf/solrconfig.xml
<lib dir="${solr.install.dir:../../../..}/analysis-extras/lib" regex=".*.jar" />
<lib dir="${solr.install.dir:../../../..}/hybris/lib" regex=".*.jar" />
ADD IN /home/username/company/commerce/core-customize/_SOLR_/server/solr/configsets/default/conf/solr.xml
<str name="modules">${solr.modules:analysis-extras,hybris}</str>
I've been working on this issue for 2 days now. Hope someone can help. Thanks in advance.
Issue when not following the help page
ERROR [full-dppretailIndex-cronJob::de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob] (full-dppretailIndex-cronJob) [SolrStandaloneSearchProvider] Error from server at https://localhost:8983/solr: Error CREATEing SolrCore 'master_dppretail_Product_flop': Unable to create core [master_dppretail_Product_flop] Caused by: de.hybris.platform.solr.search.MultiMaxScoreQParserPlugin
org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at https://localhost:8983/solr: Error CREATEing SolrCore 'master_dppretail_Product_flop': Unable to create core [master_dppretail_Product_flop] Caused by: de.hybris.platform.solr.search.MultiMaxScoreQParserPlugin
at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:729) ~[solr-solrj-9.8.0.jar:9.8.0 8bf0100e502ade4b8161e4b90f762b117a6ef442 - anshum - 2025-01-13 21:29:10]
at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:264) ~[solr-solrj-9.8.0.jar:9.8.0 8bf0100e502ade4b8161e4b90f762b117a6ef442 - anshum - 2025-01-13 21:29:10]
at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:243) ~[solr-solrj-9.8.0.jar:9.8.0 8bf0100e502ade4b8161e4b90f762b117a6ef442 - anshum - 2025-01-13 21:29:10]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider$ClusterSolrClient.request(SolrStandaloneSearchProvider.java:503) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.solr.impl.CachedSolrClient.request(CachedSolrClient.java:64) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider$ClusterSolrClient$ClusterNodeSolrClient.request(SolrStandaloneSearchProvider.java:562) ~[solrfacetsearchserver.jar:?]
at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:279) ~[solr-solrj-9.8.0.jar:9.8.0 8bf0100e502ade4b8161e4b90f762b117a6ef442 - anshum - 2025-01-13 21:29:10]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider.clusterRequest(SolrStandaloneSearchProvider.java:341) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider.doCreateIndex(SolrStandaloneSearchProvider.java:303) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider.createIndex(SolrStandaloneSearchProvider.java:155) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:79) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.executeAfterPrepareListeners(DefaultIndexerContextFactory.java:161) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.prepareContext(DefaultIndexerContextFactory.java:90) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.AbstractIndexerStrategy.doExecute(AbstractIndexerStrategy.java:151) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.AbstractIndexerStrategy.execute(AbstractIndexerStrategy.java:119) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerService.performFullIndex(DefaultIndexerService.java:61) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.SolrIndexerJob.indexItems(SolrIndexerJob.java:71) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.SolrIndexerJob.performIndexingJob(SolrIndexerJob.java:50) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.AbstractIndexerJob.perform(AbstractIndexerJob.java:33) [solrfacetsearchserver.jar:?]
at de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob.performCronJob(ServicelayerJob.java:31) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.performCronJobWithReadOnlySetting(Job.java:1494) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1429) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:821) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job$JobRunable.run(Job.java:689) [processingserver.jar:?]
at de.hybris.platform.util.threadpool.PoolableThread.internalRun(PoolableThread.java:204) [coreserver.jar:?]
at de.hybris.platform.core.threadregistry.RegistrableThread.run(RegistrableThread.java:124) [coreserver.jar:?]
WARN [full-dppretailIndex-cronJob::de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob] (full-dppretailIndex-cronJob) [SolrIndexerJob] Error during indexer call: dppretailIndex
de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException: de.hybris.platform.solrfacetsearch.solr.exceptions.SolrServiceException: Could not create index: index=master_dppretail_Product_flop, nodes=[https://localhost:8983/solr]
at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:90) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.executeAfterPrepareListeners(DefaultIndexerContextFactory.java:161) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory.prepareContext(DefaultIndexerContextFactory.java:90) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.AbstractIndexerStrategy.doExecute(AbstractIndexerStrategy.java:151) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.strategies.impl.AbstractIndexerStrategy.execute(AbstractIndexerStrategy.java:119) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerService.performFullIndex(DefaultIndexerService.java:61) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.SolrIndexerJob.indexItems(SolrIndexerJob.java:71) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.SolrIndexerJob.performIndexingJob(SolrIndexerJob.java:50) [solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.cron.AbstractIndexerJob.perform(AbstractIndexerJob.java:33) [solrfacetsearchserver.jar:?]
at de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob.performCronJob(ServicelayerJob.java:31) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.performCronJobWithReadOnlySetting(Job.java:1494) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1429) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:821) [processingserver.jar:?]
at de.hybris.platform.cronjob.jalo.Job$JobRunable.run(Job.java:689) [processingserver.jar:?]
at de.hybris.platform.util.threadpool.PoolableThread.internalRun(PoolableThread.java:204) [coreserver.jar:?]
at de.hybris.platform.core.threadregistry.RegistrableThread.run(RegistrableThread.java:124) [coreserver.jar:?]
Caused by: de.hybris.platform.solrfacetsearch.solr.exceptions.SolrServiceException: Could not create index: index=master_dppretail_Product_flop, nodes=[https://localhost:8983/solr]
at de.hybris.platform.solrfacetsearch.solr.impl.SolrStandaloneSearchProvider.createIndex(SolrStandaloneSearchProvider.java:162) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.indexer.listeners.IndexerOperationListener.afterPrepareContext(IndexerOperationListener.java:79) ~[solrfacetsearchserver.jar:?]
... 15 more
Issue when following the help page (deploy is also aborting automatically)
Error creating Spring application context. Shutting down hybris platform since the system cannot be used without working Spring context...
shutting down hybris registry..
Invalid multibyte sequence.
Invalid multibyte sequence.
de.hybris.platform.core.UninstantiableCoreApplicationContextException: Error creating Spring application context.
at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:833)
at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:760)
at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:658)
at de.hybris.platform.core.Registry.activateTenant(Registry.java:719)
at de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:568)
at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:627)
at de.hybris.platform.core.Registry.startup(Registry.java:441)
at de.hybris.platform.core.ClassLoaderUtils.executeWithWebClassLoaderParentIfNeeded(ClassLoaderUtils.java:35)
at de.hybris.platform.spring.HybrisContextLoaderListener.startRegistry(HybrisContextLoaderListener.java:353)
at de.hybris.platform.spring.HybrisContextLoaderListener.doInitWebApplicationContext(HybrisContextLoaderListener.java:213)
at de.hybris.platform.spring.HybrisContextLoaderListener.initWebApplicationContext(HybrisContextLoaderListener.java:200)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitializedInternal(HybrisContextLoaderListener.java:97)
at de.hybris.platform.spring.HybrisContextLoaderListener.contextInitialized(HybrisContextLoaderListener.java:92)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4059)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4501)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: org.springframework.beans.FatalBeanException: Context hybris Global Context Factory couldn't be created correctly due to, Error creating bean with name 'defaultSolrServerController' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot read the array length because "libs" is null
at de.hybris.platform.core.HybrisContextFactory.build(HybrisContextFactory.java:308)
at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.buildSelf(HybrisContextFactory.java:179)
at de.hybris.platform.core.HybrisContextFactory$GlobalContextFactory.build(HybrisContextFactory.java:165)
at de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:122)
at de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:101)
at de.hybris.platform.core.HybrisContextHolder.getAppCtxFactory(HybrisContextHolder.java:152)
at de.hybris.platform.core.HybrisContextHolder.getApplicationInstance(HybrisContextHolder.java:78)
at de.hybris.platform.core.AbstractTenant.createCoreApplicationContext(AbstractTenant.java:788)
at de.hybris.platform.core.AbstractTenant.doStartupSafe(AbstractTenant.java:829)
... 24 more
I contacted an expert from SAP. She was able to help me. I had 2 issues. First is the indexing issue. The problem was, I was updating an incorrect solr.xml. I changed /home/username/company/commerce/core-customize/_SOLR_/server/solr/solr.xml
instead of /home/username/company/commerce/core-customize/_SOLR_/server/solr/configsets/default/conf/solr.xml
. The last issue was regarding Solr admin console not accessible even after confirming that Solr is running in local. The expert shared this link, https://community.sap.com/t5/crm-and-cx-q-a/solr-admin-page-connection-refused-after-upgrading-to-9-5-0-and-sap-cx-to/qaq-p/13855922. It turns out that Solr may not be accessible after upgrade in Windows if the server was started in WSL. I haven't tried the solution in the site yet. Since I've already confirmed Solr admin console is now accessible, I will consider this the accepted answer. Hope it can help someone in the future.