agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC
4+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC
@ 2011-12-26 22:40  
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2011-12-26 22:40 UTC (permalink / raw)

So, I've managed to install PL/Java and most things seem to be running correctly.  However, when I try to run the examples, I get the following exception:

org.postgresql.util.PSQLException: ERROR: java.lang.SecurityException: read on /usr/share/javazi/UTC
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
	at org.postgresql.pljava.test.Tester.testTimestamp(Tester.java:532)
	at org.postgresql.pljava.test.Tester.testParameters(Tester.java:289)
	at org.postgresql.pljava.test.Tester.main(Tester.java:227)

Poking around a bit, I couldn't find anything regarding this error, although perhaps it does seem to be related to the fact that Java is running as a trusted language.  However, I wanted to be sure I understood what is going on here, and what the is the correct diagnosis.  This error seems to be caused by the normal, underlying Java mechanism for dealing with timezones.  As such, reading this file would seem to be the correct functioning of the system.  It seems a little odd that the underlying system's required reading from the file system would throw a security exception.  I can certainly understand if this was non-system code, but I would have thought the correct permissions were ensured by the system code.

So, am I reading this error correctly?  Will I be required to run the test example of PL/Java as untrusted code?  If I'm doing something wrong, or may have set something up incorrectly, please let me know.  It would be useful to understand what's going on here.  There does not seem to be anything printed out in the postgres logs other than:

2011-12-26 14:05:44.740 PST,"postgres","core-650-test",5356,"127.0.0.1:50820",4ef8efb8.14ec,2,"SELECT",2011-12-26 14:05:44 PST,3/13,0,ERROR,XX000,"java.lang.SecurityException: read on /usr/share/javazi/UTC",,,,,,"SELECT print(current_time)",,,""

Thanks



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

* [Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC
@ 2011-12-26 23:28  
  parent: 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2011-12-26 23:28 UTC (permalink / raw)

Tried this out using javau as the language and that does, in fact, solve the permission problem -i.e. I get no error when using javau.  So the question is whether this is the expected behavior.  I'm thinking no, because this was in the test example and should work.  Thus the question is why I'm running into this #fail...

On Dec 26, 2011, at 2:40 PM, Hal Hildebrand wrote:

> So, I've managed to install PL/Java and most things seem to be running correctly.  However, when I try to run the examples, I get the following exception:
> 
> org.postgresql.util.PSQLException: ERROR: java.lang.SecurityException: read on /usr/share/javazi/UTC
> 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
> 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
> 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
> 	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
> 	at org.postgresql.pljava.test.Tester.testTimestamp(Tester.java:532)
> 	at org.postgresql.pljava.test.Tester.testParameters(Tester.java:289)
> 	at org.postgresql.pljava.test.Tester.main(Tester.java:227)
> 
> Poking around a bit, I couldn't find anything regarding this error, although perhaps it does seem to be related to the fact that Java is running as a trusted language.  However, I wanted to be sure I understood what is going on here, and what the is the correct diagnosis.  This error seems to be caused by the normal, underlying Java mechanism for dealing with timezones.  As such, reading this file would seem to be the correct functioning of the system.  It seems a little odd that the underlying system's required reading from the file system would throw a security exception.  I can certainly understand if this was non-system code, but I would have thought the correct permissions were ensured by the system code.
> 
> So, am I reading this error correctly?  Will I be required to run the test example of PL/Java as untrusted code?  If I'm doing something wrong, or may have set something up incorrectly, please let me know.  It would be useful to understand what's going on here.  There does not seem to be anything printed out in the postgres logs other than:
> 
> 2011-12-26 14:05:44.740 PST,"postgres","core-650-test",5356,"127.0.0.1:50820",4ef8efb8.14ec,2,"SELECT",2011-12-26 14:05:44 PST,3/13,0,ERROR,XX000,"java.lang.SecurityException: read on /usr/share/javazi/UTC",,,,,,"SELECT print(current_time)",,,""
> 
> Thanks





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

* [Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC
@ 2012-01-04 00:45  
  parent: 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2012-01-04 00:45 UTC (permalink / raw)

Hal Hildebrand <hal.hildebrand at gmail.com> writes:

> Tried this out using javau as the language and that does, in fact,
> solve the permission problem -i.e. I get no error when using javau.
> So the question is whether this is the expected behavior.  I'm
> thinking no, because this was in the test example and should work.
> Thus the question is why I'm running into this #fail...

Thanks for the notice.  All I can say is that I'll take a look
sometime in the not too distant future.

Can you tell us a little bit more about your system?  OS type/version,
Java implementation (Oracle? OpenJDK? ...) and version?  Postgres
version?


-- 
   Johann Oskarsson                http://www.2ndquadrant.com/    |[]
   PostgreSQL Development, 24x7 Support, Training and Services  --+--
                                                                  |
   Blog: http://my.opera.com/myrkraverk/blog/




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

* [Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC
@ 2012-01-06 05:41  
  parent: 
  0 siblings, 0 replies; 4+ messages in thread

From:  @ 2012-01-06 05:41 UTC (permalink / raw)

Sure.  I'm running on Ubuntu 11.10, using PostgreSql 9.1x, PL/Java 1.4.3, Java open JDK 6b23~pre11-0ubuntu1.11.10.

Understand that I'm "outside the band" with 1.6, but this particular failure is the only problem I've had with 1.6.  Considering it's nature, it's pretty clear it's just a permission issue, but I'm not entirely sure why it would be failing, given that this particular piece o' base JRE should pretty much have god rights and know wtf default directories its gonna read.  So that's curious to me...  Very curious.

On Jan 3, 2012, at 4:45 PM, Johann 'Myrkraverk' Oskarsson wrote:
> 
> Thanks for the notice.  All I can say is that I'll take a look
> sometime in the not too distant future.
> 
> Can you tell us a little bit more about your system?  OS type/version,
> Java implementation (Oracle? OpenJDK? ...) and version?  Postgres
> version?




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


end of thread, other threads:[~2012-01-06 05:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-26 22:40 [Pljava-dev] java.lang.SecurityException: read on /usr/share/javazi/UTC 
2011-12-26 23:28 ` 
2012-01-04 00:45   ` 
2012-01-06 05:41     ` 

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