Unable to execute and checkPermission NPE
This is a very strange problem and I am unsure if this is the correct forum.
I have a java program that uses
Runtime.getRuntime().exec("<command>")
in order to launch another program.
On Solaris 8 it works fine. In our Solaris 10 production environment it doesn抰 work. However, in a relatively fresh, non-tampered with, Solaris 10 environment it does work.
When it doesn抰 work I get a java.io.IOException: <command> : cannot execute error.
As the user I am running java program as, I am able to run the command from the shell. The command I am trying to exec has the read and execute bits set for the user and group (550). My user抯 group is the same as the command抯. I get the same error even if I run the java program as root. So I am pretty sure the problem isn't the command's permissions.
I tried to check the command抯 file permission in java before trying to execute it, using this.
System.out.println("creating file permission object");
FilePermission fp =new FilePermission("<command>","execute");
System.out.println("Checking the permission, which is " + fp);
security.checkPermission(fp);
The last line of that always throws a null point exception, even though fp is never null.
As a last resort I tried changing the permission of the command to 555. After that, everything worked, but the crazy thing is, I still get the NPE when I check the permissions.
Does anybody know what could cause this, or where else I can look for clues? I don抰 think leaving the 555 permission will be acceptable.

