3

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.

hutingung
  • 1,800
  • 16
  • 25
  • "Could not find", seems like somebody either altered your code, or, after six months, there is finally a flag that allows a method call to a method it can't find. – Stultuske Nov 24 '15 at 08:28
  • 1
    Are you sure that your declaration is correct? One case says ` – Alexander Nov 24 '15 at 08:37
  • @Stultuske . the source code didn't change by anyone. – hutingung Nov 24 '15 at 12:57
  • @Alexander I think declaration is correct because that is only the logging message in error log. I can't simulate the error after restart server even same process executed. – hutingung Nov 24 '15 at 12:57
  • @hutingung: if ( today equals 24th november ) runA(); else runB(); here is an example where it might explain that it only goes wrong now. – Stultuske Nov 24 '15 at 13:09
  • @Stultuske . Based on the xml declaration, I don't see this condition. – hutingung Nov 24 '15 at 13:30
  • neither do I, then again, I don't see a single line of Java code. – Stultuske Nov 24 '15 at 13:31
  • @Stultuske ofbiz java delegator will call productGenericPermission as declared in ProductServices.xml and productGenericPermission will call checkProductRelatedPermission. You can take a look at ProductServices.xml – hutingung Nov 24 '15 at 14:21

2 Answers2

0

The declaration in your xml is with "method-name". The error message says you are missing a tag with "name".

Si mo
  • 969
  • 9
  • 24
  • That is the error message in log only. Refer to new update. I posted the method declaration in ProductServices.xml. – hutingung Nov 24 '15 at 12:58
0

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.

hutingung
  • 1,800
  • 16
  • 25