I'm supposed to generate PDFs out of Data in XML. I use Apache FOP for the same. I'm generating whole bunch of PDFs through a batch script on an AIX machine. This is working fine without any issues. However, now i'm supposed to do the same with a web application that runs on WebSphere Application Server on the same AIX machine. My code looks like this:
When I try to run it on the server, it gives out an exception saying
java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[Servlet.Engine.Transports : 0,5,main]
on the line where i'm instantiating the "Driver" class in the Code extract mentioned above.
Here's the StackTrace of the Exception:
Can anybody please Explain and help me out of this?
Means that one thread is trying to modify a collection while another thread is iterating through it - see the Javadocs for that exception. I suspect either: 1. Multiple requests are simultaneously trying to use "Driver" code that is not ThreadSafe. 2. Objects used in one request have not been properly cleaned up when the next request arrives. Bill