The VirtualPageConfiguration use class attributes but it can have several values.
For example, we have a virtual page defined for user directory, and there is not specific configuration for skin A, there is a specific configuration for skin B, and another for skin C.
We can test the virtual configuration existence for skin B, then go to skin A and having an NPE because does not contain the same values anymore.
Steps to reproduce (a little bit random)
Launch an indexation of a site with virtual page (like ODF root page).
In the same time, go to another site, with another skin, but also with an ODF root page, and browse the virtual pages.
You can get an NPE like this:
2025-01-22 09:22:08,492 ERROR [org.ametys.cms.content.indexing.solr.SolrIndexer] (AmetysRuntimeScheduler_Worker-6;) Failed to index page course://licence-langues-litteratures-et-civilisations-etrangeres-et-regionales-espagnol-3LCE20_217/unite-de-parcours-de-l-ue5-PAR1607E/professorat-des-ecoles-PDE1604U?rootId=page://57b989ae-d17a-4b7f-b5b9-3b5f74065ae6&courseId=courseContent://3938cc25-3eb5-42c9-a81d-ea27fc692430&programId=programContent://f478d18e-5b6a-4bf1-ba4c-06786da44eb8 in workspace defaultjava.lang.NullPointerException: Cannot invoke "org.ametys.web.repository.page.virtual.VirtualZoneConfiguration.getId()" because "this._configuration" is null
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZone.<init>(ConfigurableVirtualZone.java:61)
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZoneFactory.createZone(ConfigurableVirtualZoneFactory.java:89)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZone(AbstractConfigurableVirtualPage.java:186)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZones(AbstractConfigurableVirtualPage.java:196)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastDate(SolrPageIndexer.java:720)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastMajorValidationDate(SolrPageIndexer.java:704)
at org.ametys.web.indexing.solr.SolrPageIndexer._populateDatesOfPage(SolrPageIndexer.java:422)
at org.ametys.web.indexing.solr.SolrPageIndexer._populatePageDocument(SolrPageIndexer.java:364)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:248)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer.indexPage(SolrPageIndexer.java:219)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemap(SolrSiteIndexer.java:427)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemaps(SolrSiteIndexer.java:399)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSite(SolrSiteIndexer.java:215)
at org.ametys.web.indexing.solr.SolrSiteIndexer.indexSite(SolrSiteIndexer.java:145)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.ametys.runtime.plugin.component.PluginsComponentManager$ComponentInvocationHandler.invoke(PluginsComponentManager.java:199)
at jdk.proxy3/jdk.proxy3.$Proxy25.indexSite(Unknown Source)
at org.ametys.web.indexing.solr.SolrWebWorkspaceIndexer.doIndex(SolrWebWorkspaceIndexer.java:115)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer._forceWorkspaceAndDoIndex(SolrWorkspaceIndexer.java:208)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer.indexAllWorkspaces(SolrWorkspaceIndexer.java:155)
at org.ametys.cms.indexing.GlobalWorkspaceIndexerSchedulable._doExecute(GlobalWorkspaceIndexerSchedulable.java:52)
at org.ametys.cms.schedule.AbstractSendingMailSchedulable.execute(AbstractSendingMailSchedulable.java:82)
at org.ametys.core.schedule.AmetysJob.execute(AmetysJob.java:157)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2025-01-22 09:22:08,492 ERROR [org.ametys.cms.content.indexing.solr.SolrIndexer] (AmetysRuntimeScheduler_Worker-6;) Failed to index site laboratoire-lbcm in workspace default
org.ametys.cms.indexing.IndexingException: Failed to index page course://licence-langues-litteratures-et-civilisations-etrangeres-et-regionales-espagnol-3LCE20_217/unite-de-parcours-de-l-ue5-PAR1607E/professorat-des-ecoles-PDE1604U?rootId=page://57b989ae-d17a-4b7f-b5b9-3b5f74065ae6&courseId=courseContent://3938cc25-3eb5-42c9-a81d-ea27fc692430&programId=programContent://f478d18e-5b6a-4bf1-ba4c-06786da44eb8 in workspace default at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:276)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer.indexPage(SolrPageIndexer.java:219)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemap(SolrSiteIndexer.java:427)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemaps(SolrSiteIndexer.java:399)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSite(SolrSiteIndexer.java:215)
at org.ametys.web.indexing.solr.SolrSiteIndexer.indexSite(SolrSiteIndexer.java:145)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.ametys.runtime.plugin.component.PluginsComponentManager$ComponentInvocationHandler.invoke(PluginsComponentManager.java:199)
at jdk.proxy3/jdk.proxy3.$Proxy25.indexSite(Unknown Source)
at org.ametys.web.indexing.solr.SolrWebWorkspaceIndexer.doIndex(SolrWebWorkspaceIndexer.java:115)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer._forceWorkspaceAndDoIndex(SolrWorkspaceIndexer.java:208)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer.indexAllWorkspaces(SolrWorkspaceIndexer.java:155)
at org.ametys.cms.indexing.GlobalWorkspaceIndexerSchedulable._doExecute(GlobalWorkspaceIndexerSchedulable.java:52)
at org.ametys.cms.schedule.AbstractSendingMailSchedulable.execute(AbstractSendingMailSchedulable.java:82)
at org.ametys.core.schedule.AmetysJob.execute(AmetysJob.java:157)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NullPointerException: Cannot invoke "org.ametys.web.repository.page.virtual.VirtualZoneConfiguration.getId()" because "this._configuration" is null
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZone.<init>(ConfigurableVirtualZone.java:61)
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZoneFactory.createZone(ConfigurableVirtualZoneFactory.java:89)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZone(AbstractConfigurableVirtualPage.java:186)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZones(AbstractConfigurableVirtualPage.java:196)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastDate(SolrPageIndexer.java:720)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastMajorValidationDate(SolrPageIndexer.java:704)
at org.ametys.web.indexing.solr.SolrPageIndexer._populateDatesOfPage(SolrPageIndexer.java:422)
at org.ametys.web.indexing.solr.SolrPageIndexer._populatePageDocument(SolrPageIndexer.java:364)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:248)
... 24 more
2025-01-22 09:22:08,495 ERROR [org.ametys.cms.content.indexing.solr.SolrIndexer] (AmetysRuntimeScheduler_Worker-6;) Error indexing the workspace 'default'.
org.ametys.cms.indexing.IndexingException: Failed to index site laboratoire-lbcm in workspace default
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSite(SolrSiteIndexer.java:246)
at org.ametys.web.indexing.solr.SolrSiteIndexer.indexSite(SolrSiteIndexer.java:145)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.ametys.runtime.plugin.component.PluginsComponentManager$ComponentInvocationHandler.invoke(PluginsComponentManager.java:199)
at jdk.proxy3/jdk.proxy3.$Proxy25.indexSite(Unknown Source)
at org.ametys.web.indexing.solr.SolrWebWorkspaceIndexer.doIndex(SolrWebWorkspaceIndexer.java:115)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer._forceWorkspaceAndDoIndex(SolrWorkspaceIndexer.java:208)
at org.ametys.cms.indexing.solr.SolrWorkspaceIndexer.indexAllWorkspaces(SolrWorkspaceIndexer.java:155)
at org.ametys.cms.indexing.GlobalWorkspaceIndexerSchedulable._doExecute(GlobalWorkspaceIndexerSchedulable.java:52)
at org.ametys.cms.schedule.AbstractSendingMailSchedulable.execute(AbstractSendingMailSchedulable.java:82)
at org.ametys.core.schedule.AmetysJob.execute(AmetysJob.java:157)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.ametys.cms.indexing.IndexingException: Failed to index page course://licence-langues-litteratures-et-civilisations-etrangeres-et-regionales-espagnol-3LCE20_217/unite-de-parcours-de-l-ue5-PAR1607E/professorat-des-ecoles-PDE1604U?rootId=page://57b989ae-d17a-4b7f-b5b9-3b5f74065ae6&courseId=courseContent://3938cc25-3eb5-42c9-a81d-ea27fc692430&programId=programContent://f478d18e-5b6a-4bf1-ba4c-06786da44eb8 in workspace default at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:276)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:287)
at org.ametys.web.indexing.solr.SolrPageIndexer.indexPage(SolrPageIndexer.java:219)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemap(SolrSiteIndexer.java:427)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSitemaps(SolrSiteIndexer.java:399)
at org.ametys.web.indexing.solr.SolrSiteIndexer._indexSite(SolrSiteIndexer.java:215)
... 13 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.ametys.web.repository.page.virtual.VirtualZoneConfiguration.getId()" because "this._configuration" is null
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZone.<init>(ConfigurableVirtualZone.java:61)
at org.ametys.web.repository.page.virtual.ConfigurableVirtualZoneFactory.createZone(ConfigurableVirtualZoneFactory.java:89)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZone(AbstractConfigurableVirtualPage.java:186)
at org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage.getZones(AbstractConfigurableVirtualPage.java:196)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastDate(SolrPageIndexer.java:720)
at org.ametys.web.indexing.solr.SolrPageIndexer._getLastMajorValidationDate(SolrPageIndexer.java:704)
at org.ametys.web.indexing.solr.SolrPageIndexer._populateDatesOfPage(SolrPageIndexer.java:422)
at org.ametys.web.indexing.solr.SolrPageIndexer._populatePageDocument(SolrPageIndexer.java:364)
at org.ametys.web.indexing.solr.SolrPageIndexer._indexPage(SolrPageIndexer.java:248)
... 24 more
[{"id":-1,"name":"My open issues","jql":"assignee = currentUser() AND resolution = Unresolved order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-2,"name":"Reported by me","jql":"reporter = currentUser() order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-4,"name":"All issues","jql":"order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-5,"name":"Open issues","jql":"resolution = Unresolved order by priority DESC,updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-9,"name":"Done issues","jql":"statusCategory = Done order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-3,"name":"Viewed recently","jql":"issuekey in issueHistory() order by lastViewed DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-6,"name":"Created recently","jql":"created >= -1w order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-7,"name":"Resolved recently","jql":"resolutiondate >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-8,"name":"Updated recently","jql":"updated >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false}]
When memory caches are reset, the VirtualPageConfiguration does not work correctly anymore.