Search code examples
error-handlingofbiz

ofbiz error: primary key error on calling service with ajax


Trying to call this service :

<service name="createExp" default-entity-name="bidExp" engine="java"
            location="org.ofbiz.bidexp.bidExpServices"   
   invoke="createExp"   
   auth="false"> 
    <description>createExp</description>
        <attribute name="partyId"           mode="IN" type="String"   optional="false"/>
        <attribute name="expId"             mode="OUT" type="String"     optional="false"/>
    </service>              

I get this error:

2015-07-08 16:13:41,630 |-0.0.0.0-8443-exec-2 
|PrimaryKeyFinder              |I| Returning null because found     
 incomplete  primary key in find: [GenericEntity:PartyAcctgPrefAndGroup]
[partyId,Company(java.lang.String)][roleTypeId,null()]

And (maybe as a consequence of the error) the ajax result is not success (although the java-service works fine!).

What does the error mean and how can I fix it?


Solution

  • Since you are saying Java service is working fine. I guess your Ajax request does not contain a session. Try to change the controller of the ajax request as below (auth="true")

    <security https="true" auth="true"/>