Home » FreeHEP Java Library » AIDA » IIOException: can't create cache file!
IIOException: can't create cache file! [message #462] Mon, 28 February 2005 08:40 Go to next message
tbolsh  is currently offline tbolsh
Messages: 13
Registered: August 2004
Location: Fermilab, Batavia, IL
Member
Good morning!

Recently I wrote a little program to compute Integrated Luminosities over some period of time. It is a server side daemon, it reads datalogger data, creates AIDA file and generates a plot.
On my local machine it worked fine for a while, when I move to the server it stop producing plots. In the server logs I see an exception
javax.imageio.IIOException with line 'Can't create cache file!'

So, it is obvious that daemon miss some permissions somewehere.
Does somebody know WHERE it tries to create this cache file?
It seems that /tmp and target directory are available for that daemon ... How can I control where it creates that cache file?

Thanks,
Timofei Bolshakov

[Updated on: Mon, 28 February 2005 08:41]

Re: IIOException: can't create cache file! [message #464 is a reply to message #462 ] Mon, 28 February 2005 10:10 Go to previous messageGo to next message
duns  is currently offline duns
Messages: 464
Registered: January 2004
Member
Hi

which type of image are you writing? PNG, GIF, ...?

Regards
Mark Donszelmann
Re: IIOException: can't create cache file! [message #465 is a reply to message #464 ] Mon, 28 February 2005 10:11 Go to previous messageGo to next message
tbolsh  is currently offline tbolsh
Messages: 13
Registered: August 2004
Location: Fermilab, Batavia, IL
Member
GIF.
I can show code, but it is pretty straitforward -
I create IPlotter and call writeToFile.

Timofei.

P.S. I tried PNG - same results ...

[Updated on: Mon, 28 February 2005 13:10]

Re: IIOException: can't create cache file! [message #466 is a reply to message #465 ] Mon, 28 February 2005 13:36 Go to previous messageGo to next message
duns  is currently offline duns
Messages: 464
Registered: January 2004
Member
Could you try PNG. Just to see if it is different.

Regards
Mark
Re: IIOException: can't create cache file! [message #467 is a reply to message #466 ] Mon, 28 February 2005 14:06 Go to previous messageGo to next message
tbolsh  is currently offline tbolsh
Messages: 13
Registered: August 2004
Location: Fermilab, Batavia, IL
Member
I tried PNG - same results.

Timofei.

[Updated on: Mon, 28 February 2005 14:06]

Re: IIOException: can't create cache file! [message #473 is a reply to message #462 ] Mon, 28 February 2005 20:15 Go to previous messageGo to next message
tonyj  is currently offline tonyj
Messages: 146
Registered: January 2004
Member

Looks like there is some discussion of this here:

http://forum.java.sun.com/thread.jspa?forumID=20&message ID=1195181&threadID=223792

Are you using tomcat? If so perhaps you need to set up a temp directory as discussed in the referenced discussion.

Tony
Re: IIOException: can't create cache file! [message #475 is a reply to message #473 ] Mon, 28 February 2005 20:43 Go to previous messageGo to next message
duns  is currently offline duns
Messages: 464
Registered: January 2004
Member
Hi

ImageIO.java uses a cachedir which is normally pointed to
by:

java.io.tmpdir



A search for this property delivered:

The
* default temporary-file directory is specified by the system property
* <code>java.io.tmpdir</code>. On UNIX systems the default value of this
* property is typically <code>"/tmp"</code> or <code>"/var/tmp"</code>; on
* Microsoft Windows systems it is typically <code>"c:\\temp"</code>. A different
* value may be given to this system property when the Java virtual machine
* is invoked, but programmatic changes to this property are not guaranteed
* to have any effect upon the the temporary directory used by this method.

I guess one could set it on beforehand...

Regards
Mark
Re: IIOException: can't create cache file! [message #478 is a reply to message #467 ] Tue, 01 March 2005 06:33 Go to previous message
tbolsh  is currently offline tbolsh
Messages: 13
Registered: August 2004
Location: Fermilab, Batavia, IL
Member
Thank you very much for help!
Everything works now. Besides the temp directory I set the
home directory for the user 'nobody' - I do not know is it necessary or not.

So, this little snippet of code fixes the problem:

if( System.getProperty( "user.name" ).startsWith( "nobody" ) ) {
   System.setProperty( "user.home", "/some_directory_or_tmp" );
   System.setProperty( "java.io.tmpdir", "/tmp" );
}


Timofei Bolshakov.

[Updated on: Tue, 01 March 2005 06:48]

Previous Topic:java.lang.StackOverflowError
Next Topic:TupleFactory.createChained
Goto Forum:
  


Current Time: Tue Feb 04:45:21 Pacific Standard Time 2010

Total time taken to generate the page: 0.05540 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.6.
Copyright ©2001-2006 FUD Forum Bulletin Board Software