I have repeatedly this error in ofbiz.log
:
Error running the simple-method: Could not find <simple-method name="checkProductRelatedPermission"> in XML document
This is weird, because I have a declaration of this method in my ProductServices.xml
: <simple-method method-name="checkProductRelatedPermission" short-description="Check Product Related Permission">
I didn't have this error before and the system was running properly for the pass 6 months. (currently product index is increasing)
Is it related to insufficient memory allocated for ofbiz? Because the server is running on limited memory.
[Update]
This is the service declaration in 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>
Execution of <call-simple-method method-name="checkProductRelatedPermission"/>
throw an exception.
If I restart the server, the same execution of the process won't throw this exception. The error happened after user heavily enter new product and update product. I can see heavy lucene process in the log.
I increased the server memory from 2GB to 4GB, java memory Xmx:1024m to Xmx:1512. Currently the ofbiz is still running properly after 6 hours monitor.
[Update]
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"));
Ouput is simple-method which means the method is found.
Beside, same process execute over thousand and error thrown after thousands execution (randomly). Sometime after few hours, sometime after few days.
Nothing wrong with the configuration. The problem is JobSandbox (createAlsoBoughtProductAssocs) have to many running instance, pending and queued instance. Those jobs consume all memory and make cpu usage high. Removed createAlsoBoughtProductAssocs jobs and problem disappeared.