Ofbiz error: Could not find simple-method

Ofbiz error: Could not find simple-method

我在ofbiz.log中多次出现这个错误:

Error running the simple-method: Could not find <simple-method name="checkProductRelatedPermission"> in XML document

这很奇怪,因为我在 ProductServices.xml 中声明了此方法:<simple-method method-name="checkProductRelatedPermission" short-description="Check Product Related Permission">

我以前没有遇到过这个错误,系统 运行 在 6 个月内正常运行。 (目前产品指数正在增加)

是否与ofbiz分配的内存不足有关?因为服务器 运行 内存有限。

[更新]

这是ProductServices.xml

中的服务声明
<simple-method method-name="productGenericPermission" short-description="Main permission logic">
        <set field="mainAction" from-field="parameters.mainAction"/>
        <if-empty field="mainAction">
            <add-error>
                <fail-property resource="ProductUiLabels" property="ProductMissingMainActionInPermissionService"/>
            </add-error>
            <check-errors/>
        </if-empty>

        <set field="callingMethodName" from-field="parameters.resourceDescription"/>
        <set field="checkAction" from-field="parameters.mainAction"/>
        <call-simple-method method-name="checkProductRelatedPermission"/>

        <if-empty field="error_list">
            <set field="hasPermission" type="Boolean" value="true"/>
            <field-to-result field="hasPermission"/>

            <else>
                <property-to-field resource="ProductUiLabels" property="ProductPermissionError" field="failMessage"/>
                <set field="hasPermission" type="Boolean" value="false"/>
                <field-to-result field="hasPermission"/>
                <field-to-result field="failMessage"/>
            </else>
        </if-empty>
    </simple-method>

执行<call-simple-method method-name="checkProductRelatedPermission"/>抛出异常。

如果我重启服务器,同样的进程执行不会抛出这个异常。该错误发生在用户大量输入新产品和更新产品后。我可以在日志中看到大量的 lucene 进程。

我将服务器内存从 2GB 增加到 4GB,java 内存 Xmx:1024m 增加到 Xmx:1512。目前ofbiz在6小时监控后仍然运行正常。

[更新]

java.net.URL url = new java.net.URL("file:/home/ofbiz/ofbiz/applications/product/script/org/ofbiz/product/product/ProductServices.xml");
System.out.println(org.ofbiz.minilang.SimpleMethod.getSimpleMethod(url, "checkProductRelatedPermission"));

输出是simple-method,表示找到方法。

此外,同一进程执行了数千次,执行数千次后抛出错误(随机)。有时几个小时后,有时几天后。

您的 xml 中的声明与 "method-name" 一致。错误消息说您缺少带有 "name" 的标签。

配置没有问题。问题是 JobSandbox (createAlsoBoughtProductAssocs) 有很多 运行 个实例、挂起和排队的实例。这些作业会消耗所有内存并使 cpu 使用率很高。 删除了 createAlsoBoughtProductAssocs 作业,问题就消失了。