poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60141] Executing a program in Eclipse is displaying an exception on the console: "Exception in thread "main" org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Rule M2.4 exception"
Date Thu, 15 Sep 2016 17:48:00 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60141

Javen O'Neal <onealj@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Javen O'Neal <onealj@apache.org> ---
Can you provide a stack trace to know where the exception is coming from? You
might need to run this in debug mode with breakpoints to figure out which line
is causing the error.

My guess is that it's breaking at wb.write(fos), since you never closed your
file input stream and in Windows opening a file gets an exclusive lock until
the resource is closed.

Some suggestions:
* Open with a File instead of a FileInputStream
* Write to a different file than you read (and back up the original file in
case you accidentally mangle it)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message