You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Sergei (JIRA)" <ji...@apache.org> on 2011/03/27 23:06:05 UTC

[jira] [Commented] (OFBIZ-4231) User login : system does not have related Party

    [ https://issues.apache.org/jira/browse/OFBIZ-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011841#comment-13011841 ] 

Sergei commented on OFBIZ-4231:
-------------------------------

Thanks for your answer,

of course I have handled this in my application, however it can be the
potential problem:
you install OFBiz, import SEED data model, setup email but mail sending
works with problems, because of the "system" party is in the DEMO data
model. So this is not obvious and you need to make an investigation, because
you have an entity engine problem where the partyId= null.





-- 
Best regards,
Sergei Biletnikov


> User login : system does not have related Party
> -----------------------------------------------
>
>                 Key: OFBIZ-4231
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4231
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: Release Branch 10.04
>         Environment: Data scope: SEED
>            Reporter: Sergei
>            Assignee: Jacques Le Roux
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I faced a problem, which will appear for the seed db initialization (not demo)!!! 
> I have setup email sending for order confirmation, the each new email has  the attachment in PDF. During the mail sending chain of services are called (via callback events) and in the end of the chain these services are called:
>     <!-- dataresource role ecas -->
>     <eca service="createDataResourceRole" event="invoke">
>         <action service="ensurePartyRole" mode="sync" run-as-user="system"/>
>     </eca>
>     <service name="ensurePartyRole" engine="simple"
>             location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="ensureNaPartyRole" auth="false">
>         <description>Ensure that the party is in the specified role.</description>
>         <attribute name="partyId" type="String" mode="IN" optional="true"/>
>         <attribute name="roleTypeId" type="String" mode="IN" optional="false"/>
>     </service>
> as you can see these services are called by "system" UserLogin.
> ensurePartyRole - throws an exception, because of partyId = null. I researched db model, and found that the UserLogin "system" exists, but without a party. 
> However, these methods are called after the mail was sent, but the overall transaction is rollbacked, so the next retries fire the same problems, as result we have 3 retries and 3 mails in the mailbox.
> To fix this problem, I have created the "system" party and associated it with the UserLogin (I got it from the Demo data):
>     <!-- Party for System UserLogin Account - just in case logic depends on it -->
>     <Party partyId="system" partyTypeId="PERSON"/>
>     <Person partyId="system" firstName="System" lastName="Account"/>
>     <!-- various automated processes will cause it to be put in this role anyway -->
>     <PartyRole partyId="system" roleTypeId="PACKER"/>
>     <UserLogin userLoginId="system" partyId="system"/>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira