[ https://issues.apache.org/jira/browse/COCOON-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13834764#comment-13834764 ]
Ivan Lagunov edited comment on COCOON-2340 at 11/28/13 12:15 PM: ----------------------------------------------------------------- Hi Javier, I would like to try Cocoon 2.2.1 first but could you say where it's located? I suppose it must be under trunk here http://svn.apache.org/repos/asf/cocoon/trunk/ ? Is it stable enough for Production usage? It's written here that SNAPSHOTS are not tested and not guaranteed to even build cleanly: https://cocoon.apache.org/mirror.cgi Regarding singleton components in the pipeline. I'm using standard Cocoon components, you can see the exception is coming from ExpiresCachingProcessingPipeline. Did you mean that some Cocoon 2.2 components are declared as singletons? Because I don't think I can fix it in my code. Ivan was (Author: lagivan): Hi Javier, I would like to try Cocoon 2.2.1 first but could you say where it's located? I suppose it must be under trunk here http://svn.apache.org/repos/asf/cocoon/trunk/ ? Is it stable enough for Production usage? I mean it's written here that SNAPSHOTS are not tested and not guaranteed to even build cleanly: https://cocoon.apache.org/mirror.cgi Ivan > XMLByteStreamCompiler in not thread-safe > ---------------------------------------- > > Key: COCOON-2340 > URL: https://issues.apache.org/jira/browse/COCOON-2340 > Project: Cocoon > Issue Type: Bug > Components: * Cocoon Core > Affects Versions: 2.2 > Reporter: Ivan Lagunov > > I'm periodically getting the following exceptions in different places: > Caused by: java.lang.ArrayIndexOutOfBoundsException > at java.lang.System.arraycopy(Native Method) > at > org.apache.cocoon.components.sax.XMLByteStreamCompiler.getSAXFragment(XMLByteStreamCompiler.java:61) > at > org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessingPipeline.processXMLPipeline(ExpiresCachingProcessingPipeline.java:152) > After debugging I've found the root cause. It happens due to multi-threading > when one thread allocates newbuf array, then another thread increments > bufCount in write method and then the first thread fails on System.arraycopy > invocation. > I suggest making getSAXFragment and write methods synchronized. It should > resolve the issue. If it helps, I'll provide a patch later. -- This message was sent by Atlassian JIRA (v6.1#6144)