aspose file tools*
The moose likes Security and the fly likes keytool error: java.io.filenotfoundexception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "keytool error: java.io.filenotfoundexception" Watch "keytool error: java.io.filenotfoundexception" New topic
Author

keytool error: java.io.filenotfoundexception

ethem narman
Greenhorn

Joined: Oct 16, 2008
Posts: 12
Hello,

I'm trying to create a .keystroke file by issuing :

keytool -genkey -alias tomcat -keyalg RSA

however, after entering name, organization,... I get following error.

keytool error: java.io.filenotfoundexception: \\txl-esf-01\desktop$\.keystroke (Access is denied)

I started to get this error message after installing JDK 6 Update 10 and updating JAVA_HOME, JRE_HOME, CLASS_PATH variables.

How do I fix this error? How can keytool executable refer to (\\txl-esf-01)?

Thanks.

aysan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41885
    
  63
Welcome to JavaRanch.

Do you have write access to the directory where keytool attempts to create the file? Or maybe the file exists already, and your permissions are not sufficient to overwrite it?


Ping & DNS - my free Android networking tools app
ethem narman
Greenhorn

Joined: Oct 16, 2008
Posts: 12
I checked and It seems I do not have permission to write to that folder.
However, when I try to create it in a new folder like:
keytool -genkey -alias tomcat -keyalg RSA -keystore D:\mykeystore

it gives:
keytool error: java.lang.Exception: Keystore file exists, but is empty: D:\mykeystore

if I try to delete alias tomcat with:
keytool -delete -alias tomcat

result is:
keytool error: java.lang.Exception: Keystore file does not exist: \\txl-esf-01\desktop$\.keystore

why I can not create the file in another folder?
thanks.
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
maybe the error message tells the whole story. Does D:\mykeystore exist, and is it empty? Delete the file and run the command again.


Nice to meet you.
ethem narman
Greenhorn

Joined: Oct 16, 2008
Posts: 12
I just created the mykeystore folder. Folder is empty. I can not delete .keystore file since I do not have access to \\txl-esf-01\desktop$\ folder.
I am getting the same error (FileNotFoundException for .keystore) for each web application I'm creating.
what can I do then?
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
I just created the mykeystore folder


OK, that is your mistake. The keystore specified in the -keystore option is a file, not a directory. Delete the directory. Just let keytool create the keystore file for you.
ethem narman
Greenhorn

Joined: Oct 16, 2008
Posts: 12
Yes, I know that it is a file, not a directory. My aim was creating it (.keystore file) in D:\mykeystore folder.

Anyway, my problem is solved. I informed IT Department and they recreated my windows userprofile. Now it is working properly.
Thanks.

aysan
 
wood burning stoves
 
subject: keytool error: java.io.filenotfoundexception