I am frequently getting a java.util.ConcurrentModificationException from: java.util.LinkedList$ListItr.next() org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) .... I only get this error using a Centos server. Another server running Windows has no similiar complaint. I looked at the code and cannot possibly see how a single copy of the ModelForm object could be used in multiple threads? The list causing the grief is the fieldList and a new one is instantiated each time the modelform is created, i.e. it is not static. This server runs for a few days before this error occurs. Note that this exception is from 9.0 based ofbiz code. I did a comparison of the 9x code and the 10.x ModelForm.java code and see that this stuff has been almost completely rewritten. Anyone have any insite? Skip |
Skip,
The widget models are kept in a memory cache and the model instances are shared among threads. There were a number of thread-safe issues in the 9.x widget models. Some have been fixed, others have Jira issues and still need to be fixed. It is not uncommon for thread-safe bugs to appear sporadically - since the bug is timing-dependent. If you have a specific revision number, I might be able to suggest a fix. -Adrian On 5/25/2011 6:19 PM, SkipDever wrote: > > I am frequently getting a java.util.ConcurrentModificationException from: > > java.util.LinkedList$ListItr.next() > org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) > .... > > I only get this error using a Centos server. Another server running Windows > has no similiar complaint. > > I looked at the code and cannot possibly see how a single copy of the > ModelForm object could be used in multiple threads? The list causing the > grief is the fieldList and a new one is instantiated each time the modelform > is created, i.e. it is not static. > > This server runs for a few days before this error occurs. > > Note that this exception is from 9.0 based ofbiz code. I did a comparison > of the 9x code and the 10.x ModelForm.java code and see that this stuff has > been almost completely rewritten. > > Anyone have any insite? > > Skip > |
Adrian
Thanks, version looks like 9.04 Skip -----Original Message----- From: Adrian Crum [mailto:[hidden email]] Sent: Wednesday, May 25, 2011 3:14 PM To: [hidden email] Subject: Re: ConcurrentModificationException ???? Linux Skip, The widget models are kept in a memory cache and the model instances are shared among threads. There were a number of thread-safe issues in the 9.x widget models. Some have been fixed, others have Jira issues and still need to be fixed. It is not uncommon for thread-safe bugs to appear sporadically - since the bug is timing-dependent. If you have a specific revision number, I might be able to suggest a fix. -Adrian On 5/25/2011 6:19 PM, SkipDever wrote: > > I am frequently getting a java.util.ConcurrentModificationException from: > > java.util.LinkedList$ListItr.next() > org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) > .... > > I only get this error using a Centos server. Another server running Windows > has no similiar complaint. > > I looked at the code and cannot possibly see how a single copy of the > ModelForm object could be used in multiple threads? The list causing the > grief is the fieldList and a new one is instantiated each time the modelform > is created, i.e. it is not static. > > This server runs for a few days before this error occurs. > > Note that this exception is from 9.0 based ofbiz code. I did a comparison > of the 9x code and the 10.x ModelForm.java code and see that this stuff has > been almost completely rewritten. > > Anyone have any insite? > > Skip > |
In reply to this post by Adrian Crum-3
I am wondering if I can just move all the
/framework/widget/src/org/ofbiz/widget/form*.java from 10.04 into my build and have some chance of it building? Fortunately, I have not modified any of this code. Skip -----Original Message----- From: Adrian Crum [mailto:[hidden email]] Sent: Wednesday, May 25, 2011 3:14 PM To: [hidden email] Subject: Re: ConcurrentModificationException ???? Linux Skip, The widget models are kept in a memory cache and the model instances are shared among threads. There were a number of thread-safe issues in the 9.x widget models. Some have been fixed, others have Jira issues and still need to be fixed. It is not uncommon for thread-safe bugs to appear sporadically - since the bug is timing-dependent. If you have a specific revision number, I might be able to suggest a fix. -Adrian On 5/25/2011 6:19 PM, SkipDever wrote: > > I am frequently getting a java.util.ConcurrentModificationException from: > > java.util.LinkedList$ListItr.next() > org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) > .... > > I only get this error using a Centos server. Another server running Windows > has no similiar complaint. > > I looked at the code and cannot possibly see how a single copy of the > ModelForm object could be used in multiple threads? The list causing the > grief is the fieldList and a new one is instantiated each time the modelform > is created, i.e. it is not static. > > This server runs for a few days before this error occurs. > > Note that this exception is from 9.0 based ofbiz code. I did a comparison > of the 9x code and the 10.x ModelForm.java code and see that this stuff has > been almost completely rewritten. > > Anyone have any insite? > > Skip > |
You might have better luck replacing the entire widget component.
-Adrian On 5/26/2011 12:47 AM, SkipDever wrote: > I am wondering if I can just move all the > /framework/widget/src/org/ofbiz/widget/form*.java from 10.04 into my build > and have some chance of it building? Fortunately, I have not modified any > of this code. > > Skip > > -----Original Message----- > From: Adrian Crum [mailto:[hidden email]] > Sent: Wednesday, May 25, 2011 3:14 PM > To: [hidden email] > Subject: Re: ConcurrentModificationException ???? Linux > > > Skip, > > The widget models are kept in a memory cache and the model instances are > shared among threads. There were a number of thread-safe issues in the > 9.x widget models. Some have been fixed, others have Jira issues and > still need to be fixed. It is not uncommon for thread-safe bugs to > appear sporadically - since the bug is timing-dependent. If you have a > specific revision number, I might be able to suggest a fix. > > -Adrian > > On 5/25/2011 6:19 PM, SkipDever wrote: >> I am frequently getting a java.util.ConcurrentModificationException from: >> >> java.util.LinkedList$ListItr.next() >> org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) >> .... >> >> I only get this error using a Centos server. Another server running > Windows >> has no similiar complaint. >> >> I looked at the code and cannot possibly see how a single copy of the >> ModelForm object could be used in multiple threads? The list causing the >> grief is the fieldList and a new one is instantiated each time the > modelform >> is created, i.e. it is not static. >> >> This server runs for a few days before this error occurs. >> >> Note that this exception is from 9.0 based ofbiz code. I did a comparison >> of the 9x code and the 10.x ModelForm.java code and see that this stuff > has >> been almost completely rewritten. >> >> Anyone have any insite? >> >> Skip >> |
Thanks Adrian, I'll give that a go
-----Original Message----- From: Adrian Crum [mailto:[hidden email]] Sent: Wednesday, May 25, 2011 4:48 PM To: [hidden email] Subject: Re: ConcurrentModificationException ???? Linux You might have better luck replacing the entire widget component. -Adrian On 5/26/2011 12:47 AM, SkipDever wrote: > I am wondering if I can just move all the > /framework/widget/src/org/ofbiz/widget/form*.java from 10.04 into my build > and have some chance of it building? Fortunately, I have not modified any > of this code. > > Skip > > -----Original Message----- > From: Adrian Crum [mailto:[hidden email]] > Sent: Wednesday, May 25, 2011 3:14 PM > To: [hidden email] > Subject: Re: ConcurrentModificationException ???? Linux > > > Skip, > > The widget models are kept in a memory cache and the model instances are > shared among threads. There were a number of thread-safe issues in the > 9.x widget models. Some have been fixed, others have Jira issues and > still need to be fixed. It is not uncommon for thread-safe bugs to > appear sporadically - since the bug is timing-dependent. If you have a > specific revision number, I might be able to suggest a fix. > > -Adrian > > On 5/25/2011 6:19 PM, SkipDever wrote: >> I am frequently getting a java.util.ConcurrentModificationException from: >> >> java.util.LinkedList$ListItr.next() >> org.ofbiz.widget.form.ModelForm.renderHeaderRow(ModelForm.java:1074) >> .... >> >> I only get this error using a Centos server. Another server running > Windows >> has no similiar complaint. >> >> I looked at the code and cannot possibly see how a single copy of the >> ModelForm object could be used in multiple threads? The list causing the >> grief is the fieldList and a new one is instantiated each time the > modelform >> is created, i.e. it is not static. >> >> This server runs for a few days before this error occurs. >> >> Note that this exception is from 9.0 based ofbiz code. I did a >> of the 9x code and the 10.x ModelForm.java code and see that this stuff > has >> been almost completely rewritten. >> >> Anyone have any insite? >> >> Skip >> |
In reply to this post by SkipDever
Adrian
Turns out that using the entire widget component is not an option. There are references to ../../common.xml and ../../macros.xml which references <pathelement location="${ofbiz.home.dir}/framework/base/lib/commons/commons-cli-1.0.jar"/ > <pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/antlr-2.7.6.jar"/> <pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-3.2.jar"/> <pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-1.7-rc-2.jar "/> and so on. I can probably clean up that build.xml file, but not sure if it's wasted effort or not. In the mean time, I am considering removing the Iterator references and replacing them with foreach. The Iterator seems to be where the problems are. Any advice as to the shortest route to a fix? Moving to 10.04 is not currently an option as I have made hundreds of modifications to the ofbiz core code, all of which would have to be remade and tested. Skip -----Original Message----- From: Adrian Crum [mailto:[hidden email]] Sent: Wednesday, May 25, 2011 4:48 PM To: [hidden email] Subject: Re: ConcurrentModificationException ???? Linux You might have better luck replacing the entire widget component. -Adrian On 5/26/2011 12:47 AM, SkipDever wrote: > I am wondering if I can just move all the > /framework/widget/src/org/ofbiz/widget/form*.java from 10.04 into my build > and have some chance of it building? Fortunately, I have not modified any > of this code. > > Skip > |
According to your previous message, it appears a list is being modified
by more than one thread. Something needs to be done to guard that list so that only one thread can modify it at a time. If you could give me a revision number (not a release number) I might be able to provide more details. -Adrian On 5/27/2011 6:46 PM, SkipDever wrote: > Adrian > > Turns out that using the entire widget component is not an option. There > are references to ../../common.xml and ../../macros.xml which references > <pathelement > location="${ofbiz.home.dir}/framework/base/lib/commons/commons-cli-1.0.jar"/ > <pathelement > location="${ofbiz.home.dir}/framework/base/lib/scripting/antlr-2.7.6.jar"/> > <pathelement > location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-3.2.jar"/> > <pathelement > location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-1.7-rc-2.jar > "/> > > and so on. > > I can probably clean up that build.xml file, but not sure if it's wasted > effort or not. > > In the mean time, I am considering removing the Iterator references and > replacing them with foreach. The Iterator seems to be where the problems > are. > > Any advice as to the shortest route to a fix? Moving to 10.04 is not > currently an option as I have made hundreds of modifications to the ofbiz > core code, all of which would have to be remade and tested. > > Skip > > -----Original Message----- > From: Adrian Crum [mailto:[hidden email]] > Sent: Wednesday, May 25, 2011 4:48 PM > To: [hidden email] > Subject: Re: ConcurrentModificationException ???? Linux > > > You might have better luck replacing the entire widget component. > > -Adrian > > On 5/26/2011 12:47 AM, SkipDever wrote: >> I am wondering if I can just move all the >> /framework/widget/src/org/ofbiz/widget/form*.java from 10.04 into my build >> and have some chance of it building? Fortunately, I have not modified any >> of this code. >> >> Skip >> |
Free forum by Nabble | Edit this page |