Adam Heath wrote:
> Jacopo Cappellato wrote:
>> Adam,
>>
>> I've found another error that may be related to the recent framework
>> refactoring.
>> Go to Party-->Create-->Create Customer
>>
>> Fill the foorm and submit, you'll get the following error:
>>
>> ===================================================
>> ERROR: Could not complete the Create User
>> [file:applications/party/script/org/ofbiz/party/user/UserEvents.xml#createUser]
>> process [problem invoking the [createPerson] service with the map named
>> [personContext] containing
>> ...
>> Service target threw an unexpected exception (You must pass an even
>> sized array to the toMap method)]
>> ===================================================
>
> GenericValue statusRec = delegator.makeValue("PartyStatus",
> UtilMisc.toMap("partyId", partyId, "statusId",
> statusId, "statusDate", now));
> 461: invokevirtual #56; //Method
> org/ofbiz/entity/GenericDelegator.makeValue:(Ljava/lang/String;[Ljava/lang/Object;)Lorg/ofbiz/entity/GenericValue;
>
> That sucks *ass*. javac doesn't infer the correct type arguments; so it
> ends up returning a Map<Object, Object>. GenericDelegator doesn't have
> a matching signature for that(it wants a Map<String, Object>), so the
> varargs variant of makeValue is called.
>
> I can fix this, by adding methods to GenericDelegator, but it'll be ugly.
>
> /me kicks javac
Fixed in 586041