【发布时间】:2019-04-10 15:17:54
【问题描述】:
目前,我在 ISH 7.9 中遇到了一些自定义 URL 重写规则的问题。
对于我们的某些环境,它可以正常工作(例如本地和测试),但在 ACC 和 PROD 上,它似乎只是在多次部署/重新启动系统后不时工作。
我们创建了一个自定义墨盒,其中包含 deploy.gradle 文件以从原始墨盒中排除文件 urlrewriterules.xml、domainsplittings.xml 和 syndication-targets.properties。它们被share/system/config/cluster 文件夹中的自定义文件替换。 urlrewriterules.xml 中应用的静态规则始终可以正常工作。但是,来自自定义 Java 类的规则有时无法通过 RewriteRuleFactoryImpl 返回以下错误来很好地加载:
[2018-11-07 08:20:37.906 +0100] WARN localhost ES1 appserver0 [ShipSupport-ebusiness-Site] [-] com.intershop.component.urlrewrite.internal.factory.RewriteRuleFactoryImpl [] [Storefront] [wJ5DCcg2CM5DCZPUUqdNu2D2fj8NZHaXjvP9qIZb] [yFAAAFvikjkOsqjA-0-00] "yFAAAFvikjkOsqjA-0-00" An implementation of rewrite rule type 'CustomCategory' does not exist.
urlrewriterules.xml 中将调用此 java 类的部分代码如下:
<!-- Custom Category Rule /c/<NAME_OF_LOWEST_CATEGORY> -->
<rule type="CustomCategory" priority="1000" name="custom category rule">
<configurations>
<configuration id="pathPrefix">/catalog</configuration>
<configuration id="partsCatalogID">4393</configuration>
</configurations>
</rule>
我们还在我们自己的盒式磁带中很好地创建了类,例如扩展BaseRewriteRule 的CustomCategoryRewriteRule。为这些频道启用了 URL 重写,我们始终使启用它的频道中的缓存无效。
CustomCategory 的扩展名(在同一墨盒中定义)定义如下:
<?xml version="1.0" encoding="UTF-8"?>
<extensionpoint:ExtensionPointModel xmlns:extensionpoint="http://www.intershop.de/extensionpoint/2011" name="CustomCategoryRewriteRule">
<extensionBindings type="java" extensionPoint="com.intershop.component.urlrewrite.capi.RewriteRule-RewriteRule.create" extension="com.package.CustomCategoryRewriteRule" priority="1"/>
</extensionpoint:ExtensionPointModel>
app-extension.component 也定义在同一个插件中,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010" scope="global">
<fulfill requirement="selectedCartridge" value="cartridge_name" of="intershop.SLDSystem.Cartridges"/>
<fulfill requirement="selectedCartridge" value="cartridge_name" of="intershop.EnterpriseBackoffice.Cartridges"/>
</components>
我们按照这篇文章来确认如何做到这一点:https://support.intershop.com/kb/index.php/Display/B28069 我们在另一个项目中也可以正常工作,但使用的是 Intershop 7.8。
你知道可能是什么原因吗?
谢谢!
【问题讨论】:
标签: intershop