URL Rewriter not working after install through essentials (V.14.6.0)

Hi!

We are interested in using the url rewriter plugin in our project (Hippo URL Rewriter – Introduction).

We are on V14.6.0

We followed the standard essentials installation procedure and restarted the server in a local environment to get it going like we have done with many other features in the past.

Triple-checked bootstrapping was set to true (it always is in our local environments) but nothing shows up on the CMS as shown below

We also went through the installation instructions here

https://bloomreach-forge.github.io/url-rewriter/install.html

and noticed a few missing bits here and there that were added (cms module pom changes were not made by essentials)

After re-bulding and restarting we didn’t find any error or exceptions in the console logs but neither see the URL Rewriter interface.

Any ideas would be highly appreciated

After further review, we have noticed that this error shows up in the console logs:

[INFO] [talledLocalContainer] 05.11.2021 16:09:07 WARN  main [AbstractApplicationContext.refresh:591] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.onehippo.forge.rewriting.repo.RewritingManager' defined in class path resource [META-INF/hst-assembly/overrides/urlrewriter-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'configurationLocation' of bean class [org.onehippo.forge.rewriting.repo.RewritingManager]: Bean property 'configurationLocation' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
[INFO] [talledLocalContainer] 05.11.2021 16:09:07 ERROR main [DefaultHstSiteConfigurer.initializeComponentManager:282] HstSiteConfigurer: ComponentManager initialization failed.
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.onehippo.forge.rewriting.repo.RewritingManager' defined in class path resource [META-INF/hst-assembly/overrides/urlrewriter-context.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'configurationLocation' of bean class [org.onehippo.forge.rewriting.repo.RewritingManager]: Bean property 'configurationLocation' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Checking the urlrewriter-context.xml file generated by essentials, we notice there is a configurationLocation record as shown below:

<bean id="contentPath" class="java.lang.String">
    <constructor-arg type="java.lang.String" value="/content/urlrewriter"/>
  </bean>
  <bean id="configurationLocation" class="java.lang.String">
    <constructor-arg type="java.lang.String" value="/hippo:configuration/hippo:modules/urlrewriter/hippo:moduleconfig"/>
  </bean>

  <!-- add RewritingManager -->
  <bean id="org.onehippo.forge.rewriting.repo.RewritingManager" class="org.onehippo.forge.rewriting.repo.RewritingManager">
    <property name="rewritingRulesExtractors">
      <list>
        <bean class="org.onehippo.forge.rewriting.repo.AdvancedRulesExtractor"/>
        <bean class="org.onehippo.forge.rewriting.repo.RulesExtractor"/>
        <bean class="org.onehippo.forge.rewriting.repo.XmlRulesExtractor"/>
      </list>
    </property>
    <property name="repository" ref="javax.jcr.Repository"/>
    <property name="credentials" ref="javax.jcr.Credentials.hstconfigreader"/>
    <property name="rewriteRulesLocation" value="#{contentPath}"/>
    <property name="configurationLocation" value="#{configurationLocation}"/>
  </bean>

but the value it refers to (/hippo:configuration/hippo:modules/urlrewriter/hippo:moduleconfig) does not exist in the console.

Any clue on how should that node look like?

Hi,
The node /hippo:configuration/hippo:modules/urlrewriter should’ve been bootstrapped by the hippo-addon-urlrewriter-module-repository.jar so you can look there what it should be. But there’s more configuration to be done, can’t tell why the bootstrapping didn’t work.

Also the org.onehippo.forge.rewriting.repo.RewritingManager seems to be recognized however lacking the #setConfigurationLocation method… can it be that an older version of the URL rewriter was already installed?

HTH
Jeroen

Hi @jeroen.hoffman!

Noticed that there was one error during installation when installing using essentials (version 14.6.0 is installed apparently) and since that one gave errors, we were trying to install version 2.2.0 by following the instructions in the forge page for the plugin.

Unfortunately those instructions seem to be out of date.

Rewiewed and fixed the error thrown during essentials installations and things seem to be there now

Screen Shot 2021-11-08 at 16.31.59

we only have to start using it now to see if it works as expected.

Thanks for your assistance