[jira] [Commented] (OFBIZ-12183) Groovy script Product.groovy: java.util.NoSuchElementException

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

[jira] [Commented] (OFBIZ-12183) Groovy script Product.groovy: java.util.NoSuchElementException

Nicolas Malin (Jira)

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

Giulio Speri commented on OFBIZ-12183:
--------------------------------------

Hi [~nmalin] ,

I think I found something.

In the log files I have those lines
{code:java}
Caused by: java.util.NoSuchElementExceptionCaused by: java.util.NoSuchElementException at java.util.ArrayList$Itr.next(ArrayList.java:854) ~[?:1.8.0_102] at java.util.AbstractList.hashCode(AbstractList.java:540) ~[?:1.8.0_102] at javolution.util.FastMap$Entry.hashCode(FastMap.java:1634) ~[javolution-5.4.3.jar:5.4.3] at javolution.util.FastMap.hashCode(FastMap.java:912) ~[javolution-5.4.3.jar:5.4.3] at javolution.util.FastMap$Entry.hashCode(FastMap.java:1634) ~[javolution-5.4.3.jar:5.4.3] at javolution.util.FastMap.put(FastMap.java:453) ~[javolution-5.4.3.jar:5.4.3] at javolution.util.FastSet.add(FastSet.java:141) ~[javolution-5.4.3.jar:5.4.3] at org.ofbiz.base.util.collections.MapContext.entrySet(MapContext.java:316) ~[ofbiz-base.jar:?] at javolution.util.FastMap.putAll(FastMap.java:648) ~[javolution-5.4.3.jar:5.4.3] at org.ofbiz.base.util.GroovyUtil.getBinding(GroovyUtil.java:100) ~[ofbiz-base.jar:?] at org.ofbiz.base.util.GroovyUtil.runScriptAtLocation(GroovyUtil.java:169) ~[ofbiz-base.jar:?] at org.ofbiz.base.util.GroovyUtil.runScriptAtLocation(GroovyUtil.java:165) ~[ofbiz-base.jar:?] at org.ofbiz.base.util.ScriptUtil.executeScript(ScriptUtil.java:342) ~[ofbiz-base.jar:?] at org.ofbiz.base.util.ScriptUtil.executeScript(ScriptUtil.java:324) ~[ofbiz-base.jar:?]
{code}
The error seems in those lines

*org.ofbiz.base.util.collections.MapContext.entrySet(MapContext.java:316) ~[ofbiz-base.jar:?] at javolution.util.FastMap.putAll(FastMap.java:648) ~[javolution-5.4.3.jar:5.4.3] at org.ofbiz.base.util.GroovyUtil.getBinding(GroovyUtil.java:100)*

 

**I was able to saw the issue with the debugger just a couple of times, and it seems that when the line FastMap.putAll(context) is executed, there are one or more values in the context map that are not valid and prevent the copy of all the entries.

The putAll documentation states that
{code:java}
IllegalArgumentException - if some property of a key or value in the specified map prevents it from being stored in this map
{code}
and that's what I saw during the debug.

If I can reproduce the error I will take a screenshot of the debug window.

I'll update you soon,

G

 

> Groovy script Product.groovy: java.util.NoSuchElementException
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-12183
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12183
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ecommerce, order
>    Affects Versions: Release Branch 18.12, Trunk, 17.12.05
>         Environment: Linux/Ubuntu 16.04, Linux/Ubuntu 18.04, OFBiz v13.07.03
>            Reporter: Giulio Speri
>            Assignee: Nicolas Malin
>            Priority: Critical
>         Attachments: NoSuchElementException_Productgroovy.jpeg
>
>
> Strange issue happens randomly (it seems) while loading ecommerce product detail page and the groovy script Product.groovy (order/webapp/ordermgr/WEB-INF/actions/entry/catalog/) is run.
> The groovy script is loaded in the screen "product".
> The error showed is kind of java.util.NoSuchElementException and I think that could be something related to session/request attributes, since this could be avoided with an incognito navigation session.
> I saw this error a couple of times during local development also and I could pass over it by manually deleting browser session cookies.
> Unfortunately I was not able to reproduce it yet, so I cannot add more details except hypothesis.
> I also post here a screenshot of the error.
>  
> !NoSuchElementException_Productgroovy.jpeg!  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)