ootbee-support-tools icon indicating copy to clipboard operation
ootbee-support-tools copied to clipboard

solrHost exception during startup of Alfresco

Open Pipirongu opened this issue 4 years ago • 4 comments

BUG

Installing the OrderOfTheBee AMPs will generate exception about solrHost during bootup of Alfresco:

2020-06-05 17:26:15,594 INFO [management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Starting 'Search' subsystem, ID: [Search, managed, solr] 2020-06-05 17:26:15,679 WARN [management.subsystems.ChildApplicationContextFactory$ChildApplicationContext] [localhost-startStop-1] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solrAdminClient' defined in URL [jar:file:/srv/tomcat/alfrescorepo/webapps/alfresco/WEB-INF/lib/alfresco-repository-7.134.1.jar!/alfresco/subsystems/Search/solr/solr-search-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'solrHost' of bean class [org.alfresco.repo.solr.SOLRAdminClient]: Bean property 'solrHost' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? 2020-06-05 17:26:16,177 WARN [management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Startup of 'Search' subsystem, ID: [Search, managed, solr] failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solrAdminClient' defined in URL [jar:file:/srv/tomcat/alfrescorepo/webapps/alfresco/WEB-INF/lib/alfresco-repository-7.134.1.jar!/alfresco/subsystems/Search/solr/solr-search-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'solrHost' of bean class [org.alfresco.repo.solr.SOLRAdminClient]: Bean property 'solrHost' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1718) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ApplicationContextState.start(ChildApplicationContextFactory.java:824) at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098) at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.setPropertiesInternal(AbstractPropertyBackedBean.java:748) at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.setProperties(AbstractPropertyBackedBean.java:903) at org.orderofthebee.addons.support.tools.repo.config.PropertyBackedBeanPersister.initializeFromPersistedProperties(PropertyBackedBeanPersister.java:312) at org.orderofthebee.addons.support.tools.repo.config.PropertyBackedBeanPersister.handleNewPropertyBackedBean(PropertyBackedBeanPersister.java:286) at org.orderofthebee.addons.support.tools.repo.config.PropertyBackedBeanPersister.onApplicationEvent(PropertyBackedBeanPersister.java:228) at org.alfresco.repo.management.subsystems.DefaultPropertyBackedBeanRegistry.broadcastEvent(DefaultPropertyBackedBeanRegistry.java:173) at org.alfresco.repo.management.subsystems.DefaultPropertyBackedBeanRegistry.onApplicationEvent(DefaultPropertyBackedBeanRegistry.java:216) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:195) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) at org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap.onBootstrap(DictionaryRepositoryBootstrap.java:659) at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186) at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:614) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1823) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'solrHost' of bean class [org.alfresco.repo.solr.SOLRAdminClient]: Bean property 'solrHost' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243) at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426) at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278) at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1714) ... 50 more

Expected behavior

Expected that Alfresco would boot and work with the OrderOfTheBee support tools

Actual behavior

Solr1 exception is generated

Steps to reproduce the behavior

Install the AMPs to the war files and start the server.

Additional details (analysis so far, log statements, references, etc.)

I tried to set up a local environment on my computer with all the AMPs that are on the server and OOTB Support Tools didn't generate this issue.

This server was formerly on an Enterprise version of Alfresco and has been migrated to Community. It's a clone of the production server. I inspected the JMX settings in admin console for the production server(which currently runs Enterprise) and noticed that solr1, solr4 settings are set. Could this be causing the issue? If so should I have used JMX to wipe the settings before migrating?

Pipirongu avatar Jun 05 '20 19:06 Pipirongu

This server was formerly on an Enterprise version of Alfresco and has been migrated to Community. It's a clone of the production server. I inspected the JMX settings in admin console for the production server(which currently runs Enterprise) and noticed that solr1, solr4 settings are set. Could this be causing the issue? If so should I have used JMX to wipe the settings before migrating?

This is precisely what is causing this issue. Well, this and a configuration regression issue in Alfresco 6.2. OOTBee Support Tools has read-support for legacy JMX configuration of Alfresco Enterprise, and these settings are triggering our persister to try and apply the custom configuration on the affected subsystems, which indirectly causes them to be started (Alfresco design flaw: there is no way to set properties without starting a subsystem and no way to reliably check if the subsystem should be active at all).

Can you please set the following configuration in alfresco-global.properties and try again with OOTBee Support Tools? ootbee-support-tools.propertyBackedBeanPersister.useLegacyJmxKeysForRead=false

This setting will disable our support for legacy JMX configuration set and thus should avoid SOLR 1 subsystem to be triggered.

AFaust avatar Jun 05 '20 20:06 AFaust

Adding the configuration to alfresco-global.properties didn't change the outcome. Same SOLR1 error message in the log.

Pipirongu avatar Jun 06 '20 16:06 Pipirongu

Hmm.... that should not be the case unless these JMX properties have now also already been stored in the OOTBee-specific attributes. If you do not need the feature to set subsystem properties at runtime, you can also try to disable it completely by using ootbee-support-tools.propertyBackedBeanPersister.enabled=false, so that you can proceed with your main project without being stumped by this side effect of having old JMX data. I would have to find a way to get some legacy JMX in a local system to try and reproduce the issue (disablement of legacy JMX not working), which might take some time.

AFaust avatar Jun 06 '20 19:06 AFaust

Thanks, I went ahead and used ootbee-support-tools.propertyBackedBeanPersister.enabled=false to bypass the issue.

Pipirongu avatar Jun 09 '20 00:06 Pipirongu