Skip to main content

J2KImageWriter exception at UnixFileSystem.createFileExclusively

5 replies [Last post]
scyudits
Offline
Joined: 2005-07-15

Hi,

I'm getting the following error for some of my JPEG2000 tests:

java.io.IOException
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java)
at java.io.File.checkAndCreate(File.java)
at java.io.File.createTempFile(File.java)
at java.io.File.createTempFile(File.java)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWriter.write(J2KImageWriter.java:316)
...

What does this mean, and how can this be fixed?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

A permission problem perhaps?

What was the message?

Brian

On Tue, 13 Jun 2006, jai-imageio@javadesktop.org wrote:

> Hi,
>
> I'm getting the following error for some of my JPEG2000 tests:
>
> java.io.IOException
> at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java)
> at java.io.File.checkAndCreate(File.java)
> at java.io.File.createTempFile(File.java)
> at java.io.File.createTempFile(File.java)
> at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWriter.write(J2KImageWriter.java:316)
> ...
>
> What does this mean, and how can this be fixed?
> [Message sent by forum member 'scyudits' (scyudits)]
>
> http://forums.java.net/jive/thread.jspa?messageID=122676
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

scyudits
Offline
Joined: 2005-07-15

I am additionally getting a message where my environment is telling me there are too many open files. I am calling J2KImageWriter.dispose() after I am done with the compression. Is there something else I need to call in order to make sure J2KImageWriter closes the temporary files it creates?

> A permission problem perhaps?
>
> What was the message?
>
> Brian
>
> On Tue, 13 Jun 2006, jai-imageio@javadesktop.org
> wrote:
>
> > Hi,
> >
> > I'm getting the following error for some of my
> JPEG2000 tests:
> >
> > java.io.IOException
> > at
> java.io.UnixFileSystem.createFileExclusively(UnixFileS
> ystem.java)
> > at java.io.File.checkAndCreate(File.java)
> > at java.io.File.createTempFile(File.java)
> > at java.io.File.createTempFile(File.java)
> > at
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWri
> ter.write(J2KImageWriter.java:316)
> > ...
> >
> > What does this mean, and how can this be fixed?
> > [Message sent by forum member 'scyudits'
> (scyudits)]
> >
> >
> http://forums.java.net/jive/thread.jspa?messageID=1226
> 76
> >

Brian Burkhalter

J2KImageWriter.write() calls delete() on the temporary files before returning
so that should not be the source of the problem.

Also, from the line number it looks as if you are using JAI Image I/O Tools
1.0_01. You should consider trying the 1.1-beta version.

Brian

On Tue, 13 Jun 2006, jai-imageio@javadesktop.org wrote:

> I am additionally getting a message where my environment is telling me there are too many open files. I am calling J2KImageWriter.dispose() after I am done with the compression. Is there something else I need to call in order to make sure J2KImageWriter closes the temporary files it creates?
>
>> A permission problem perhaps?
>>
>> What was the message?
>>
>> Brian
>>
>> On Tue, 13 Jun 2006, jai-imageio@javadesktop.org
>> wrote:
>>
>>> Hi,
>>>
>>> I'm getting the following error for some of my
>> JPEG2000 tests:
>>>
>>> java.io.IOException
>>> at
>> java.io.UnixFileSystem.createFileExclusively(UnixFileS
>> ystem.java)
>>> at java.io.File.checkAndCreate(File.java)
>>> at java.io.File.createTempFile(File.java)
>>> at java.io.File.createTempFile(File.java)
>>> at
>> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWri
>> ter.write(J2KImageWriter.java:316)
>>> ...
>>>
>>> What does this mean, and how can this be fixed?
>>> [Message sent by forum member 'scyudits'
>> (scyudits)]
>>>
>>>
>> http://forums.java.net/jive/thread.jspa?messageID=1226
>> 76
>>>
> [Message sent by forum member 'scyudits' (scyudits)]
>
> http://forums.java.net/jive/thread.jspa?messageID=122872
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

scyudits
Offline
Joined: 2005-07-15

I did some investigation, and I'm fairly sure it is not a leak in my code. When I comment out the line (J2KImageWrite)writer.write(...), there is no leak. From this I know that all my streams, etc are being closed properly. I don't handle any files in my code. When I uncomment writer.write(...) and pass in a TiledImage instead of the RenderedImage subclass I wrote to tile raw data on the fly, the leak still happens. From this, I know that the raw image codec I wrote is not the source of the leak.

Could the following Java bug be the source of this problem?
http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4171239

If so, what can I do to work around this?

Brian Burkhalter

It's weird because File.delete() is being invoked on the temporary file within
the write() method of the JPEG 2000 writer. Perhaps this doesn't work if a
stream is still open on the file?

At the risk of being redundant, if this is truly a problem please file an
issue here

https://jai-imageio-core.dev.java.net/issues/enter_bug.cgi?issue_type=DE...

and if at all possible include a self-contained test case as this will greatly
raise the probability of the thing being investigated.

Thanks,

Brian

On Thu, 15 Jun 2006, jai-imageio@javadesktop.org wrote:

> I did some investigation, and I'm fairly sure it is not a leak in my code. When I comment out the line (J2KImageWrite)writer.write(...), there is no leak. From this I know that all my streams, etc are being closed properly. I don't handle any files in my code. When I uncomment writer.write(...) and pass in a TiledImage instead of the RenderedImage subclass I wrote to tile raw data on the fly, the leak still happens. From this, I know that the raw image codec I wrote is not the source of the leak.
>
> Could the following Java bug be the source of this problem?
> http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4171239
>
> If so, what can I do to work around this?

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net