[Pljava-dev] question on reading files using PL/Java

Lists: pljava-dev
From: tjkincaid at comcast(dot)net (tjkincaid at comcast(dot)net)
To:
Subject: [Pljava-dev] question on reading files using PL/Java
Date: 2011-08-29 02:27:55
Message-ID: 1270594531.828544.1314584875392.JavaMail.root@sz0075a.westchester.pa.mail.comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

I am trying to read some xml files on that are posted on the server's hard drive using the jdom library from with in PL/Java. Everything works fine outside PL/Java. I can read the xml file and parse the document no problem. However, from within PL/Java I am getting a security exception when I attempt to open the file. I have checked all the permissions on the file and everything seems OK. By default, PL/Java not allowed to read files on the server's hard drive? If not, is there a way I can configure it to allow this?

ERROR: java.lang.SecurityException: read on /home/tomkincaid/pgdevel/pljava/ubiq-aug-2011-aug3.xml
tomkincaid=# \q
[tomkincaid at localhost pljava]$ cp ubiq-aug-2011-aug3.xml /tmp/xmltest.xml
[tomkincaid at localhost pljava]$ psql
edb-psql (9.0.4.14)
Type "help" for help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20110829/44f8cf47/attachment.html>


From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] question on reading files using PL/Java
Date: 2011-08-29 06:02:48
Message-ID: 4E5B2B88.6090203@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

From: pierce at hogranch(dot)com (John R Pierce)
To:
Subject: [Pljava-dev] question on reading files using PL/Java
Date: 2011-08-29 06:21:53
Message-ID: 4E5B3001.8040405@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On 08/28/11 7:27 PM, tjkincaid at comcast.net wrote:
> ERROR: java.lang.SecurityException: read on
> /home/tomkincaid/pgdevel/pljava/ubiq-aug-2011-aug3.xml

d0es that file and all the directories above it have world-read
attributes? pljava will be running as the postgresql *server* user,
probably 'postgres', not as your local user account, so will only be
able to access files that 'postgres' can access.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast