Lists: | pljava-dev |
---|
From: | jluo at teltronics(dot)com (Joves Luo) |
---|---|
To: | |
Subject: | [Pljava-dev] java.lang.SecurityException |
Date: | 2005-03-28 16:42:28 |
Message-ID: | 11C803742910E84E9CDBFD344773B814759F77@srqech02.teltronics.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
Someone please help me, this is driving me crazy.
I wrote a java program that accesses a database and turns the data into
an xml string. I then use php to write that string to an .xml file.
Originally I was developing the program on a windows 2k server using
Apache 2, php5, and postgresql 8 with pljava.
My boss wanted me to move the server onto a Linux 7.3 box. So now the
entire thing is sitting on a Linux 7.3 server with Apache 1.3, php4, and
postgresql 8 with pljava.
Everything works except for the java application. I run:
select getxmlstring();
and I get:
ERROR: java.lang.SecurityException: read on
/var/lib/pgsql/pljava/PGtoXML.jar
Here is the stack trace from the log file:
java.lang.SecurityException: read on /var/lib/pgsql/pljava/PGtoXML.jar
at
org.postgresql.pljava.internal.Backend$2.assertPermission(Backend.java:1
84)
at
org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.nonRecursiv
eCheck(Backend.java:125)
at
org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.checkPermis
sion(Backend.java:103)
at java.net.URLClassLoader$5.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.getPermissions(Unknown Source)
at sun.misc.Launcher$AppClassLoader.getPermissions(Unknown
Source)
at java.security.SecureClassLoader.getProtectionDomain(Unknown
Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
ERROR: java.lang.SecurityException: read on
/var/lib/pgsql/pljava/PGtoXML.jar
I tried looking at the source code of pljava.internal.Backend, but there
are 3 places where the exception can be thrown. Can someone please help
me out?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20050328/7609db98/attachment.html>
From: | thhal at mailblocks(dot)com (Thomas Hallgren) |
---|---|
To: | |
Subject: | [Pljava-dev] java.lang.SecurityException |
Date: | 2005-03-28 16:50:24 |
Message-ID: | 424835D0.8020309@mailblocks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
Joves Luo wrote:
> Someone please help me, this is driving me crazy.
>
You try to load the PGtoXML.jar using the system classloader instead of
installing it in the database with sqlj.install_jar, or in other words,
you add the PGtoXML.jar to the PL/Java classpath. This in turn, causes
an illegal file access. PL/Java installs "java" as a trusted language.
Trusted languages have no access to the file system. Try installing
removing PGtoXML.jar from the classpath and instead install it into the
database using install_jar.
Regards,
Thomas Hallgren