Mathew Anderson

Greenhorn
+ Follow
since Jan 06, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mathew Anderson

Carey - How did I miss those. Thanks, I am changing the code to close the steams. Whoops.

I started to look at Bouncy Castle, seems like some good stuff. I'll try and sit down more with it.
14 years ago
The generation is done on the root partition of the disk:

/dev/dsk/c1t0d0s0 131112519 62008144 67793250 48% /


plenty of space.


I do notice, that once the system is rebooted (we do that weekly), it works for a while.. but as time goes on, the error pops up.
14 years ago
Not really. I only see the error on our production server and I am unable to take it down. Our Development and Quality seem fine.

We run Weblogic 9.2 as the j2ee engine (running on Solaris, if that helps), using that I looked at the memory usage
Before:
Heap Size Current: 3758096384
Heap Free Current: 1364779736
Heap Free Percent: 36
Heap Size Max: 3758096384
Total Physical Memory: 17179869184

After:
Heap Size Current: 3758096384
Heap Free Current: 1295966936
Heap Free Percent: 34
Heap Size Max: 3758096384
Total Physical Memory: 17179869184

The production server is rather busy, we have about 80 applications deployed on it. But the Heap Free seems rather reasonable.

14 years ago
ProcessBuilder did seem to help, but it only delayed the error some. So my initial question still remains open.


Has anyone done keystore generations in java code? If so, any pointers?
14 years ago
JDK is 1.5

I have not looked at the process builder, I'll take a look at that. It might get around the IOException error. Though, I would ultimately like to move this inside the code.. but if changeing to this processbuilder, it will work for now. thanks!
14 years ago
Yes, after I posted, I realized it should be in the intermediate forum. Would it be possible for you to move it? I did not want to cross post.

Edit - Ah, I see you did move it. thank you!
14 years ago
I wrote some code to help me manage the keystores/SSLs that I use with my J2EE application server. In two places, I run the keytool command, using Runtime.getRuntime(), but I am starting to see some java.io.IOException: Not enough space errors. The diskspace looks good, and the Heap size of the jvm looks good.

Anyways, I want to try and convert this so it does not fork and execute (and will remove the issue that I am seeing), but instead use java.security.Keystore instead (or something better).

Here are the parts of the code, I'd like to convert:


// KeyStore Generation
String params[]= {"/bin/keytool", "-genkey", "-keyalg", "RSA", "-alias", keyAlias, "-keystore", keyStore,
"-dname", keyDName, "-keypass", keyPassPhrase, "-storepass", StorePassPhrase};

Process keytool = Runtime.getRuntime().exec(params);

// SSL Cert Request Creation
String params[]= {"keytool", "-certreq", "-alias", keyAlias, "-keypass", keyPassPhrase, "-keystore", keyStore, "-storepass", StorePassPhrase, "-file", keyReqFile };

Process keytool = Runtime.getRuntime().exec(params);

Looking at information on using java.security.KeyStore (KeyStore.Builder, KeystoreSpi), I got lost rather quickly. Anyone else use these? or have some good examples I could use to help muddle my way into fixing this?

Thanks
14 years ago