Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

The Damned MsJvm (Java Scripting on VRML)

843807Jan 24 2006 — edited Jan 24 2006
Hi, I don't know if this is the right, but i have a problem with the msjvm (yes, it's old, but VRML JSAI run only with this). I want to read some data from a text file, but everytime I get the File NotFoundException... The file is on the application directory.

Here the code:
public class suono extends Script {
public void initialize() {try {
     		 if (Class.forName("com.ms.security.PolicyEngine") != null)
       			 PolicyEngine.assertPermission(PermissionID.SYSTEM);
     		    	
     		    System.out.println("inizio");
		   
		    
    			} 

		catch (Throwable cnfe) {  }


            }

public void processEvent(Event e) {
	  
	  
    if(e.getName().equals("attivo")) {
 System.out.println("ciao");
   try {
     FileReader fis = new FileReader("uno.txt");
     int c= fis.read();
     System.out.println (c);
     fis.close();
 
        }
   catch (IOException ex) {System.out.println (ex.toString());}                            
                                     
  }
}
The Jsai work in a Sandbox like an applet, then i sign my file and i put it on a .cab file.

For Example, if I run this in the same directory, it works:
public static void main (String args[]) {

try {
FileReader fis = new FileReader("uno.txt");
char c=(char) fis.read();
System.out.println(c);
}

catch (IOException e) {System.out.println(e.toString());}

}
Can Someone Help me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2006
Added on Jan 24 2006
2 comments
72 views