agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] java.lang.SecurityException
Date: Tue, 29 Mar 2005 08:14:43 +0200
Message-ID: <005801c53426$99907530$1e03a8c0@fhrbek> (raw)
References: <11C803742910E84E9CDBFD344773B814759F9C@srqech02.teltronics.com>

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;



view thread (35+ messages)  latest in thread

Message-ID: <005801c53426$99907530$1e03a8c0@fhrbek>
Permalink:  ../005801c53426$99907530$1e03a8c0@fhrbek/
Also on:    postgresql.org/message-id/005801c53426$99907530$1e03a8c0@fhrbek

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] java.lang.SecurityException
  In-Reply-To: <005801c53426$99907530$1e03a8c0@fhrbek>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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