RE: IllegalMonitorStateException
Sorry, this email showed up as if it had been sent on Jun 15th... weird. (woldn't have found it had glen not im'd about it) Regardless of this, we should not attempt to make POI threadsafe. There are many reasons for this (most of which are obvious, 2 threads modifying 1 stream is generally a bad idea anyhow). To clarify: ThreadLocal and synchronized (Object) {} should be avoided. It would be purely deceptive and nothing more than a performance drag to introduce thread safety. Secondly, while I don't double JDK 1.2 on Win2k is a very unideal platform, I suspect removing thread synchronization/etc will reduce the number of glitches. Does anyone have a compelling reason why POI should be thread safe (lack of thread safety does not mean you can't use it in multithreaded applications, it just means that two threads can't use POI at once -- which they can't do so successfully at the end of the day anyhow -- or at least not to any actual advantage)? Loaded question, but I'd like to settle that issue. Thanks, Andy On Sat, 2002-06-15 at 18:09, Avik Sengupta wrote: The problem is not JServ, its JDK1.2 on Win2K .. this has issues for IllegalMonitorState exception on correct code. For eg., see http://marc.theaimsgroup.com/?l=ant-userm=102276404123305w=2 and http://marc.theaimsgroup.com/?l=ant-devm=102387539321688w=2 Quoting Laubach, Shawn - TAFB/LAB NCC (SAIC) [EMAIL PROTECTED]: This is running under Oracle 9ias Rel. 1 so 1. A 1.2.1 version is what they say the are completely compatible with. 2. JServ 1.1 (Don't have a choice in this) 3. Win2k fully patched 4. P4 1.4 1gig 2x36gig SCSI Hardrives I went back to the 1.5 version of POI and it reacted the same. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:34 PM To: POI Users List Subject: Re: IllegalMonitorStateException Thats a threading error. POI isn't threaded. That totally makes no sense. I bet its a cooincidence as to where its happening. Please provide: 1. JDK version 2. Servlet container version 3. OS version 4. Hardware statistics. -Andy Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: IllegalMonitorStateException
Easier said than done unless you know how to replace oracles JDK. I've found when the problem is arising from. In the FormulaParser's parse method. It does a synchronize on tokens. I commented this out and it all worked real nice. I put a synchronized in the method and it worked nice. I created a different object and synchronized on it failed again. I don't know what all this means, but I hope this can lead you in the right direction. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:35 PM To: POI Users List Subject: Re: IllegalMonitorStateException oh and try another jdk just for kicks. Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: IllegalMonitorStateException
On Sat, 2002-07-06 at 10:05, Adam wrote: Just a question from the lurker pool, but why are you stuck using JServ? The whole point of using 9iAS is the OC4J container, which is a licensed version of the Orion server. JServ hasn't been updated in years. Just for clarification (from my understanding): JServ | | Planning starts for a JServ 2.0 - complete rewrite. | | | Sun Donates Tomcat 3.0 | (which was a white elephant of sorts) | | Plans for JServ 2.0 discontinued | | | Tomcat 3.1 | | Tomcat 3.2 | | Plans for JServ 2.0 revised/reincarnated as Tomcat 4.0 | | Some dissenters from the Tomcat 4.0 (complete rewrite/redesign) | create Tomcat 3.3 (refactoring, incremental improvement over 3.2) | | Tomcat 4.0 born | | Several bugfixes later you can even run Tomcat 4.04 and have it | actuall work! | | Tomcat 4.1 development starts Oracle chose to not upgrade to Tomcat at any point in the last 4 years Adam Weed -Original Message- From: Laubach, Shawn - TAFB/LAB NCC (SAIC) [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 8:51 AM To: 'POI Users List' Subject: RE: IllegalMonitorStateException This is running under Oracle 9ias Rel. 1 so 1. A 1.2.1 version is what they say the are completely compatible with. 2. JServ 1.1 (Don't have a choice in this) 3. Win2k fully patched 4. P4 1.4 1gig 2x36gig SCSI Hardrives I went back to the 1.5 version of POI and it reacted the same. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:34 PM To: POI Users List Subject: Re: IllegalMonitorStateException Thats a threading error. POI isn't threaded. That totally makes no sense. I bet its a cooincidence as to where its happening. Please provide: 1. JDK version 2. Servlet container version 3. OS version 4. Hardware statistics. -Andy Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: IllegalMonitorStateException
Well here is the problem: http://java.sun.com/products/jdk/1.2/docs/api/java/lang/IllegalMonitorStateException.html public class IllegalMonitorStateException extends RuntimeException Thrown to indicate that a thread has attempted to wait on an object's monitor or to notify other threads waiting on an object's monitor without owning the specified monitor. Since POI *does not* utilize threads in any way, the exception doesn't make sense. Its showing up in POI, but I highly doubt that POI is the actual cause of it. Oh and POI especially doesn't monitor threads (something I have successfully avoided doing in java for the entire time I've used it). So this means to me that someone else is trying to monitor the thread the POI servlet is running in without owning it. I suspect: 1. There is a bug in your JDK (the string pool maybe?) 2. There is a bug in your app server, in that its trying to monitor an object belonging to POI without owning the servlet/whatever that POI is running in (meaning its thread). 3. If the app code is doing threading and monitoring, etc, a bug in it. Since the code runs fine stand alone (assuming on the same OS and JDK/etc) and there really aren't many apps that use monitors, I suspect the second. I can't think of a good reason for an App server to monitor a thread in such a way unless its for the purpose of updating say a debugger, profiler or something of the such (if so, turn that debugger or what-have-you off). I've never used Oracle app servers, but I'll bet there is some kind of kludgy coupling between it and JServ, in which case thats a possibility. Also...try running without the JIT. Do you have a stack trace? -Andy PS possibilities: http://developer.java.sun.com/developer/bugParade/bugs/4307780.html http://developer.java.sun.com/developer/bugParade/bugs/4212414.html http://developer.java.sun.com/developer/bugParade/bugs/4131519.html application bug: http://developer.java.sun.com/developer/bugParade/bugs/4025841.html On Sat, 2002-07-06 at 09:51, Laubach, Shawn - TAFB/LAB NCC (SAIC) wrote: This is running under Oracle 9ias Rel. 1 so 1. A 1.2.1 version is what they say the are completely compatible with. 2. JServ 1.1 (Don't have a choice in this) 3. Win2k fully patched 4. P4 1.4 1gig 2x36gig SCSI Hardrives I went back to the 1.5 version of POI and it reacted the same. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:34 PM To: POI Users List Subject: Re: IllegalMonitorStateException Thats a threading error. POI isn't threaded. That totally makes no sense. I bet its a cooincidence as to where its happening. Please provide: 1. JDK version 2. Servlet container version 3. OS version 4. Hardware statistics. -Andy Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: IllegalMonitorStateException
Yes. I sometimes question their judgment on that. The current release (which is out for everything but windows) is based off of tomcat so. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 9:53 AM To: POI Users List Subject: RE: IllegalMonitorStateException On Sat, 2002-07-06 at 10:05, Adam wrote: Just a question from the lurker pool, but why are you stuck using JServ? The whole point of using 9iAS is the OC4J container, which is a licensed version of the Orion server. JServ hasn't been updated in years. Just for clarification (from my understanding): JServ | | Planning starts for a JServ 2.0 - complete rewrite. | | | Sun Donates Tomcat 3.0 | (which was a white elephant of sorts) | | Plans for JServ 2.0 discontinued | | | Tomcat 3.1 | | Tomcat 3.2 | | Plans for JServ 2.0 revised/reincarnated as Tomcat 4.0 | | Some dissenters from the Tomcat 4.0 (complete rewrite/redesign) | create Tomcat 3.3 (refactoring, incremental improvement over 3.2) | | Tomcat 4.0 born | | Several bugfixes later you can even run Tomcat 4.04 and have it | actuall work! | | Tomcat 4.1 development starts Oracle chose to not upgrade to Tomcat at any point in the last 4 years Adam Weed -Original Message- From: Laubach, Shawn - TAFB/LAB NCC (SAIC) [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 8:51 AM To: 'POI Users List' Subject: RE: IllegalMonitorStateException This is running under Oracle 9ias Rel. 1 so 1. A 1.2.1 version is what they say the are completely compatible with. 2. JServ 1.1 (Don't have a choice in this) 3. Win2k fully patched 4. P4 1.4 1gig 2x36gig SCSI Hardrives I went back to the 1.5 version of POI and it reacted the same. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:34 PM To: POI Users List Subject: Re: IllegalMonitorStateException Thats a threading error. POI isn't threaded. That totally makes no sense. I bet its a cooincidence as to where its happening. Please provide: 1. JDK version 2. Servlet container version 3. OS version 4. Hardware statistics. -Andy Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Try it now (was: RE: IllegalMonitorStateException)
Hi Shawn, I just removed the thread safety stuff from the head. Give it a whirl. We need a better solution for formula workbook context, but this should at least make us nice and able to run in single threaded contexts for the moment. Thanks, Andy On Sat, 2002-07-06 at 11:08, Laubach, Shawn - TAFB/LAB NCC (SAIC) wrote: Yes. I sometimes question their judgment on that. The current release (which is out for everything but windows) is based off of tomcat so. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 9:53 AM To: POI Users List Subject: RE: IllegalMonitorStateException On Sat, 2002-07-06 at 10:05, Adam wrote: Just a question from the lurker pool, but why are you stuck using JServ? The whole point of using 9iAS is the OC4J container, which is a licensed version of the Orion server. JServ hasn't been updated in years. Just for clarification (from my understanding): JServ | | Planning starts for a JServ 2.0 - complete rewrite. | | | Sun Donates Tomcat 3.0 | (which was a white elephant of sorts) | | Plans for JServ 2.0 discontinued | | | Tomcat 3.1 | | Tomcat 3.2 | | Plans for JServ 2.0 revised/reincarnated as Tomcat 4.0 | | Some dissenters from the Tomcat 4.0 (complete rewrite/redesign) | create Tomcat 3.3 (refactoring, incremental improvement over 3.2) | | Tomcat 4.0 born | | Several bugfixes later you can even run Tomcat 4.04 and have it | actuall work! | | Tomcat 4.1 development starts Oracle chose to not upgrade to Tomcat at any point in the last 4 years Adam Weed -Original Message- From: Laubach, Shawn - TAFB/LAB NCC (SAIC) [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 8:51 AM To: 'POI Users List' Subject: RE: IllegalMonitorStateException This is running under Oracle 9ias Rel. 1 so 1. A 1.2.1 version is what they say the are completely compatible with. 2. JServ 1.1 (Don't have a choice in this) 3. Win2k fully patched 4. P4 1.4 1gig 2x36gig SCSI Hardrives I went back to the 1.5 version of POI and it reacted the same. Shawn Laubach SAIC - Web Developer B-1B System Support Management Division OC-ALC/LAB, Building 3001, Tinker AFB, Oklahoma dsn: 336-2473 comm: 405-736-2473 mobile: 405-245-9562 -Original Message- From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 10:34 PM To: POI Users List Subject: Re: IllegalMonitorStateException Thats a threading error. POI isn't threaded. That totally makes no sense. I bet its a cooincidence as to where its happening. Please provide: 1. JDK version 2. Servlet container version 3. OS version 4. Hardware statistics. -Andy Shawn Laubach wrote: Inside a class being called by a servlet, I'm getting a IllegalMonitorStateException thrown. I've narrowed it down to three lines of code where it is occuring. A row.createCell, cell.setCellValue, and cell.setCellStyle calls. I haven't had time to narrow it down any furthur. What I'm curious about, is why it would be thrown anyways. I've just started using the 1.8 dev release and I plan to try the 1.7 release next chance to see if that works. BTW, it runs fine standalone and other similar code runs fine both standalone and as a servlet. Shawn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote. -Ambassador Kosh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- http://www.superlinksoftware.com - software solutions for business http://jakarta.apache.org/poi - Excel/Word/OLE 2 Compound Document in Java http://krysalis.sourceforge.net/centipede - the best build/project structure a guy/gal could have! - Make Ant simple on complex Projects! The avalanche has already started. It is too late for the pebbles to vote