Errors in latest ofbiz trunk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Errors in latest ofbiz trunk

Bilgin Ibryam
Hi guys,

I see lots of errors in latest ofbiz trunk.
Some of them are lilke: java.lang.UnsupportedOperationException: = (=), <>... Not sure which changes cause it.
You can see errors while order creation, or checking the profile of a party.

In order creation from POS, there are errors due to changes in shopping cart  in r585854
Changing LinkedMap to LinkedHashMap cause some errors, because in CheckOutHelper.java there are some code using LinkedMap.get(index) , which is not supported from LinkedHashMap.

Bilgin Ibryam
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
Bilgin Ibryam wrote:

> Hi guys,
>
> I see lots of errors in latest ofbiz trunk.
> Some of them are lilke: java.lang.UnsupportedOperationException: = (=),
> <>... Not sure which changes cause it.
> You can see errors while order creation, or checking the profile of a party.
>
> In order creation from POS, there are errors due to changes in shopping cart
> in r585854
> Changing LinkedMap to LinkedHashMap cause some errors, because in
> CheckOutHelper.java there are some code using LinkedMap.get(index) , which
> is not supported from LinkedHashMap.

Do you have a stack trace?

There is no LinkedMap/LinkedHashMap in CheckOutHelper.  Is that a local
change to your system?  Or do you mean ShoppingCart.java?  There are no
compile errors, so what code is calling LinkedMap.get(index)?
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
In reply to this post by Bilgin Ibryam
Bilgin Ibryam wrote:
> Hi guys,
>
> I see lots of errors in latest ofbiz trunk.
> Some of them are lilke: java.lang.UnsupportedOperationException: = (=),
> <>... Not sure which changes cause it.
> You can see errors while order creation, or checking the profile of a party.
>

I too have noticed that error in the Accounting-->Billing
Accounts-->Invoices screen.
After a few clicks the error disappeared but that screen is not working
as was working before: you see all the invoices in the system, not just
the ones with Invoice.billingAccountId = selected billing account.

Here is the form's action section that is not working as expected:

<actions>
   <entity-condition entity-name="Invoice"
list-name="billingAccountInvoices">
     <condition-expr field-name="billingAccountId"
env-name="billingAccountId"/>
   </entity-condition>
</actions>

Weird.

Jacopo

PS: I did svn up, ant clean-all, ant run-install


> In order creation from POS, there are errors due to changes in shopping cart
> in r585854
> Changing LinkedMap to LinkedHashMap cause some errors, because in
> CheckOutHelper.java there are some code using LinkedMap.get(index) , which
> is not supported from LinkedHashMap.
>
> Bilgin Ibryam
>

Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
In reply to this post by Adam Heath-2
Adam Heath wrote:
> Bilgin Ibryam wrote:
>> Hi guys,
>>
>> I see lots of errors in latest ofbiz trunk.
>> Some of them are lilke: java.lang.UnsupportedOperationException: = (=),
>> <>... Not sure which changes cause it.
>> You can see errors while order creation, or checking the profile of a party.

This is now fixed, at least on party/party content screen, which is
where I first saw it.

Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Bilgin Ibryam
In reply to this post by Adam Heath-2

I get the errors while adding items from POS with lates trunk, w/o any changes.
Here is the patch that i did for CheckOutHelper that uses ShoppingCart and then LinkedMap.get(index).
I didnot create a jira for this patch, becase after the patch is applied, the items are added to cart w/o errors (from POS) but at the order creation i get java.lang.UnsupportedOperationException due to some other chages that i didnot checked.
Here you can see where is used .get(index)

Index: applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
===================================================================
--- applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (revision 585935)
+++ applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (working copy)
@@ -780,9 +783,10 @@
         List shipAmt = new ArrayList(totalItems);
 
         // Debug.logInfo("====== makeTaxContext passed in shipAddress=" + shipAddress, module);
+        Iterator it = csi.shipItemInfo.keySet().iterator();      
         
-        for (int i = 0; i < totalItems; i++) {
-            ShoppingCartItem cartItem = (ShoppingCartItem) csi.shipItemInfo.get(i);
+        for (int i = 0; it.hasNext(); i++) {
+            ShoppingCartItem cartItem = (ShoppingCartItem) it.next();
             ShoppingCart.CartShipInfo.CartShipItemInfo itemInfo = csi.getShipItemInfo(cartItem);
             
             //Debug.logInfo("In makeTaxContext for item [" + i + "] in ship group [" + shipGroup + "] got cartItem: " + cartItem, module);
 

There are some other places in CheckOutHelper like csi.shipItemInfo.get(x)

Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
In reply to this post by Jacopo Cappellato
Jacopo Cappellato wrote:

> Bilgin Ibryam wrote:
>> Hi guys,
>>
>> I see lots of errors in latest ofbiz trunk.
>> Some of them are lilke: java.lang.UnsupportedOperationException: = (=),
>> <>... Not sure which changes cause it.
>> You can see errors while order creation, or checking the profile of a
>> party.
>>
>
> I too have noticed that error in the Accounting-->Billing
> Accounts-->Invoices screen.
> After a few clicks the error disappeared but that screen is not working
> as was working before: you see all the invoices in the system, not just
> the ones with Invoice.billingAccountId = selected billing account.
>
> Here is the form's action section that is not working as expected:
>
> <actions>
>   <entity-condition entity-name="Invoice"
> list-name="billingAccountInvoices">
>     <condition-expr field-name="billingAccountId"
> env-name="billingAccountId"/>
>   </entity-condition>
> </actions>
>
> Weird.

Yeah, I've fix this.  Sorry for that.
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
Adam Heath wrote:

>> <actions>
>>   <entity-condition entity-name="Invoice"
>> list-name="billingAccountInvoices">
>>     <condition-expr field-name="billingAccountId"
>> env-name="billingAccountId"/>
>>   </entity-condition>
>> </actions>
>>
>> Weird.
>
> Yeah, I've fix this.  Sorry for that.

No problem. was it fixed in rev. 585974, right?
Now the error is gone but the screen still shows all the invoices... not
just the ones in the billing account.
Do you think this could be related to the error?

Jacopo
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
Jacopo Cappellato wrote:

> Adam Heath wrote:
>>> <actions>
>>>   <entity-condition entity-name="Invoice"
>>> list-name="billingAccountInvoices">
>>>     <condition-expr field-name="billingAccountId"
>>> env-name="billingAccountId"/>
>>>   </entity-condition>
>>> </actions>
>>>
>>> Weird.
>>
>> Yeah, I've fix this.  Sorry for that.
>
> No problem. was it fixed in rev. 585974, right?
> Now the error is gone but the screen still shows all the invoices... not
> just the ones in the billing account.
> Do you think this could be related to the error?
>
> Jacopo

Something similar is happening in the party detail screen: all the user
logins in the system are shown in the page.

Jacopo
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
In reply to this post by Jacopo Cappellato
Jacopo Cappellato wrote:

> Adam Heath wrote:
>>> <actions>
>>>   <entity-condition entity-name="Invoice"
>>> list-name="billingAccountInvoices">
>>>     <condition-expr field-name="billingAccountId"
>>> env-name="billingAccountId"/>
>>>   </entity-condition>
>>> </actions>
>>>
>>> Weird.
>>
>> Yeah, I've fix this.  Sorry for that.
>
> No problem. was it fixed in rev. 585974, right?
> Now the error is gone but the screen still shows all the invoices... not
> just the ones in the billing account.
> Do you think this could be related to the error?

Well, this eventually does this:

    <form name="ListBillingAccountInvoices" type="list"
list-name="billingAccountInvoices"
paginate-target="BillingAccountInvoices" default-entity-name="Invoice">
        <actions>
            <entity-condition entity-name="Invoice"
list-name="billingAccountInvoices">
                <condition-expr field-name="billingAccountId"
env-name="billingAccountId"/>
            </entity-condition>
        </actions>

While the Invoice entity *does* have a billingAccountId, no invoices in
the demo system set that field.  So, that screen s/b empty.

Still looking...
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
Adam Heath wrote:

> Well, this eventually does this:
>
>     <form name="ListBillingAccountInvoices" type="list"
> list-name="billingAccountInvoices"
> paginate-target="BillingAccountInvoices" default-entity-name="Invoice">
>         <actions>
>             <entity-condition entity-name="Invoice"
> list-name="billingAccountInvoices">
>                 <condition-expr field-name="billingAccountId"
> env-name="billingAccountId"/>
>             </entity-condition>
>         </actions>
>
> While the Invoice entity *does* have a billingAccountId, no invoices in
> the demo system set that field.  So, that screen s/b empty.
>
> Still looking...

Not sure I understand but, the correct expected behavior is to get an
empty list in the demo system (in fact the no invoice has the
billingAccountId set); instead, I see three invoices in the billing
account screen.

Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
In reply to this post by Jacopo Cappellato
Jacopo Cappellato wrote:

> Jacopo Cappellato wrote:
>> Adam Heath wrote:
>>>> <actions>
>>>>   <entity-condition entity-name="Invoice"
>>>> list-name="billingAccountInvoices">
>>>>     <condition-expr field-name="billingAccountId"
>>>> env-name="billingAccountId"/>
>>>>   </entity-condition>
>>>> </actions>
>>>>
>>>> Weird.
>>>
>>> Yeah, I've fix this.  Sorry for that.
>>
>> No problem. was it fixed in rev. 585974, right?
>> Now the error is gone but the screen still shows all the invoices...
>> not just the ones in the billing account.
>> Do you think this could be related to the error?
>>
>> Jacopo
>
> Something similar is happening in the party detail screen: all the user
> logins in the system are shown in the page.

585806 is good, 585807 is bad.  Found the cause, now on to the fix.
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
Adam Heath wrote:

> Jacopo Cappellato wrote:
>> Jacopo Cappellato wrote:
>>> Adam Heath wrote:
>>>>> <actions>
>>>>>   <entity-condition entity-name="Invoice"
>>>>> list-name="billingAccountInvoices">
>>>>>     <condition-expr field-name="billingAccountId"
>>>>> env-name="billingAccountId"/>
>>>>>   </entity-condition>
>>>>> </actions>
>>>>>
>>>>> Weird.
>>>> Yeah, I've fix this.  Sorry for that.
>>> No problem. was it fixed in rev. 585974, right?
>>> Now the error is gone but the screen still shows all the invoices...
>>> not just the ones in the billing account.
>>> Do you think this could be related to the error?
>>>
>>> Jacopo
>> Something similar is happening in the party detail screen: all the user
>> logins in the system are shown in the page.
>
> 585806 is good, 585807 is bad.  Found the cause, now on to the fix.

585018 fixes it.  Sorry again.
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
Adam Heath wrote:
>
> 585018 fixes it.  Sorry again.

I confirm that it is working now, thanks.

Jacopo
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Jacopo Cappellato
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)]
===================================================

Jacopo



Jacopo Cappellato wrote:
> Adam Heath wrote:
>>
>> 585018 fixes it.  Sorry again.
>
> I confirm that it is working now, thanks.
>
> Jacopo

Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Errors in latest ofbiz trunk

Adam Heath-2
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