[Pljava-dev] java.lang.SecurityException

From: filip(dot)hrbek at plz(dot)comstar(dot)cz (Filip Hrbek)
To:
Subject: [Pljava-dev] java.lang.SecurityException
Date: 2005-03-29 06:14:43
Message-ID: 005801c53426$99907530$1e03a8c0@fhrbek
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Hello,

try
SELECT sqlj.set_classpath('public', 'xercesImpl:xml_apis:PGtoXML');

instead of

SELECT sqlj.set_classpath('public', 'xercesImpl');

SELECT sqlj.set_classpath('public', 'xml_apis');

SELECT sqlj.set_classpath('public', 'PGtoXML');

If you set the classpath three times, only the last one is effective. You should set it only once using a colon separated string.

Thomas, I think there could be one reason to use explicit JDBC driver within PL/Java routine if you want to log something in an autonomous transaction (if your session crashes or is rolled back, logged items remain saved). However, I don't think that this would be the Joves's case.

Filip Hrbek

----- Original Message -----
From: Joves Luo
To: pljava-dev at gborg.postgresql.org
Sent: Tuesday, March 29, 2005 12:01 AM
Subject: [Pljava-dev] java.lang.SecurityException

Thomas Hallgren wrote: > >Only one method needs to be rewritten AFAICS, and that's the >constructor. Try this:> >public OWDBConnection() throws SQLException{> db = DriverManager.getConnection("jdbc:default:connection");>}> >That should do it. You will still use JDBC (that's just the interfaces) >but now you'll use the PL/Java jdbc implementation. The connection used >by PL/Java is implicit since it reflects the session of the caller of >the function, hence there's need to "login".> >If you got your code working on a windows system you probably have an >older version of PL/Java then yor setup must be slightly different >there. PL/Java somehow finds the jar file of the client driver. Perhaps >you had that jar file in your classpath in combination with a sligthly >older version of PL/Java where security was not as tight as it is now? >Eihter that, or you loaded the actual PostgreSQL client driver .jar file >into the database using sqlj.install_jar. As I explained earlier, such a >setup might seem to work although what really happens is that your >function will behave like a client for yet another backend. I have a >hard time thinking of a case when that would be desirable.> >Regards,>Thomas Hallgren>

Thank you once again. I have one (hopefully last) problem.

LOG: Exception

LOG: in thread "main"

java.lang.NoClassDefFoundError: org/apache/xerces/dom/DocumentImpl

at PGtoXML.OWDBtoXML.<init>(OWDBtoXML.java:19)

at PGtoXML.PGtoXML.getXmlString(PGtoXML.java:7)

ERROR: java.lang.NoClassDefFoundError: org/apache/xerces/dom/DocumentImpl

I have installed the xerces xml parser the same way I installed the PGtoXML jar file. Is there something else I need to do in order to have PGtoXML see xerces? How do I set the classpath to be seen? I've already entered:

SELECT sqlj.set_classpath('public', 'xercesImpl');

SELECT sqlj.set_classpath('public', 'xml_apis');

SELECT sqlj.set_classpath('public', 'PGtoXML');

Also, you were right; I was running pljava 1.0.0 on the windows box. I have replaced it with the latest version, and now both servers are broken. But I am sure that once I get this to work it'll be better than what I used to have.

Once again thank you for you help.

------------------------------------------------------------------------------

_______________________________________________
Pljava-dev mailing list
Pljava-dev at gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/pljava-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20050329/5714e1ef/attachment.html>

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2005-03-29 06:59:40 [Pljava-dev] java.lang.SecurityException
Previous Message Joves Luo 2005-03-28 22:01:16 [Pljava-dev] java.lang.SecurityException