agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Exception in read/write text files
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Exception in read/write text files
@ 2007-03-18 20:07  
  0 siblings, 1 reply; 3+ messages in thread

From:  @ 2007-03-18 20:07 UTC (permalink / raw)

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.<init>(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.<init>(Unknown Source)
    at java.lang.SecurityManager.checkWrite(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileWriter.<init>(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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20070318/dfac2e34/attachment.html;



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Exception in read/write text files
@ 2007-03-19 01:56  
  parent: 
  0 siblings, 1 reply; 3+ messages in thread

From:  @ 2007-03-19 01:56 UTC (permalink / raw)

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 <claudioaferraz at gmail.com> 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.<init>(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.<init>(Unknown Source)
>     at java.lang.SecurityManager.checkWrite (Unknown
> Source)
>     at java.io.FileOutputStream.<init>(Unknown Source)
>     at java.io.FileOutputStream.<init>(Unknown Source)
>     at java.io.FileWriter.<init>(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
>
>




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Exception in read/write text files
@ 2007-03-19 15:20  
  parent: 
  0 siblings, 0 replies; 3+ messages in thread

From:  @ 2007-03-19 15:20 UTC (permalink / raw)

Hi Mark,

Im using trusted java, see this:
CREATE OR REPLACE FUNCTION execute_service(int4, "varchar", int4)
  RETURNS int4 AS
'axml.Active.executeService'
  LANGUAGE 'java' VOLATILE;
I  try access   http://wiki.tada.se/wiki/ , but this link does not work.
Have one another ideia?
Thanks a lot , sorry my poor english.

Cl?udio

2007/3/18, Mark Mitchell <mark81 at 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 <claudioaferraz at gmail.com> 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.<init>(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.<init>(Unknown Source)
> >     at java.lang.SecurityManager.checkWrite (Unknown
> > Source)
> >     at java.io.FileOutputStream.<init>(Unknown Source)
> >     at java.io.FileOutputStream.<init>(Unknown Source)
> >     at java.io.FileWriter.<init>(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
> >
> >
>



-- 
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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20070319/7ec29e15/attachment.html;



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-03-19 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-18 20:07 [Pljava-dev] Exception in read/write text files 
2007-03-19 01:56 ` 
2007-03-19 15:20   ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox