From: mark81 at gmail.com (Mark Mitchell) Date: Sun, 18 Mar 2007 21:56:01 -0400 Subject: [Pljava-dev] Exception in read/write text files In-Reply-To: References: Message-ID: <449f4cf70703181856y459678cdoed68f12a1aecd970@mail.gmail.com> I believe you have to use the untrusted java (javaU) -- I can't access the pljava wiki at tada[1] for some reason at the moment, but I believe there are instructions there for how to add a function that uses the untrsted java language extension rather than a normal trusted one (untrusted allows access to the filesystem). -Mark [1] http://wiki.tada.se/wiki/ On 3/18/07, claudio ferraz wrote: > Hello friends, > > Im trying read/write a text file using PL/Java. However, I am receiving the > following error: > The directory is C:\ statistics.txt. Somebody can help me? > Thanks a lot. > > > ERROR: 18 Mar 07 16:51:59 axml.Active java.lang.SecurityException: read on > C:\statistics.txt > java.lang.SecurityException: read on C:\statistics.txt > at > org.postgresql.pljava.internal.Backend$2.assertPermission(Backend.java:187) > at > org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.nonRecursiveCheck(Backend.java:128) > at > org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.checkPermission(Backend.java:106) > at java.lang.SecurityManager.checkRead (Unknown Source) > at java.io.File.exists(Unknown Source) > at java.io.Win32FileSystem.canonicalize(Unknown Source) > at java.io.File.getCanonicalPath(Unknown Source) > at java.io.FilePermission$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native > Method) > at java.io.FilePermission.init(Unknown Source) > at java.io.FilePermission.(Unknown Source) > at java.lang.SecurityManager.checkRead (Unknown Source) > at java.io.File.exists(Unknown Source) > at java.io.Win32FileSystem.canonicalize(Unknown Source) > at java.io.File.getCanonicalPath(Unknown Source) > at java.io.FilePermission$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native > Method) > at java.io.FilePermission.init(Unknown Source) > at java.io.FilePermission.(Unknown Source) > at java.lang.SecurityManager.checkWrite (Unknown > Source) > at java.io.FileOutputStream.(Unknown Source) > at java.io.FileOutputStream.(Unknown Source) > at java.io.FileWriter.(Unknown Source) > at testes.StatisticsCollector.save (StatisticsCollector.java:102) > at axml.Active.executeService(Active.java:20) > > > > -- > Cl?udio A. Ferraz - Analista de Sistemas > Mestrando em Banco de Dados COPPE/UFRJ > "Se n?o puder fazer tudo, fa?a tudo o que puder." > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at gborg.postgresql.org > http://gborg.postgresql.org/mailman/listinfo/pljava-dev > >