From sfarley1 at gmu.edu Wed Feb 3 15:12:18 2010 From: sfarley1 at gmu.edu (sfarley1 at gmu.edu) Date: Wed, 3 Feb 2010 15:12:18 +0000 Subject: [Pljava-dev] Install Error Message-ID: <230598078-1265209815-cardhu_decombobulator_blackberry.rim.net-2130733305-@bda033.bisx.prod.on.blackberry> I'm trying to install pl/java on my laptop for Postgres. I originally tried it with 8.4, but reverted to 8.4 hoping it would fix the problem, but I am getting the same error. The error is: ERROR: could not load library "D:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found I have the following in poosgressql.conf file custom_variable_classes = 'pljava'# list of custom variable class names pljava.classpath='D:\\Program Files\\PostgreSQL\\8.3\\share\\pljava\\pljava.jar' dynamic_library_path = 'D:\\Program Files\\PostgreSQL\\8.3\\lib\\postgresql' My Path variable is: %SSJHOME%\lib;%JAVA_HOME%\bin ;D:\Program Files\Java\jre6\bin;D:\Program Files\Java\jre6\bin\client;D:/Program Files/PostgreSQL/8.3/lib; And my Classpath variable is: .;%SSJHOME%\lib\ssj.jar;%SSJHOME%\lib\colt.jar;D:\Program Files\PostgreSQL\pgJDBC\postgresql-8.4-701.jdbc3.jar;D:\Program Files\PostgreSQL\8.3\share\pljava\deploy.jar I'm using Windows 7 and have the java JDK 1.6 and jre 6 installed. Any ideas of how to resolve this? Thank you, Susan Sent from my Verizon Wireless BlackBerry From tim.clarke at manifest.co.uk Sun Mar 7 19:33:00 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Sun, 07 Mar 2010 19:33:00 +0000 Subject: [Pljava-dev] Using JDBC in PL/Java 1.4.0: Statement.executeQuery() automatically closes the statement redux Message-ID: <4B93FF6C.1000605@manifest.co.uk> I've been tracking down a problem where checking getWarnings() after an executeQuery() in pljava and found an exchange on the list from 2008 that matches my symptoms exactly: http://pgfoundry.org/pipermail/pljava-dev/2008/001298.html Kris Jurka replied swiftly and fixed the issue in the source tree. Was this ever released live? I've just downloaded the latest: http://pgfoundry.org/frs/download.php/1597/pljava-i686-pc-linux-gnu-pg8.2-1.4.0.tar.gz To run against our PG 8.2.15 database and I'm still getting the problem. -- Tim Clarke AMBCS MIAP IT Director Manifest 9 Freebournes Court Newland Street Witham, Essex CM8 2BL England Phone: +44 1376 503500 Direct: +44 1376 504510 Fax: +44 1376 503550 Email: tim.clarke at manifest.co.uk Web: http://www.manifest.co.uk Skype: callto:tim.clarke Manifest is the trading name of: Manifest Information Services Ltd: Registered in England Number 3401145 & The Manifest Voting Agency Ltd: Registered in England Number 2920820. Registered Office at above address. VAT Registration Number: GB 700 1880 77 Copyright: This e-mail may contain confidential or legally privileged information. If you are not the named addressee you must not use or disclose such information, instead please report it to: admin at manifest.co.uk Please see http://www.manifest.co.uk/legal/legal_notices.htm for further information. From jcllario at hotmail.com Wed Mar 10 23:15:45 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Thu, 11 Mar 2010 00:15:45 +0100 Subject: [Pljava-dev] sqlj.install_jar vs classpath Message-ID: Hi all, I am using PLJAVA in a project that needs many other jars, around 20 different jars. I have configured PLJAVA with my project in t2o different ways: 1) I configured the postgres.conf file with the classpath pointing out to pljava.jar and the rest of the jars. I didnt use sqlj.install_jar 2) I configured the postgres.conf file with pljava.jar and the rest of jars with sqlj.install_jar Both options are working well and I think the postmaster is using the same amount of memory in each connection. So my question is: Both procedures are similar or I should use one of them in particular?.. Another question I wanted to ask to this forum is: The only way to share the jars between different postgres clients is to use GCJ? What about using the option Xshareclasses in the virtual machines (someone has tried that?). Thanx a lot for the answers, Jose MArtinez _________________________________________________________________ Escucha a quienes ya han probado Windows 7 ?Hazlo aqu?! http://www.sietesunpueblodeexpertos.com/index_windows7.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Wed Mar 10 23:23:16 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Thu, 11 Mar 2010 00:23:16 +0100 Subject: [Pljava-dev] Pljava not using the default java virtual machine Message-ID: Hi everyone..again! sorry because I already sent another post just few secs ago, but I had another question that I couldnt solved surfing on the internet. I want to change the java vm used in pljava, but I do not want to change the system variables java_home, etc. What I would like to download a JRE in a directory just for PLJAVA and then to put there all the jars and configuration files I need. So there is some way that pljava could point out to another java vm? If not, it is possible to change to source code to make it? Currently Im developing a spatial extension to postgres similar to postgis but just using java. its working fine but i need to make easier to the final user the installation process. I though about downloading the JRE plus pljava.jar and other files and to keep a JRE prepared just for this software. thanx a lot guys, Jose MArtinez _________________________________________________________________ Ahora Messenger en tu Blackberry? 8520 con Movistar por 0 ?. ?A qu? esperas? http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.clarke at manifest.co.uk Fri Mar 12 13:35:45 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Fri, 12 Mar 2010 13:35:45 +0000 Subject: [Pljava-dev] Using JDBC in PL/Java 1.4.0: Statement.executeQuery() automatically closes the statement redux In-Reply-To: <4B93FF6C.1000605@manifest.co.uk> References: <4B93FF6C.1000605@manifest.co.uk> Message-ID: <4B9A4331.4020408@manifest.co.uk> > > I've been tracking down a problem where checking getWarnings() after an > executeQuery() in pljava and found an exchange on the list from 2008 > that matches my symptoms exactly: > > http://pgfoundry.org/pipermail/pljava-dev/2008/001298.html > > > Kris Jurka replied swiftly and fixed the issue in the source tree. Was > this ever released live? I've just downloaded the latest: > > http://pgfoundry.org/frs/download.php/1597/pljava-i686-pc-linux-gnu-pg8.2-1.4.0.tar.gz > > To run against our PG 8.2.15 database and I'm still getting the problem. > > I (think) I've managed to get a compile now using Eclipse and jdk1.5_10. Unfortunately when registering my java function calls using set search_path=voting; select sqlj.install_jar('file:///usr/local/manifest/vote.jar', 'vote', false); select sqlj.install_jar('file:///usr/share/java/log4j.jar', 'log4j', false); SELECT sqlj.set_classpath('voting', 'vote:log4j'); CREATE or replace FUNCTION vote(AccountID int8, CapitalID int8, EventID int8, CanCopy bool, CopyFromEventID int8) RETURNS varchar AS 'uk.co.manifest.postgres.vote.VoteCalc.vote(long, long, long, boolean, long)' volatile LANGUAGE java; I get the error: java.lang.NoSuchMethodError: Method org.postgresql.pljava.internal.Portal._ fetch(JZI)I on that first install_jar() call followed by "failed to create JVM" on any subsequent calls :-/ I've not found an answer by googling. Can anyone help? -- Tim Clarke AMBCS MIAP IT Director Manifest 9 Freebournes Court Newland Street Witham, Essex CM8 2BL England Phone: +44 1376 503500 Direct: +44 1376 504510 Fax: +44 1376 503550 Email: tim.clarke at manifest.co.uk Web: http://www.manifest.co.uk Skype: callto:tim.clarke Manifest is the trading name of: Manifest Information Services Ltd: Registered in England Number 3401145 & The Manifest Voting Agency Ltd: Registered in England Number 2920820. Registered Office at above address. VAT Registration Number: GB 700 1880 77 Copyright: This e-mail may contain confidential or legally privileged information. If you are not the named addressee you must not use or disclose such information, instead please report it to: admin at manifest.co.uk Please see http://www.manifest.co.uk/legal/legal_notices.htm for further information. From jcllario at hotmail.com Mon Mar 15 20:22:56 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Mon, 15 Mar 2010 21:22:56 +0100 Subject: [Pljava-dev] How to cancel a trigger operation Message-ID: HI all, Some of you knows how to cancel a trigger operation (insert, delete or update) from a trigger function in PLJAVA? In PLPGSQL I know I can get it returning a null value. I tried several things in PLJAVA but i couldnt make it. Thanx a lot, Best, Jose Martinez _________________________________________________________________ Recibe en tu m?vil un SMS con tu Hotmail recibido. ?Date de alta ya! http://serviciosmoviles.es.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Tue Mar 16 09:35:03 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Tue, 16 Mar 2010 10:35:03 +0100 Subject: [Pljava-dev] How to cancel a trigger operation In-Reply-To: <3fccaa691003151328x175f77a3i7c6a84d0a198b169@mail.gmail.com> References: , <3fccaa691003151328x175f77a3i7c6a84d0a198b169@mail.gmail.com> Message-ID: Hi Andres, Thanks for the answer. Throwing an exception works but not in the way i need because the transaction is aborted. I was looking for something that I already read in this list: http://pgfoundry.org/pipermail/pljava-dev/2006/001000.html http://pgfoundry.org/pipermail/pljava-dev/2006/001001.html I was expecting someone already fixed that bug (i think its a bug because we can not use triggers in a proper way) because these posts are from 4 years ago. Has someone already worked in this bug? Thanks to all, Best, Jose _________________________________________________________________ ?Te gustar?a tener Hotmail en tu m?vil Movistar? ?Es gratis! http://serviciosmoviles.es.msn.com/hotmail/movistar-particulares.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Fri Mar 19 15:02:01 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Fri, 19 Mar 2010 16:02:01 +0100 Subject: [Pljava-dev] how to cancel a trigger operation Message-ID: Hi all, Im sending this email again to the list because I really need to get an answer for the pljava developers or someone who can help me. Im wondering how to cancel a trigger operation. Throwing an exception works but not in the way i need because the transaction is aborted. I was looking for something that I already read in this list: http://pgfoundry.org/pipermail/pljava-dev/2006/001000.html http://pgfoundry.org/pipermail/pljava-dev/2006/001001.html I was expecting someone already fixed that bug (i think its a bug because we can not use triggers in a proper way) because these posts are from 4 years ago. Has someone already worked in this bug? Thanks to all, Best, Jose _________________________________________________________________ Escucha a quienes ya han probado Windows 7 ?Hazlo aqu?! http://www.sietesunpueblodeexpertos.com/index_windows7.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Fri Mar 19 15:48:02 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Fri, 19 Mar 2010 16:48:02 +0100 Subject: [Pljava-dev] how to cancel a trigger operation In-Reply-To: References: , Message-ID: Hi Jon, for many reasons: -All my project is java. It is a spatial extension for postgres and h2 -plpgsql is not working because i need to know the column names so i can use NEW.something or OLD.something..so and other stuff i have to use C or plpython or Pljava -pljava works perfect with triggers but it has the problem i mentioned so my question is related just with PLJAVA and Triggers. I already know how to solve that in C or other pl languages. Cheers, Jose Subject: RE: [Pljava-dev] how to cancel a trigger operation Date: Fri, 19 Mar 2010 10:31:45 -0500 From: Jon.Roberts at asurion.com To: jcllario at hotmail.com; pljava-dev at pgfoundry.org I?ll bite. Why are you using triggers? Why are you using Java for the trigger code? Jon From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of JOSE CARLOS MARTINEZ LLARIO Sent: Friday, March 19, 2010 10:02 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] how to cancel a trigger operation Hi all, Im sending this email again to the list because I really need to get an answer for the pljava developers or someone who can help me. Im wondering how to cancel a trigger operation. Throwing an exception works but not in the way i need because the transaction is aborted. I was looking for something that I already read in this list: http://pgfoundry.org/pipermail/pljava-dev/2006/001000.html http://pgfoundry.org/pipermail/pljava-dev/2006/001001.html I was expecting someone already fixed that bug (i think its a bug because we can not use triggers in a proper way) because these posts are from 4 years ago. Has someone already worked in this bug? Thanks to all, Best, Jose Actual?zate gratis al nuevo Internet Explorer 8 y navega m?s seguro _________________________________________________________________ ?Te gustar?a tener Hotmail en tu m?vil Movistar? ?Es gratis! http://serviciosmoviles.es.msn.com/hotmail/movistar-particulares.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jon.Roberts at asurion.com Fri Mar 19 15:31:45 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Fri, 19 Mar 2010 10:31:45 -0500 Subject: [Pljava-dev] how to cancel a trigger operation In-Reply-To: References: Message-ID: I'll bite. Why are you using triggers? Why are you using Java for the trigger code? Jon From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of JOSE CARLOS MARTINEZ LLARIO Sent: Friday, March 19, 2010 10:02 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] how to cancel a trigger operation Hi all, Im sending this email again to the list because I really need to get an answer for the pljava developers or someone who can help me. Im wondering how to cancel a trigger operation. Throwing an exception works but not in the way i need because the transaction is aborted. I was looking for something that I already read in this list: http://pgfoundry.org/pipermail/pljava-dev/2006/001000.html http://pgfoundry.org/pipermail/pljava-dev/2006/001001.html I was expecting someone already fixed that bug (i think its a bug because we can not use triggers in a proper way) because these posts are from 4 years ago. Has someone already worked in this bug? Thanks to all, Best, Jose ________________________________ Actual?zate gratis al nuevo Internet Explorer 8 y navega m?s seguro -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim.clarke at manifest.co.uk Mon Mar 22 12:29:07 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Mon, 22 Mar 2010 12:29:07 +0000 Subject: [Pljava-dev] Using JDBC in PL/Java 1.4.0: Statement.executeQuery() automatically closes the statement redux In-Reply-To: <4B9A4331.4020408@manifest.co.uk> References: <4B93FF6C.1000605@manifest.co.uk> <4B9A4331.4020408@manifest.co.uk> Message-ID: <4BA76293.5080101@manifest.co.uk> On 12/03/10 13:35, Tim Clarke wrote: >> I've been tracking down a problem where checking getWarnings() after an >> executeQuery() in pljava and found an exchange on the list from 2008 >> that matches my symptoms exactly: >> >> http://pgfoundry.org/pipermail/pljava-dev/2008/001298.html >> >> >> Kris Jurka replied swiftly and fixed the issue in the source tree. Was >> this ever released live? I've just downloaded the latest: >> >> http://pgfoundry.org/frs/download.php/1597/pljava-i686-pc-linux-gnu-pg8.2-1.4.0.tar.gz >> >> To run against our PG 8.2.15 database and I'm still getting the problem. >> >> >> > I (think) I've managed to get a compile now using Eclipse and jdk1.5_10. > Unfortunately when registering my java function calls using > > set search_path=voting; > > select sqlj.install_jar('file:///usr/local/manifest/vote.jar', > 'vote', false); > select sqlj.install_jar('file:///usr/share/java/log4j.jar', > 'log4j', false); > SELECT sqlj.set_classpath('voting', 'vote:log4j'); > > CREATE or replace FUNCTION vote(AccountID int8, CapitalID int8, > EventID int8, CanCopy bool, CopyFromEventID int8) > RETURNS varchar > AS 'uk.co.manifest.postgres.vote.VoteCalc.vote(long, long, long, > boolean, long)' > volatile LANGUAGE java; > > I get the error: > > java.lang.NoSuchMethodError: Method org.postgresql.pljava.internal.Portal._ > fetch(JZI)I > > on that first install_jar() call followed by "failed to create JVM" on > any subsequent calls :-/ I've not found an answer by googling. Can > anyone help? > Just for the record (the list's a bit quiet ;-) : The answer was that the version of the pljava.so file was out of step. I ran make from command line instead of trying to export from eclipse; obviously that did not build the C object. I found the correct version in the folder tree after running make at the command line. -- Tim Clarke AMBCS MIAP IT Director Manifest 9 Freebournes Court Newland Street Witham, Essex CM8 2BL England Phone: +44 1376 503500 Direct: +44 1376 504510 Fax: +44 1376 503550 Email: tim.clarke at manifest.co.uk Web: http://www.manifest.co.uk Skype: callto:tim.clarke Manifest is the trading name of: Manifest Information Services Ltd: Registered in England Number 3401145 & The Manifest Voting Agency Ltd: Registered in England Number 2920820. Registered Office at above address. VAT Registration Number: GB 700 1880 77 Copyright: This e-mail may contain confidential or legally privileged information. If you are not the named addressee you must not use or disclose such information, instead please report it to: admin at manifest.co.uk Please see http://www.manifest.co.uk/legal/legal_notices.htm for further information. From sfarley1 at gmu.edu Wed Mar 24 15:34:28 2010 From: sfarley1 at gmu.edu (Susan M Farley) Date: Wed, 24 Mar 2010 10:34:28 -0500 Subject: [Pljava-dev] Function Error Message-ID: I'm trying to import a function in Java, but am having problems with it. The java function is public static double chi2cdf (double x) { return chi.cdf(x); } I copied the sim.class file to the Postgres data directory and I added it to Postgres with the following select sqlj.replace_jar('file:///D:/workspace/SimplePrediction/sim.jar','sim',true); SELECT sqlj.set_classpath('public', 'sim'); CREATE OR REPLACE FUNCTION sim.chi2cdf(double precision) RETURNS double precision AS 'simpleMonteCarlo.sim.chi2cdf' LANGUAGE java; When I try to run it, I get the following error: ERROR: Unable to find static method simpleMonteCarlo.sim.chi2cdf with signature (D)D I thought it was the signature of double precision, but then tried it with two other functions, one a float and one a int and get similar errors. Does anyone have any ideas? Thank you, Susan -- Sent via pgsql-novice mailing list (pgsql-novice at postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-novice From Jon.Roberts at asurion.com Wed Mar 24 16:01:30 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Wed, 24 Mar 2010 11:01:30 -0500 Subject: [Pljava-dev] Function Error In-Reply-To: References: Message-ID: <8661B041D452404E8088FBD47D2443BE2532EF@NDCEXCUS703.int.asurion.com> I believe the problem is the classpath. You are putting the jar in the public schema but your function is in the sim schema. Try this: select sqlj.remove_jar('sim', true); select * from sqlj.install_jar('file:///D:/workspace/SimplePrediction/sim.jar','sim_ja r',true); select sqlj.set_classpath('sim', 'sim_jar'); CREATE OR REPLACE FUNCTION sim.chi2cdf(double precision) RETURNS double precision AS 'simpleMonteCarlo.sim.chi2cdf' LANGUAGE java; If that isn't it, try changing the Java method to return a java.lang.String and then have your PostgreSQL function return a character varying. That will eliminate the possibility of a signature problem. Jon -----Original Message----- From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Susan M Farley Sent: Wednesday, March 24, 2010 10:34 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] Function Error I'm trying to import a function in Java, but am having problems with it. The java function is public static double chi2cdf (double x) { return chi.cdf(x); } I copied the sim.class file to the Postgres data directory and I added it to Postgres with the following select sqlj.replace_jar('file:///D:/workspace/SimplePrediction/sim.jar','sim',t rue); SELECT sqlj.set_classpath('public', 'sim'); CREATE OR REPLACE FUNCTION sim.chi2cdf(double precision) RETURNS double precision AS 'simpleMonteCarlo.sim.chi2cdf' LANGUAGE java; When I try to run it, I get the following error: ERROR: Unable to find static method simpleMonteCarlo.sim.chi2cdf with signature (D)D I thought it was the signature of double precision, but then tried it with two other functions, one a float and one a int and get similar errors. Does anyone have any ideas? Thank you, Susan -- Sent via pgsql-novice mailing list (pgsql-novice at postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-novice _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev From tim.clarke at manifest.co.uk Wed Mar 24 16:07:41 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Wed, 24 Mar 2010 16:07:41 +0000 Subject: [Pljava-dev] Function Error In-Reply-To: <8661B041D452404E8088FBD47D2443BE2532EF@NDCEXCUS703.int.asurion.com> References: <8661B041D452404E8088FBD47D2443BE2532EF@NDCEXCUS703.int.asurion.com> Message-ID: <4BAA38CD.1080700@manifest.co.uk> On 24/03/10 16:01, Roberts, Jon wrote: > I believe the problem is the classpath. You are putting the jar in the > public schema but your function is in the sim schema. Try this: > > select sqlj.remove_jar('sim', true); > select * from > sqlj.install_jar('file:///D:/workspace/SimplePrediction/sim.jar','sim_ja > r',true); > select sqlj.set_classpath('sim', 'sim_jar'); > > CREATE OR REPLACE FUNCTION sim.chi2cdf(double precision) > RETURNS double precision > AS 'simpleMonteCarlo.sim.chi2cdf' > LANGUAGE java; > > If that isn't it, try changing the Java method to return a > java.lang.String and then have your PostgreSQL function return a > character varying. That will eliminate the possibility of a signature > problem. > > > Jon > > -----Original Message----- > From: pljava-dev-bounces at pgfoundry.org > [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Susan M Farley > Sent: Wednesday, March 24, 2010 10:34 AM > To: pljava-dev at pgfoundry.org > Subject: [Pljava-dev] Function Error > > I'm trying to import a function in Java, but am having problems with it. > The java function is > > public static double chi2cdf (double x) > { > return chi.cdf(x); > } > > I copied the sim.class file to the Postgres data directory and I added > it to Postgres with the following > select > sqlj.replace_jar('file:///D:/workspace/SimplePrediction/sim.jar','sim',t > rue); > > SELECT sqlj.set_classpath('public', 'sim'); > > CREATE OR REPLACE FUNCTION sim.chi2cdf(double precision) > RETURNS double precision > AS 'simpleMonteCarlo.sim.chi2cdf' > LANGUAGE java; > > When I try to run it, I get the following error: > ERROR: Unable to find static method simpleMonteCarlo.sim.chi2cdf with > signature (D)D > > I thought it was the signature of double precision, but then tried it > with two other functions, one a float and one a int and get similar > errors. Does anyone have any ideas? > > Thank you, > Susan > Or possibly the file itself - you said that you "copied the sim.class file" - should you not have put a .jar file instead? -- Tim Clarke AMBCS MIAP IT Director Manifest 9 Freebournes Court Newland Street Witham, Essex CM8 2BL England Phone: +44 1376 503500 Direct: +44 1376 504510 Fax: +44 1376 503550 Email: tim.clarke at manifest.co.uk Web: http://www.manifest.co.uk Skype: callto:tim.clarke Manifest is the trading name of: Manifest Information Services Ltd: Registered in England Number 3401145 & The Manifest Voting Agency Ltd: Registered in England Number 2920820. Registered Office at above address. VAT Registration Number: GB 700 1880 77 Copyright: This e-mail may contain confidential or legally privileged information. If you are not the named addressee you must not use or disclose such information, instead please report it to: admin at manifest.co.uk Please see http://www.manifest.co.uk/legal/legal_notices.htm for further information. From tle at redseal.net Mon Mar 29 21:44:21 2010 From: tle at redseal.net (Thang Le) Date: Mon, 29 Mar 2010 14:44:21 -0700 (PDT) Subject: [Pljava-dev] Issue with SunMSCAPI jar file Message-ID: <001e01cacf88$fe032000$fa096000$@net> I'm testing out the 1.4 PL/Java version. In the code we're invoking from Postgres, there is a setup for SSL. The whole thing runs normally outside of Postgres. However within Postgres, it gives the error: ERROR: java.lang.NoClassDefFoundError: Could not initialize class sun.security.mscapi.SunMSCAPI On the surface of it, this means sunmscapi.jar not found. But I did add this jar file to the classpath. In any case, it is at the normal location in the JRE installation, and since the jvm.dll from the JRE is in the system path and seen by pl/java (simple calls without the SSL part work fine), I assume it sees the file sunmscapi.jar as well. I notice that many times, the error in PL/Java is not exactly the underlying cause. For example when it says pljava.dll not found, it in fact means jvm.dll is not found, and pljava.dll can't be initialized. So I suspect it's something similar here. But without a more detailed error message, I'm not sure how to go about a fix. Maybe sunmscapi.jar is making use of some services that can't be found or initialized? Any idea? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas at tada.se Tue Mar 30 06:02:13 2010 From: thomas at tada.se (Thomas Hallgren) Date: Tue, 30 Mar 2010 08:02:13 +0200 Subject: [Pljava-dev] Issue with SunMSCAPI jar file In-Reply-To: <001e01cacf88$fe032000$fa096000$@net> References: <001e01cacf88$fe032000$fa096000$@net> Message-ID: <4BB193E5.3060904@tada.se> An HTML attachment was scrubbed... URL: From tle at redseal.net Tue Mar 30 18:23:11 2010 From: tle at redseal.net (Thang Le) Date: Tue, 30 Mar 2010 11:23:11 -0700 (PDT) Subject: [Pljava-dev] Issue with SunMSCAPI jar file In-Reply-To: <4BB193E5.3060904@tada.se> References: <001e01cacf88$fe032000$fa096000$@net> <4BB193E5.3060904@tada.se> Message-ID: <001601cad036$0e3ef9a0$2abcece0$@net> Hi Thomas, I think it's likely something in the initialization of MSCAPI that failed. It turns out MSCAPI is just one of the many cryptographic providers for Java (it's last in the list actually). So I commented it out (in java.security), and the error is gone. SSL is still ok. By doing this I probably lose out some functionalities (MS crypto library?) but for the time being it works for me. By the way I'm not sure about what you said regarding javaU. If only untrusted Java can open sockets and access files, that seems counter-intuitive to me. My code to open sockets has 'java' as the language, and it seems to work just fine. Thang From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Thomas Hallgren Sent: Monday, March 29, 2010 11:02 PM To: pljava-dev at pgfoundry.org Subject: Re: [Pljava-dev] Issue with SunMSCAPI jar file Hi Thang, A NoClassDefFoundError is usually an indication that the class in question indeed is found but something that it depends on is missing or cannot initialize. Perhaps an external access is attempted when this happens? PL/Java will prevent the process from opening sockets and access files in the file system unless you run it as a non trusted ( javaU ) language. HTH, Thomas Hallgren On 03/29/2010 11:44 PM, Thang Le wrote: I'm testing out the 1.4 PL/Java version. In the code we're invoking from Postgres, there is a setup for SSL. The whole thing runs normally outside of Postgres. However within Postgres, it gives the error: ERROR: java.lang.NoClassDefFoundError: Could not initialize class sun.security.mscapi.SunMSCAPI On the surface of it, this means sunmscapi.jar not found. But I did add this jar file to the classpath. In any case, it is at the normal location in the JRE installation, and since the jvm.dll from the JRE is in the system path and seen by pl/java (simple calls without the SSL part work fine), I assume it sees the file sunmscapi.jar as well. I notice that many times, the error in PL/Java is not exactly the underlying cause. For example when it says pljava.dll not found, it in fact means jvm.dll is not found, and pljava.dll can't be initialized. So I suspect it's something similar here. But without a more detailed error message, I'm not sure how to go about a fix. Maybe sunmscapi.jar is making use of some services that can't be found or initialized? Any idea? Thanks! _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierce at hogranch.com Thu Apr 15 22:03:14 2010 From: pierce at hogranch.com (John R Pierce) Date: Thu, 15 Apr 2010 15:03:14 -0700 Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit Message-ID: <4BC78D22.7020809@hogranch.com> so I've been having fun getting pl/java 'HEAD' working with Postgres 8.4.3 64bit on Solaris Sparc, with JDK 1.5.0_23 64bit... solved bunches of problems, have it built, I think, and am trying to figure out how to load things... first, I had to manually fudge the pgxs/src/Makefile.global as its missing from the 64bit build of postgres for solaris, so I took the files from the 32bit build and copied/edited them to suit. I used the vlaues displayed by pg_config to adjust whats in that Makefile.global ... so I built it, and fixed up the postgres environment. fwiw, my built modules sit in /opt/FIS/pljava/ this is whats happening now... $ export CLASSPATH=/usr/share/java/postgresql.jar:/opt/FIS/pljava/deploy.jar $ $JAVA_HOME/bin/sparcv9/java org.postgresql.pljava.deploy.Deployer -install -password XXXXX org.postgresql.util.PSQLException: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: libjvm.so: open failed: No such file or directory at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) -bash-3.00$ tail server.log ... ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: libjvm.so: open failed: No such file or directory STATEMENT: CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C LOG: unexpected EOF on client connection These are in the postgres server 'start' method script (I'm running postgres under SMF control) JAVA_HOME=/usr/jdk/jdk1.5.0_23 LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/sparcv9:$JAVA_HOME/jre/lib/sparcv9/server:/opt/FIS/pljava PATH=$JAVA_HOME/bin/sparcv9:$PATH and that LD_LIBRARY_PATH *is* the right JVM $ ls -l /usr/jdk/jdk1.5.0_23/jre/lib/sparcv9/server total 24439 -rw-r--r-- 1 root bin 1423 Dec 3 01:49 Xusage.txt lrwxrwxrwx 1 root root 13 Dec 18 2008 libjsig.so -> ../libjsig.so -rwxr-xr-x 1 root bin 12402328 Dec 3 01:49 libjvm.so -rwxr-xr-x 1 root bin 46656 Dec 3 01:49 libjvm_db.so $ file /usr/jdk/jdk1.5.0_23/jre/lib/sparcv9/server/libjvm.so /usr/jdk/jdk1.5.0_23/jre/lib/sparcv9/server/libjvm.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available I'm not sure what to try next. From books at ejurka.com Thu Apr 15 22:14:36 2010 From: books at ejurka.com (Kris Jurka) Date: Thu, 15 Apr 2010 18:14:36 -0400 (EDT) Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: <4BC78D22.7020809@hogranch.com> References: <4BC78D22.7020809@hogranch.com> Message-ID: On Thu, 15 Apr 2010, John R Pierce wrote: > so I've been having fun getting pl/java 'HEAD' working with Postgres 8.4.3 > 64bit on Solaris Sparc, with JDK 1.5.0_23 64bit... > > ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: > postgres: fatal: libjvm.so: open failed: No such file or directory > > These are in the postgres server 'start' method script (I'm running postgres > under SMF control) > > JAVA_HOME=/usr/jdk/jdk1.5.0_23 > LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/sparcv9:$JAVA_HOME/jre/lib/sparcv9/server:/opt/FIS/pljava > PATH=$JAVA_HOME/bin/sparcv9:$PATH > I'm not familiar with SMF, but putting environment variables into start scripts often doesn't work because they start as root and then su to the user running postgres and when that happens the current environment is scrapped and replaced by that of the postgres user's. Kris Jurka From pierce at hogranch.com Thu Apr 15 22:43:02 2010 From: pierce at hogranch.com (John R Pierce) Date: Thu, 15 Apr 2010 15:43:02 -0700 Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: References: <4BC78D22.7020809@hogranch.com> Message-ID: <4BC79676.8050007@hogranch.com> Kris Jurka wrote: > > > On Thu, 15 Apr 2010, John R Pierce wrote: > >> so I've been having fun getting pl/java 'HEAD' working with Postgres >> 8.4.3 64bit on Solaris Sparc, with JDK 1.5.0_23 64bit... >> >> ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: >> postgres: fatal: libjvm.so: open failed: No such file or directory >> >> These are in the postgres server 'start' method script (I'm running >> postgres under SMF control) >> >> JAVA_HOME=/usr/jdk/jdk1.5.0_23 >> >> LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/sparcv9:$JAVA_HOME/jre/lib/sparcv9/server:/opt/FIS/pljava >> >> PATH=$JAVA_HOME/bin/sparcv9:$PATH >> > > I'm not familiar with SMF, but putting environment variables into > start scripts often doesn't work because they start as root and then > su to the user running postgres and when that happens the current > environment is scrapped and replaced by that of the postgres user's. this script is setting PGBIN, PGDATA, and PGLOG before running pg_ctl, so I am pretty sure its already in the target user. yes, indeed, SMF has a service property "method_context/user astring postgres" which specifies what user to run the start method as, so its looking like changing the user is done -before- running this script. what alternative methods would you suggest for getting LD_LIBRARY_PATH etc setup ? From books at ejurka.com Thu Apr 15 22:58:06 2010 From: books at ejurka.com (Kris Jurka) Date: Thu, 15 Apr 2010 18:58:06 -0400 (EDT) Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: <4BC79676.8050007@hogranch.com> References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> Message-ID: On Thu, 15 Apr 2010, John R Pierce wrote: > this script is setting PGBIN, PGDATA, and PGLOG before running pg_ctl, so I > am pretty sure its already in the target user. yes, indeed, SMF has a > service property "method_context/user astring postgres" which specifies what > user to run the start method as, so its looking like changing the user is > done -before- running this script. Yes, but those variables are used in the script, not used by the server once it starts running, so they're not the same thing and may not be a good template to work off of. > what alternative methods would you suggest for getting LD_LIBRARY_PATH etc > setup ? Perhaps you need to export those variables: export LD_LIBRARY_PATH Kris Jurka From pierce at hogranch.com Thu Apr 15 23:27:54 2010 From: pierce at hogranch.com (John R Pierce) Date: Thu, 15 Apr 2010 16:27:54 -0700 Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> Message-ID: <4BC7A0FA.4050600@hogranch.com> Kris Jurka wrote: > On Thu, 15 Apr 2010, John R Pierce wrote: > (... pl/java HEAD building on sparc 64bit solaris, pg8.4.3, jdk > 1.5.0_23....) >> this script is setting PGBIN, PGDATA, and PGLOG before running >> pg_ctl, so I am pretty sure its already in the target user. yes, >> indeed, SMF has a service property "method_context/user astring >> postgres" which specifies what user to run the start method as, so >> its looking like changing the user is done -before- running this script. > > Perhaps you need to export those variables: > > export LD_LIBRARY_PATH duh, I should have thought of that... all reet... that got me to a NEW error :-) [the fun never ends!] $ java org.postgresql.pljava.deploy.Deployer -install -password XXXXXX org.postgresql.util.PSQLException: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:324) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) with the same environment stuff set in my shell, that .so seems to pass ldd just fine. $ ldd /opt/FIS/pljava/pljava.so libjvm.so => /usr/jdk/jdk1.5.0_23/jre/lib/sparcv9/server/libjvm.so libsocket.so.1 => /lib/64/libsocket.so.1 libsched.so.1 => /usr/lib/64/libsched.so.1 libdl.so.1 => /lib/64/libdl.so.1 libCrun.so.1 => /usr/lib/64/libCrun.so.1 libm.so.1 => /lib/64/libm.so.1 libthread.so.1 => /lib/64/libthread.so.1 libc.so.1 => /lib/64/libc.so.1 libnsl.so.1 => /lib/64/libnsl.so.1 libmp.so.2 => /lib/64/libmp.so.2 libmd.so.1 => /lib/64/libmd.so.1 libscf.so.1 => /lib/64/libscf.so.1 libdoor.so.1 => /lib/64/libdoor.so.1 libuutil.so.1 => /lib/64/libuutil.so.1 libgen.so.1 => /lib/64/libgen.so.1 libm.so.2 => /lib/64/libm.so.2 /platform/SUNW,Sun-Fire-V490/lib/sparcv9/libc_psr.so.1 /platform/SUNW,Sun-Fire-V490/lib/sparcv9/libmd_psr.so.1 From books at ejurka.com Thu Apr 15 23:44:45 2010 From: books at ejurka.com (Kris Jurka) Date: Thu, 15 Apr 2010 19:44:45 -0400 (EDT) Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: <4BC7A0FA.4050600@hogranch.com> References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> <4BC7A0FA.4050600@hogranch.com> Message-ID: On Thu, 15 Apr 2010, John R Pierce wrote: > org.postgresql.util.PSQLException: ERROR: could not load library > "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file > /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found Your hacking of the 32 bit build files is incomplete/incorrect, so you've built a pljava that is incompatible with your server. I'm not entirely sure what you've done, but you don't have the right setting for FLOAT8PASSBYVAL in src/include/pg_config.h in the source tree. I'm not sure where you've got that installed. Kris Jurka From pierce at hogranch.com Fri Apr 16 01:05:04 2010 From: pierce at hogranch.com (John R Pierce) Date: Thu, 15 Apr 2010 18:05:04 -0700 Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> <4BC7A0FA.4050600@hogranch.com> Message-ID: <4BC7B7C0.40008@hogranch.com> Kris Jurka wrote: > > > On Thu, 15 Apr 2010, John R Pierce wrote: > >> org.postgresql.util.PSQLException: ERROR: could not load library >> "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation >> error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: >> referenced symbol not found > > Your hacking of the 32 bit build files is incomplete/incorrect, so > you've built a pljava that is incompatible with your server. I'm not > entirely sure what you've done, but you don't have the right setting > for FLOAT8PASSBYVAL in src/include/pg_config.h in the source tree. > I'm not sure where you've got that installed. thats a big clue, thanks, I'll dive in and see what I can make of that... k, the three files I copied from the 32bit to the 64bit pgxs/src dir in the postgres dir were Makefile.global, Makefile.port and Makefile.shlib only Makefile.global -seemed- to have anything in it that referenced wordsize kinda stuff. I changed the libdir and bindir paths. I replaced configure_arguments with the output of pg_config # Saved arguments from configure configure_args = = '--prefix=/usr/postgres/8.4-community' '--exec-prefix=/usr/postgres/8.4-community' '--bindir=/usr/postgres/8.4-community/bin/64' '--libexecdir=/usr/postgres/8.4-community/bin/64' '--sbindir=/usr/postgres/8.4-community/bin/64' '--datadir=/usr/postgres/8.4-community/share' '--sysconfdir=/usr/postgres/8.4-community/etc' '--mandir=/usr/postgres/8.4-community/man' '--libdir=/usr/postgres/8.4-community/lib/64' '--includedir=/usr/postgres/8.4-community/include' '--sharedstatedir=/var/postgres/8.4-community' '--localstatedir=/var/postgres/8.4-community' '--with-system-tzdata=/usr/share/lib/zoneinfo' '--enable-nls' '--with-docdir=/usr/postgres/8.4-community/doc' '--with-python' '--with-pam' '--with-openssl' '--with-libedit-preferred' '--with-libxml' '--with-libxslt' '--with-gssapi' '--enable-thread-safety' '--enable-dtrace' 'DTRACEFLAGS=-64' '--with-includes=/zstore/pgsql/pg84b1/proto/root_sparc/usr/include:/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/include:/usr/sfw/include' '--with-tclconfig=/usr/sfw/lib' '--with-libs=/zstore/pgsql/pg84b1/proto/root_sparc/usr/lib/64:/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/lib/64:/usr/lib/64:/usr/sfw/lib/64' 'CC=/opt/SUNWspro/bin/cc' 'CFLAGS=-xO3 -xarch=v9 -dalign -Wc,-Qiselect-regsym=0 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff ' 'LDFLAGS=-L/zstore/pgsql/pg84b1/proto/root_sparc/usr/lib/64 -L/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/lib/64 -L/usr/sfw/lib/64' 'CPPFLAGS=-I/zstore/pgsql/pg84b1/proto/root_sparc/usr/include -I/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/include -I/usr/sfw/include' and, the CFLAGS stuff... CC = /opt/SUNWspro/bin/cc -Xa GCC = SUN_STUDIO_CC = yes CFLAGS = -xO3 -xarch=v9 -dalign -Wc,-Qiselect-regsym=0 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff and... and... . oh $$$$, (expletive deleted). LDFLAGS ! I forgot/missed LDFLAGS... k, so fixing -those- up to match the pg_config output... k, gmake clean && gmake ..... builds clean. cp the .so and .jar's to my deployment directory... and. darnit, same error. :-/ k, digging deeper. one thing I noted, getting a fair number of line 47: warning: initialization type mismatch from various C sources. I assume these are normal ? for laughs, I tried running the install.sql via psql rather than the java deploy script, its getting the same error... $ psql -f ./src/sql/install.sql CREATE SCHEMA GRANT psql:./src/sql/install.sql:6: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found psql:./src/sql/install.sql:8: ERROR: function sqlj.java_call_handler() does not exist psql:./src/sql/install.sql:12: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found psql:./src/sql/install.sql:14: ERROR: function sqlj.javau_call_handler() does not exist ......(bunch of table creates ignored).... I also have added these to the postgresql.conf file, per the Readme.html deployment instructions, I don't know if this is redundant or what. dynamic_library_path = '$libdir:/opt/FIS/pljava' custom_variable_classes = 'pljava' pljava.classpath = '/opt/FIS/pljava/pljava.jar' From books at ejurka.com Fri Apr 16 01:39:29 2010 From: books at ejurka.com (Kris Jurka) Date: Thu, 15 Apr 2010 21:39:29 -0400 (EDT) Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: <4BC7B7C0.40008@hogranch.com> References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> <4BC7A0FA.4050600@hogranch.com> <4BC7B7C0.40008@hogranch.com> Message-ID: On Thu, 15 Apr 2010, John R Pierce wrote: > Kris Jurka wrote: >> >> >> On Thu, 15 Apr 2010, John R Pierce wrote: >> >>> org.postgresql.util.PSQLException: ERROR: could not load library >>> "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: >>> file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol >>> not found >> >> Your hacking of the 32 bit build files is incomplete/incorrect, so you've >> built a pljava that is incompatible with your server. I'm not entirely >> sure what you've done, but you don't have the right setting for >> FLOAT8PASSBYVAL in src/include/pg_config.h in the source tree. I'm not >> sure where you've got that installed. > > k, the three files I copied from the 32bit to the 64bit pgxs/src dir in the > postgres dir were Makefile.global, Makefile.port and Makefile.shlib > > only Makefile.global -seemed- to have anything in it that referenced wordsize > kinda stuff. I changed the libdir and bindir paths. I replaced > configure_arguments with the output of pg_config > The package you have may be more busted than just some missing files. If they packaged the 32bit headers with a 64bit server then you're hosed and it sort of sounds like that's what they did. Run: "pg_controldata /path/to/your/data/directory" and check for the line: Float8 argument passing: by value If it says the above instead of "by reference" then you've got a 64bit server that was not compiled with --disable-float8-byval. Then run "grep FLOAT8 include/postgresql/server/pg_config.h" and I expect you'll see: #define FLOAT8PASSBYVAL false which conflicts with the running server. If this is the case, your package is no good for building an extension. > one thing I noted, getting a fair number of > line 47: warning: initialization type mismatch > from various C sources. I assume these are normal ? > No, those aren't normal although I haven't built with Sun Studio on a 64bit machine. Again I suspect your package is busted and I wouldn't recommend trying to manually fix it up. You need the right headers. Kris Jurka From pierce at hogranch.com Wed Apr 21 05:16:25 2010 From: pierce at hogranch.com (John R Pierce) Date: Tue, 20 Apr 2010 22:16:25 -0700 Subject: [Pljava-dev] problems running test suite Message-ID: <4BCE8A29.6030305@hogranch.com> I've built pl/java for Solaris 10 Sparc 64bit, with Sun JDK 1.5.0 64bit and Postgres 8.4.3 64bit... I used `HEAD` from the pljava CVS about 5 days ago (I see Jurka has checked in some new stuff since then, if there's a reason to go ahead and rebuild I will...). To get this build to work, I had to track down the packager of the Solaris binaries, and acquire pg_config.h and Makefile.global from him as he mistakenly packaged the wrong 32bit files with the 64 bit binaries. When I run the test.jar suite, I'm getting this error. I'm wondering if the deploy.jar neglected to create javaU or something? If I add -exclude trustedsecurity, then it passes all the other tests. $ java org.postgresql.pljava.test.Tester -password XXXXXXXX *** testTimestamp() Timestamp = 2010-04-20 21:41:01.046, Timestamptz = 2010-04-20 21:41:01.048 *** testInt() 54 + 2 = 56 nullOnEven(1) = 1 nullOnEven(2) = null *** testInsertUsernameTrigger() Name = "nothing", username = "thomas" Name = "null", username = "piercej" Name = "empty string", username = "" Name = "space", username = " " Name = "tab", username = " " Name = "name", username = "name" *** testModdatetimeTrigger() Id = "1", idesc = "first", moddate = "2010-04-20 21:41:01.123038" Id = "2", idesc = "second", moddate = "2010-04-20 21:41:01.126033" Id = "3", idesc = "third", moddate = "2010-04-20 21:41:01.128966" Id = "4", idesc = "first", moddate = "2010-04-20 21:41:01.274" Id = "5", idesc = "second", moddate = "2010-04-20 21:41:01.28" Id = "6", idesc = "third", moddate = "2010-04-20 21:41:01.286" *** testSPIActions() Id = "3", name = "Rebecka Shawn", salary = "30000" Id = "4", name = "Priscilla Johnson", salary = "25000" *** testTupleReturn() Base = "1", incbase = "6", ctime = "2010-04-20 21:41:01.37" Base = "1", incbase = "0", ctime = "2010-04-20 21:41:01.374" *** testSetReturn() Base = "1", incbase = "1", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "6", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "11", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "16", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "21", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "26", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "31", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "36", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "41", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "46", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "51", ctime = "2010-04-20 21:41:01.376" Base = "1", incbase = "56", ctime = "2010-04-20 21:41:01.376" *** testCallInCall() Max = "10" *** testCurrentDir() Server directory = /var/postgres/8.4-community/data_64 *** testUsingProperties() Name = "first.example.property", value = "1" Name = "third.example.property", value = ""Hmm, take a guess. Could it be three?"" Name = "second.example.property", value = "two" *** testUsingScalarProperties() first.example.property = 1 third.example.property = "Hmm, take a guess. Could it be three?" second.example.property = two *** testUsingResultSetProperties() Name = "first.example.property", value = "1" Name = "third.example.property", value = ""Hmm, take a guess. Could it be three?"" Name = "second.example.property", value = "two" *** testSavepointSanity() Savepoint sanity = 1 *** testTransactionRecovery() Transaction recovery = 1 *** testTrustedSecurity() OK, creation of temp file was *unsuccessful* as it should be *** testUntrustedSecurity() org.postgresql.util.PSQLException: ERROR: java.lang.NoClassDefFoundError at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:332) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:231) at org.postgresql.pljava.test.Tester.tryCreateTempFile(Tester.java:694) at org.postgresql.pljava.test.Tester.testTrustedSecurity(Tester.java:662) at org.postgresql.pljava.test.Tester.main(Tester.java:253) From pierce at hogranch.com Thu Apr 22 01:16:57 2010 From: pierce at hogranch.com (John R Pierce) Date: Wed, 21 Apr 2010 18:16:57 -0700 Subject: [Pljava-dev] problems running test suite In-Reply-To: <4BCE8A29.6030305@hogranch.com> References: <4BCE8A29.6030305@hogranch.com> Message-ID: <4BCFA389.8070609@hogranch.com> John R Pierce wrote: > I've built pl/java for Solaris 10 Sparc 64bit, with Sun JDK 1.5.0 > 64bit and Postgres 8.4.3 64bit... I used `HEAD` from the pljava CVS > about 5 days ago (I see Jurka has checked in some new stuff since > then, if there's a reason to go ahead and rebuild I will...). To get > this build to work, I had to track down the packager of the Solaris > binaries, and acquire pg_config.h and Makefile.global from him as he > mistakenly packaged the wrong 32bit files with the 64 bit binaries. .... and, even stranger. So I bundle up my files with instructions and pass them off to our production folks to deploy on their staging/test server. After some minor issues with sorting out the CLASSPATH, LD_LIBRARY_PATH and PATH and JAVA_HOME, they get it installed just fine by running the Deployer... but, when we try and load the examples.jar, we get this... $ psql -c "SELECT sqlj.install_jar('file:///app/postgres/8.4/pljava/examples.jar', 'samples',true)" dbname pgadmin Password for user pgadmin: ERROR: java.lang.SecurityException: read on /app/postgres/8.4/pljava/examples.jar pgadmin is the superuser and the owner of the 'dbname' database.. also the owner of the examples.jar file. in fact, also the owner of the whole postgres cluster. I dunno how to get any more info on why this is happening.... but... I compiled and tested on postgres 8.4.3 with Sun JDK 1.5.0_24, and this staging server has postgres 8.4.1 and Sun JDK 1.5.0_18... could that make a difference like this? I've asked them to update their postgresql. and they can probably update their Java too, if it will matter. Or should I build from HEAD again, since I grabbed CVS HEAD on the 15th, and as I note above, I saw there were a couple minor updates in the meantime ?. From pierce at hogranch.com Thu Apr 22 22:59:54 2010 From: pierce at hogranch.com (John R Pierce) Date: Thu, 22 Apr 2010 15:59:54 -0700 Subject: [Pljava-dev] problems running test suite In-Reply-To: <4BCFA389.8070609@hogranch.com> References: <4BCE8A29.6030305@hogranch.com> <4BCFA389.8070609@hogranch.com> Message-ID: <4BD0D4EA.6010903@hogranch.com> John R Pierce wrote: > (Solaris 10, Sparc, 64 bit Postgres 8.4.3, 64 bit Sun JDK 1.5.0... > had built pljava on 8.4.3+1.5.0_24 and passed tests, but on another > system with 8.4.1+1.5.0_18 it failed to run the tests with...) > > $ psql -c "SELECT > sqlj.install_jar('file:///app/postgres/8.4/pljava/examples.jar', > 'samples',true)" dbname pgadmin > Password for user pgadmin: > ERROR: java.lang.SecurityException: read on > /app/postgres/8.4/pljava/examples.jar another update... I went ahead and pulled down the updates from HEAD last night, also used jdk 1.5.0_21 instead of _24, meanwhile the production site upgraded their JDK to 1.5.0_22 and Postgres to 8.4.3, and it got past the step that failed, but the person I'm working with in Asia was too tired (4:30AM her time) to complete the testing, so we don't know if its actually working yet or not. I'll probably find out later tonite.. From pierce at hogranch.com Sat Apr 24 03:16:44 2010 From: pierce at hogranch.com (John R Pierce) Date: Fri, 23 Apr 2010 20:16:44 -0700 Subject: [Pljava-dev] dynamic_library_path vs LD_LIBRARY_PATH Message-ID: <4BD2629C.30807@hogranch.com> does dynamic_library_path in postgresql.conf completely replace needing LD_LIBRARY_PATH ? specifically, do I need LD_LIBRARY_PATH for postgres to find plsql.so once its installed ? or is dynamic_library_path sufficient. ditto, the java CLASSPATH, can I just use pljava.classpath ? From thomas at tada.se Sat Apr 24 14:05:38 2010 From: thomas at tada.se (Thomas Hallgren) Date: Sat, 24 Apr 2010 16:05:38 +0200 Subject: [Pljava-dev] PL/Java Wiki is alive again Message-ID: <4BD2FAB2.8040401@tada.se> Hi, I just wanted to announce that I've resurrected the PL/Java Wiki. This time in the form of a mediawiki. http://wiki.tada.se/index.php/PL/Java Regards, Thomas Hallgren From pierce at hogranch.com Sat Apr 24 21:31:52 2010 From: pierce at hogranch.com (John R Pierce) Date: Sat, 24 Apr 2010 14:31:52 -0700 Subject: [Pljava-dev] pljava and jvm loading. Message-ID: <4BD36348.30107@hogranch.com> if I have a postgresql 8.4.3 cluster with several databases, and one of them has PL/Java installed using Sun JDK 1.5.0, when does the JVM get loaded? A) when a connection is made to the database that has pljava B) when any connection is made to any DB in the cluster C) when a pljava function is first invoked D) other? (I note this is the -dev list... and my questions are more of the -user variety, but I don't know of any other lists... if there's a more appropriate forum for these questions, feel free to direct me...) From thomas at tada.se Sat Apr 24 22:34:11 2010 From: thomas at tada.se (Thomas Hallgren) Date: Sun, 25 Apr 2010 00:34:11 +0200 Subject: [Pljava-dev] pljava and jvm loading. In-Reply-To: <4BD36348.30107@hogranch.com> References: <4BD36348.30107@hogranch.com> Message-ID: <4BD371E3.8020800@tada.se> Hi John, The answer is to your question is C. We only have a -dev list so user questions are just as welcome. Regards, Thomas Hallgren On 04/24/2010 11:31 PM, John R Pierce wrote: > if I have a postgresql 8.4.3 cluster with several databases, and one > of them has PL/Java installed using Sun JDK 1.5.0, when does the JVM > get loaded? > > A) when a connection is made to the database that has pljava > B) when any connection is made to any DB in the cluster > C) when a pljava function is first invoked > D) other? > > > (I note this is the -dev list... and my questions are more of the > -user variety, but I don't know of any other lists... if there's a > more appropriate forum for these questions, feel free to direct me...) > > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev From Thomas.K.Hill at t-online.de Sat May 1 12:10:32 2010 From: Thomas.K.Hill at t-online.de (Thomas.K.Hill at t-online.de) Date: Sat, 1 May 2010 14:10:32 +0200 Subject: [Pljava-dev] ERROR: java.lang.UnsupportedOperationException: Procedure calls are not yet implemented Message-ID: <511C9FEA3E49466CB574DB76D7BB719C@ThinkpadZ61m> Hi, I am currently trying to re-use java procedures written for Apache Derby (running fine there) on PostgreSQL. Does the message in the title mean that when using pl/Java the java procedure itself can not call another stored procedure using a JDBC call statement object? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.d.west at asu.edu Thu May 6 20:21:44 2010 From: john.d.west at asu.edu (John D. West) Date: Thu, 6 May 2010 13:21:44 -0700 Subject: [Pljava-dev] pljava install problems Message-ID: Hi. I'm having difficulty installing and running pljava 1.4 on Ubuntu 10.04 64-bit. I'm running Postgresql 8.4.3, and have installed jre1.6.0_20 i586. When I try to install pljava to a database by running the install.sql script, I get the following: ERROR: could not load library "/usr/lib/postgresql/8.4/lib/pljava.so": /usr/lib/postgresql/8.4/lib/pljava.so: undefined symbol: Int64GetDatum My LD_LIBRARY_PATH is /usr/share/java/jre1.6.0_20/lib/amd64/server /usr/share/java/jre1.6.0_20/lib/amd64/native_threads /usr/share/java/jre1.6.0_20/lib/amd64 Any ideas on what I can try to fix this? Thanks very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierce at hogranch.com Sat May 8 05:24:59 2010 From: pierce at hogranch.com (John R Pierce) Date: Fri, 07 May 2010 22:24:59 -0700 Subject: [Pljava-dev] pljava install problems In-Reply-To: References: Message-ID: <4BE4F5AB.2080109@hogranch.com> John D. West wrote: > Hi. I'm having difficulty installing and running pljava 1.4 on Ubuntu > 10.04 64-bit. I'm running Postgresql 8.4.3, and have installed > jre1.6.0_20 i586. > > When I try to install pljava to a database by running the install.sql > script, I get the following: ERROR: could not load library > "/usr/lib/postgresql/8.4/lib/pljava.so": > /usr/lib/postgresql/8.4/lib/pljava.so: undefined symbol: Int64GetDatum > > My LD_LIBRARY_PATH is /usr/share/java/jre1.6.0_20/lib/amd64/server > /usr/share/java/jre1.6.0_20/lib/amd64/native_threads > /usr/share/java/jre1.6.0_20/lib/amd64 > > Any ideas on what I can try to fix this? I got that error on a different environment* when I had issues with compilation, where I was compiling a 64bit pl/java but mistakenly using 32bit postgresql include files. * solaris 10 for sparc using the SunStudio C compiler. From john.d.west at asu.edu Wed May 12 21:17:28 2010 From: john.d.west at asu.edu (John D. West) Date: Wed, 12 May 2010 14:17:28 -0700 Subject: [Pljava-dev] pljava install problems In-Reply-To: <4BE4F5AB.2080109@hogranch.com> References: <4BE4F5AB.2080109@hogranch.com> Message-ID: Turns out that (a) pl/java only works with jdk 1.5 (not 1.6, which I was using) and only works with postgres 8.4 if one downloads the source from CVS and compiles locally. Works now. Thanks for your help! -- John On Fri, May 7, 2010 at 10:24 PM, John R Pierce wrote: > John D. West wrote: > >> Hi. I'm having difficulty installing and running pljava 1.4 on Ubuntu >> 10.04 64-bit. I'm running Postgresql 8.4.3, and have installed jre1.6.0_20 >> i586. >> >> When I try to install pljava to a database by running the install.sql >> script, I get the following: ERROR: could not load library >> "/usr/lib/postgresql/8.4/lib/pljava.so": >> /usr/lib/postgresql/8.4/lib/pljava.so: undefined symbol: Int64GetDatum >> >> My LD_LIBRARY_PATH is /usr/share/java/jre1.6.0_20/lib/amd64/server >> /usr/share/java/jre1.6.0_20/lib/amd64/native_threads >> /usr/share/java/jre1.6.0_20/lib/amd64 >> >> Any ideas on what I can try to fix this? >> > > > I got that error on a different environment* when I had issues with > compilation, where I was compiling a 64bit pl/java but mistakenly using > 32bit postgresql include files. > > > > > > * solaris 10 for sparc using the SunStudio C compiler. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichalek at click.cz Mon May 17 16:57:48 2010 From: pmichalek at click.cz (=?ISO-8859-2?Q?Petr_Mich=E1lek?=) Date: Mon, 17 May 2010 18:57:48 +0200 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility Message-ID: <4BF1758C.7060901@click.cz> Hello, I'm sending patch that adds support for java 1.6. New JDBC4(java 1.6) API simple throws exception NotSupoprtedOperation. (patch -R -p2 <./pljava.diff) Regards Petr Michalek -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pljava_1_4_0__java_1_6.diff URL: From books at ejurka.com Mon May 17 17:37:47 2010 From: books at ejurka.com (Kris Jurka) Date: Mon, 17 May 2010 10:37:47 -0700 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility In-Reply-To: <4BF1758C.7060901@click.cz> References: <4BF1758C.7060901@click.cz> Message-ID: <4BF17EEB.9060307@ejurka.com> On 5/17/2010 9:57 AM, Petr Mich?lek wrote: > Hello, > > I'm sending patch that adds support for java 1.6. > > New JDBC4(java 1.6) API simple throws exception NotSupoprtedOperation. > This diff is unreadable. It seems like a diff between 1.4.0 and current CVS with a ton of changes from tabs to spaces. We need a diff from current CVS that doesn't have irrelevant whitespace changes. It's also not clear that such a patch is a great idea unless it retains the ability to still build with a 1.5 JDK as that still seems to be in use. Kris Jurka From Jon.Roberts at asurion.com Mon May 17 17:44:30 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Mon, 17 May 2010 12:44:30 -0500 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility In-Reply-To: <4BF17EEB.9060307@ejurka.com> References: <4BF1758C.7060901@click.cz> <4BF17EEB.9060307@ejurka.com> Message-ID: <8661B041D452404E8088FBD47D2443BE013CE592@NDCEXCUS703.int.asurion.com> My development environment uses Java 1.6 and my production is still on 1.5. When I create new class files, I compile with "-target 1.5" and everything works in both environments. Am I lucky that this works at all or is the way to use Java 1.6 with PL/Java? Jon -----Original Message----- From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Kris Jurka Sent: Monday, May 17, 2010 12:38 PM To: Petr Mich?lek Cc: pljava-dev at pgfoundry.org Subject: Re: [Pljava-dev] Simple patch for java 1.6 compatibility On 5/17/2010 9:57 AM, Petr Mich?lek wrote: > Hello, > > I'm sending patch that adds support for java 1.6. > > New JDBC4(java 1.6) API simple throws exception NotSupoprtedOperation. > This diff is unreadable. It seems like a diff between 1.4.0 and current CVS with a ton of changes from tabs to spaces. We need a diff from current CVS that doesn't have irrelevant whitespace changes. It's also not clear that such a patch is a great idea unless it retains the ability to still build with a 1.5 JDK as that still seems to be in use. Kris Jurka _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev From thomas at tada.se Mon May 17 17:58:33 2010 From: thomas at tada.se (Thomas Hallgren) Date: Mon, 17 May 2010 19:58:33 +0200 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility In-Reply-To: <4BF17EEB.9060307@ejurka.com> References: <4BF1758C.7060901@click.cz> <4BF17EEB.9060307@ejurka.com> Message-ID: <4BF183C9.7090003@tada.se> On 05/17/2010 07:37 PM, Kris Jurka wrote: > > It's also not clear that such a patch is a great idea unless it > retains the ability to still build with a 1.5 JDK as that still seems > to be in use. > J2SE 5.0 reached its End of Service Life on November 3, 2009. Not sure I see any compelling reasons to continue the support for it if Sun no longer does: http://java.sun.com/javase/downloads/index_jdk5.jsp What would stop anyone from upgrading to 1.6? Regards, Thomas Hallgren From pmichalek at click.cz Mon May 17 20:00:17 2010 From: pmichalek at click.cz (=?ISO-8859-2?Q?Petr_Mich=E1lek?=) Date: Mon, 17 May 2010 22:00:17 +0200 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility In-Reply-To: <4BF17EEB.9060307@ejurka.com> References: <4BF1758C.7060901@click.cz> <4BF17EEB.9060307@ejurka.com> Message-ID: <4BF1A051.2030905@click.cz> I'm sorry, whitespaces was added by Eclipse code formatter. Cleaned diff against current CVS is attached. Petr Michalek Dne 17.5.2010 19:37, Kris Jurka napsal(a): > On 5/17/2010 9:57 AM, Petr Mich?lek wrote: >> Hello, >> >> I'm sending patch that adds support for java 1.6. >> >> New JDBC4(java 1.6) API simple throws exception NotSupoprtedOperation. >> > > This diff is unreadable. It seems like a diff between 1.4.0 and current > CVS with a ton of changes from tabs to spaces. We need a diff from > current CVS that doesn't have irrelevant whitespace changes. > > It's also not clear that such a patch is a great idea unless it retains > the ability to still build with a 1.5 JDK as that still seems to be in use. > > Kris Jurka -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pljava_cvs_20100517__java_1_6.diff URL: From books at ejurka.com Tue May 18 00:39:45 2010 From: books at ejurka.com (Kris Jurka) Date: Mon, 17 May 2010 17:39:45 -0700 Subject: [Pljava-dev] Simple patch for java 1.6 compatibility In-Reply-To: <4BF1A051.2030905@click.cz> References: <4BF1758C.7060901@click.cz> <4BF17EEB.9060307@ejurka.com> <4BF1A051.2030905@click.cz> Message-ID: <4BF1E1D1.2030500@ejurka.com> On 5/17/2010 1:00 PM, Petr Mich?lek wrote: > I'm sorry, whitespaces was added by Eclipse code formatter. > Cleaned diff against current CVS is attached. > This is slightly better, but still contains many, many whitespace changes. Please review the patch prior to sending it again. Kris Jurka From fluca1978 at infinito.it Mon May 31 14:20:02 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 31 May 2010 16:20:02 +0200 Subject: [Pljava-dev] problem deploying pljava Message-ID: <201005311620.03078.fluca1978@infinito.it> Hi all, this is the system that I'm using: Linux fluca-laptop 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 x86_64 GNU/Linux select version(); version ------------------------------------------------------------------------------------------------------------- PostgreSQL 8.4.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.1-4ubuntu9) 4.4.1, 64-bit (1 row) I've downloaded the pljava1.4 64 bit version, I've uncompressed and checked that the pljava.so library is ready to work: $ ldd pljava.so linux-vdso.so.1 => (0x00007fff180bf000) libjvm.so => /usr/lib/jvm/java-6- sun-1.6.0.20/jre/lib/amd64/server/libjvm.so (0x00007f0b46a34000) libc.so.6 => /lib/libc.so.6 (0x00007f0b466c5000) libm.so.6 => /lib/libm.so.6 (0x00007f0b46440000) libdl.so.2 => /lib/libdl.so.2 (0x00007f0b4623c000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0b46020000) /lib64/ld-linux-x86-64.so.2 (0x00007f0b47707000) Since I'm using the java vm provided by my Ubuntu distro, I've placed the following lines in the ld.conf.so: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server/ /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/native_threads/ and restarted the postmaster. Now I believe I've configured everything, but when I try to run the deploy program I get an PSQLException that pljava.so cannot be loaded: org.postgresql.util.PSQLException: ERROR: could not load library "/sviluppo/java/pljava/pljava.so": /sviluppo/java/pljava/pljava.so: undefined symbol: global_timezone at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:328) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) and in the server logs I found the following that is the same error: ERROR: could not load library "/sviluppo/java/pljava/pljava.so": /sviluppo/java/pljava/pljava.so: undefined symbol: global_timezone Any idea about how to configure pljava on the system? Thanks, Luca From books at ejurka.com Mon May 31 23:30:55 2010 From: books at ejurka.com (Kris Jurka) Date: Mon, 31 May 2010 16:30:55 -0700 Subject: [Pljava-dev] problem deploying pljava In-Reply-To: <201005311620.03078.fluca1978@infinito.it> References: <201005311620.03078.fluca1978@infinito.it> Message-ID: <4C0446AF.9040403@ejurka.com> On 5/31/2010 7:20 AM, Luca Ferrari wrote: > Hi all, > PostgreSQL 8.4.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu > 4.4.1-4ubuntu9) 4.4.1, 64-bit > (1 row) > > I've downloaded the pljava1.4 64 bit version > The pljava binaries need to be built for specific postgresql versions, so you've downloaded a version for something other than 8.4 because the 1.4 release doesn't work with the 8.4 version. To get a pljava that works for 8.4 you need to build it yourself from CVS. Kris Jurka From chnvvr at gmail.com Tue Jun 1 03:28:07 2010 From: chnvvr at gmail.com (Raghavendra chilakapati) Date: Tue, 1 Jun 2010 08:58:07 +0530 Subject: [Pljava-dev] problem deploying pljava In-Reply-To: <201005311620.03078.fluca1978@infinito.it> References: <201005311620.03078.fluca1978@infinito.it> Message-ID: Hi all, I think u've already installed the postgresql previous version.so that's postgres instance is removed from registry. Thanks and regards On Mon, May 31, 2010 at 7:50 PM, Luca Ferrari wrote: > Hi all, > this is the system that I'm using: > > > Linux fluca-laptop 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC > 2010 x86_64 GNU/Linux > > select version(); > version > > ------------------------------------------------------------------------------------------------------------- > PostgreSQL 8.4.3 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real > (Ubuntu > 4.4.1-4ubuntu9) 4.4.1, 64-bit > (1 row) > > I've downloaded the pljava1.4 64 bit version, I've uncompressed and checked > that the pljava.so library is ready to work: > > $ ldd pljava.so > linux-vdso.so.1 => (0x00007fff180bf000) > libjvm.so => /usr/lib/jvm/java-6- > sun-1.6.0.20/jre/lib/amd64/server/libjvm.so (0x00007f0b46a34000) > libc.so.6 => /lib/libc.so.6 (0x00007f0b466c5000) > libm.so.6 => /lib/libm.so.6 (0x00007f0b46440000) > libdl.so.2 => /lib/libdl.so.2 (0x00007f0b4623c000) > libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0b46020000) > /lib64/ld-linux-x86-64.so.2 (0x00007f0b47707000) > > > Since I'm using the java vm provided by my Ubuntu distro, I've placed the > following lines in the ld.conf.so: > > /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server/ > /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/native_threads/ > > and restarted the postmaster. > Now I believe I've configured everything, but when I try to run the deploy > program I get an PSQLException that pljava.so cannot be loaded: > > org.postgresql.util.PSQLException: ERROR: could not load library > "/sviluppo/java/pljava/pljava.so": /sviluppo/java/pljava/pljava.so: > undefined > symbol: global_timezone > at > > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592) > at > > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327) > at > > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) > at > > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) > at > > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336) > at > > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:328) > at > org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) > at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) > > and in the server logs I found the following that is the same error: > > ERROR: could not load library "/sviluppo/java/pljava/pljava.so": > /sviluppo/java/pljava/pljava.so: undefined symbol: global_timezone > > > Any idea about how to configure pljava on the system? > > Thanks, > Luca > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > -- Chnvv Raghavendra Mobile:9908898985 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fluca1978 at infinito.it Tue Jun 1 07:06:03 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Tue, 1 Jun 2010 09:06:03 +0200 Subject: [Pljava-dev] problem deploying pljava Message-ID: <201006010906.03841.fluca1978@infinito.it> On Tuesday 01 June 2010 01:30:55 am your cat, walking on the keyboard, wrote: > The pljava binaries need to be built for specific postgresql versions, > so you've downloaded a version for something other than 8.4 because the > 1.4 release doesn't work with the 8.4 version. To get a pljava that > works for 8.4 you need to build it yourself from CVS. Uhm...I'm getting the following list of errors (all referred to the jdbc subpackage), any idea? $ make all make[1]: Entering directory `/sviluppo/java/pljava/org.postgresql.pljava/build/classes/pljava' javac -source 1.4 -target 1.4 -d . /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/ObjectResultSet.java:290: reference to updateBlob is ambiguous, both method updateBlob(int,java.sql.Blob) in java.sql.ResultSet and method updateBlob(int,java.io.InputStream) in java.sql.ResultSet match this.updateBlob(columnIndex, new BlobValue(x, length)); ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/ObjectResultSet.java:320: reference to updateClob is ambiguous, both method updateClob(int,java.sql.Clob) in java.sql.ResultSet and method updateClob(int,java.io.Reader) in java.sql.ResultSet match this.updateClob(columnIndex, new ClobValue(x, length)); ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/TriggerResultSet.java:22: org.postgresql.pljava.jdbc.TriggerResultSet is not abstract and does not override abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet public class TriggerResultSet extends SingleRowResultSet ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SyntheticResultSetMetaData.java:20: org.postgresql.pljava.jdbc.SyntheticResultSetMetaData is not abstract and does not override abstract method isWrapperFor(java.lang.Class) in java.sql.Wrapper public class SyntheticResultSetMetaData extends AbstractResultSetMetaData ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIResultSetMetaData.java:21: org.postgresql.pljava.jdbc.SPIResultSetMetaData is not abstract and does not override abstract method isWrapperFor(java.lang.Class) in java.sql.Wrapper public class SPIResultSetMetaData extends AbstractResultSetMetaData ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIConnection.java:42: org.postgresql.pljava.jdbc.SPIConnection is not abstract and does not override abstract method createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection public class SPIConnection implements Connection ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIResultSet.java:27: org.postgresql.pljava.jdbc.SPIResultSet is not abstract and does not override abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet public class SPIResultSet extends ResultSetBase ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIStatement.java:25: org.postgresql.pljava.jdbc.SPIStatement is not abstract and does not override abstract method isPoolable() in java.sql.Statement public class SPIStatement implements Statement ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIDatabaseMetaData.java:19: org.postgresql.pljava.jdbc.SPIDatabaseMetaData is not abstract and does not override abstract method getFunctionColumns(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in java.sql.DatabaseMetaData public class SPIDatabaseMetaData implements DatabaseMetaData ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SQLInputFromTuple.java:34: org.postgresql.pljava.jdbc.SQLInputFromTuple is not abstract and does not override abstract method readRowId() in java.sql.SQLInput public class SQLInputFromTuple extends JavaWrapper implements SQLInput ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/BlobValue.java:20: org.postgresql.pljava.jdbc.BlobValue is not abstract and does not override abstract method getBinaryStream(long,long) in java.sql.Blob public class BlobValue extends InputStream implements Blob ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIParameterMetaData.java:16: org.postgresql.pljava.jdbc.SPIParameterMetaData is not abstract and does not override abstract method isWrapperFor(java.lang.Class) in java.sql.Wrapper public class SPIParameterMetaData implements ParameterMetaData ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SingleRowReader.java:22: org.postgresql.pljava.jdbc.SingleRowReader is not abstract and does not override abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet public class SingleRowReader extends SingleRowResultSet ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIPreparedStatement.java:38: org.postgresql.pljava.jdbc.SPIPreparedStatement is not abstract and does not override abstract method setNClob(int,java.io.Reader) in java.sql.PreparedStatement public class SPIPreparedStatement extends SPIStatement implements PreparedStatement ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SQLInputFromChunk.java:40: org.postgresql.pljava.jdbc.SQLInputFromChunk is not abstract and does not override abstract method readRowId() in java.sql.SQLInput public class SQLInputFromChunk implements SQLInput ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SQLOutputToTuple.java:35: org.postgresql.pljava.jdbc.SQLOutputToTuple is not abstract and does not override abstract method writeSQLXML(java.sql.SQLXML) in java.sql.SQLOutput public class SQLOutputToTuple implements SQLOutput ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SingleRowWriter.java:26: org.postgresql.pljava.jdbc.SingleRowWriter is not abstract and does not override abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet public class SingleRowWriter extends SingleRowResultSet ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/ClobValue.java:23: org.postgresql.pljava.jdbc.ClobValue is not abstract and does not override abstract method getCharacterStream(long,long) in java.sql.Clob public class ClobValue extends Reader implements Clob ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SyntheticResultSet.java:21: org.postgresql.pljava.jdbc.SyntheticResultSet is not abstract and does not override abstract method updateNClob(java.lang.String,java.io.Reader) in java.sql.ResultSet public class SyntheticResultSet extends ResultSetBase ^ /sviluppo/java/pljava/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SQLOutputToChunk.java:42: org.postgresql.pljava.jdbc.SQLOutputToChunk is not abstract and does not override abstract method writeSQLXML(java.sql.SQLXML) in java.sql.SQLOutput public class SQLOutputToChunk implements SQLOutput ^ 20 errors make[1]: *** [.timestamp] Error 1 make[1]: Leaving directory `/sviluppo/java/pljava/org.postgresql.pljava/build/classes/pljava' make: *** [pljava_all] Error 2 From books at ejurka.com Tue Jun 1 15:31:46 2010 From: books at ejurka.com (Kris Jurka) Date: Tue, 01 Jun 2010 08:31:46 -0700 Subject: [Pljava-dev] problem deploying pljava In-Reply-To: <201006010906.03841.fluca1978@infinito.it> References: <201006010906.03841.fluca1978@infinito.it> Message-ID: <4C0527E2.6020700@ejurka.com> On 6/1/2010 12:06 AM, Luca Ferrari wrote: > On Tuesday 01 June 2010 01:30:55 am your cat, walking on the keyboard, wrote: >> The pljava binaries need to be built for specific postgresql versions, >> so you've downloaded a version for something other than 8.4 because the >> 1.4 release doesn't work with the 8.4 version. To get a pljava that >> works for 8.4 you need to build it yourself from CVS. > > > Uhm...I'm getting the following list of errors (all referred to the jdbc > subpackage), any idea? > You must build with a 1.4 or 1.5 JDK. It does not support JDK 1.6 at the present. Kris Jurka From fluca1978 at infinito.it Thu Jun 3 06:41:03 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 08:41:03 +0200 Subject: [Pljava-dev] problem deploying pljava Message-ID: <201006030841.03789.fluca1978@infinito.it> On Tuesday 01 June 2010 05:31:46 pm your cat, walking on the keyboard, wrote: > You must build with a 1.4 or 1.5 JDK. It does not support JDK 1.6 at > the present. Thanks, I've downloaded a 1.5 jdk and compiled, now it works! Thank you guys for this great piece of code. Luca From fluca1978 at infinito.it Thu Jun 3 08:52:32 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 10:52:32 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get an external connection Message-ID: <201006031052.33192.fluca1978@infinito.it> Hi all, not sure if what I'd like to do is possible, but I'd like to use JDBC within a pl/java function to extract data from another database (something similar to dbilink). However if I try to change the connection to another URL rather that "jdbc:default:connection" I got an error saying there is no suitable driver, so I tried to add explicitly the postgresql jar to the schema, but the following fails: select sqlj.set_classpath('public', '/java/jars/postgresql-8.4-701.jdbc4.jar'); ERROR: java.sql.SQLException: No such jar: /java/jars/postgresql-8.4-701.jdbc4.jar So my questions are: 1) what am I missing in setting the classpath? 2) is it possible to open a connection to another database cluster? Thanks, Luca From Jon.Roberts at asurion.com Thu Jun 3 12:15:30 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Thu, 3 Jun 2010 07:15:30 -0500 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <201006031052.33192.fluca1978@infinito.it> References: <201006031052.33192.fluca1978@infinito.it> Message-ID: <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> I think you need to first install the jar and then set the class path. For example: select * from sqlj.install_jar('file:///java/jars/postgresql-8.4-701.jdbc4.jar', 'example_jar', true); select sqlj.set_classpath('public', 'example_jar'); I use PL/Java to connect to other databases (Oracle, SQL Server, and PostgreSQL) but I created a single Jar with all of my drivers and load that to the database. Jon -----Original Message----- From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of Luca Ferrari Sent: Thursday, June 03, 2010 3:53 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection Hi all, not sure if what I'd like to do is possible, but I'd like to use JDBC within a pl/java function to extract data from another database (something similar to dbilink). However if I try to change the connection to another URL rather that "jdbc:default:connection" I got an error saying there is no suitable driver, so I tried to add explicitly the postgresql jar to the schema, but the following fails: select sqlj.set_classpath('public', '/java/jars/postgresql-8.4-701.jdbc4.jar'); ERROR: java.sql.SQLException: No such jar: /java/jars/postgresql-8.4-701.jdbc4.jar So my questions are: 1) what am I missing in setting the classpath? 2) is it possible to open a connection to another database cluster? Thanks, Luca _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev From fluca1978 at infinito.it Thu Jun 3 12:50:09 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 14:50:09 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> References: <201006031052.33192.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> Message-ID: <201006031450.10453.fluca1978@infinito.it> On Thursday 03 June 2010 02:15:30 pm Roberts, Jon's cat walking on the keyboard wrote: > I think you need to first install the jar and then set the class path. > > For example: > select * from > sqlj.install_jar('file:///java/jars/postgresql-8.4-701.jdbc4.jar', > 'example_jar', true); > select sqlj.set_classpath('public', 'example_jar'); > Yes, I've installed the jar before ( I did not mention) and then I was able to set the classpath using the jar alias. However, keeping the jar separated or merging them into a single jar does not solve the problem and the error still is: ERROR: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDb and in the logs I've got the stacktrace: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDB at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at itpug.pljava.RowGenerator.getResultSet(RowGenerator.java:40) at org.postgresql.pljava.internal.ResultSetPicker.(ResultSetPicker.java:25) Summarizing this is what I've done: 1) sqlj.replace_jar to my new jar containing the Java client 2) sqlj.install_jar for the postgresql driver jar 3) set the classpath so that now I've got: select sqlj.get_classpath('public'); get_classpath --------------- driver:myJar (1 row) with driver the jar for the jdbc driver, and myjar the jar of my client. Any suggestion? Luca From Jon.Roberts at asurion.com Thu Jun 3 12:56:54 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Thu, 3 Jun 2010 07:56:54 -0500 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <201006031450.10453.fluca1978@infinito.it> References: <201006031052.33192.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC4FE@NDCEXCUS703.int.asurion.com> <201006031450.10453.fluca1978@infinito.it> Message-ID: <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> How are you connecting? Is it something like this: Class.forName("org.postgresql.Driver"); String connectionUrl = "jdbc:postgresql://" + server + ":" + port + "/" + database; conn = DriverManager.getConnection(connectionUrl, userName, password); Jon -----Original Message----- From: Luca Ferrari [mailto:fluca1978 at infinito.it] Sent: Thursday, June 03, 2010 7:50 AM To: Roberts, Jon Cc: pljava-dev at pgfoundry.org Subject: Re: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection On Thursday 03 June 2010 02:15:30 pm Roberts, Jon's cat walking on the keyboard wrote: > I think you need to first install the jar and then set the class path. > > For example: > select * from > sqlj.install_jar('file:///java/jars/postgresql-8.4-701.jdbc4.jar', > 'example_jar', true); > select sqlj.set_classpath('public', 'example_jar'); > Yes, I've installed the jar before ( I did not mention) and then I was able to set the classpath using the jar alias. However, keeping the jar separated or merging them into a single jar does not solve the problem and the error still is: ERROR: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDb and in the logs I've got the stacktrace: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/myDB at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(DriverManager.java:185) at itpug.pljava.RowGenerator.getResultSet(RowGenerator.java:40) at org.postgresql.pljava.internal.ResultSetPicker.(ResultSetPicker.ja va:25) Summarizing this is what I've done: 1) sqlj.replace_jar to my new jar containing the Java client 2) sqlj.install_jar for the postgresql driver jar 3) set the classpath so that now I've got: select sqlj.get_classpath('public'); get_classpath --------------- driver:myJar (1 row) with driver the jar for the jdbc driver, and myjar the jar of my client. Any suggestion? Luca From fluca1978 at infinito.it Thu Jun 3 13:39:14 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 15:39:14 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> References: <201006031052.33192.fluca1978@infinito.it> <201006031450.10453.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> Message-ID: <201006031539.14616.fluca1978@infinito.it> On Thursday 03 June 2010 02:56:54 pm Roberts, Jon's cat walking on the keyboard wrote: > How are you connecting? Is it something like this: > > Class.forName("org.postgresql.Driver"); > > String connectionUrl = "jdbc:postgresql://" + server + > ":" + port + "/" + database; > > conn = DriverManager.getConnection(connectionUrl, > userName, password); Using either reflection or direct instantation I've got a new exception: java.lang.NoClassDefFoundError: Could not initialize class sun.security.provider.NativePRNG at sun.security.provider.Sun.(Sun.java:91) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:240) at java.security.AccessController.doPrivileged(Native Method) at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:225) at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:205) at sun.security.jca.ProviderList.getProvider(ProviderList.java:215) at sun.security.jca.ProviderList.getService(ProviderList.java:313) at sun.security.jca.GetInstance.getInstance(GetInstance.java:140) at java.security.Security.getImpl(Security.java:659) at java.security.MessageDigest.getInstance(MessageDigest.java:129) at org.postgresql.util.MD5Digest.encode(MD5Digest.java:46) at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:339) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:125) at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:30) at org.postgresql.jdbc3g.AbstractJdbc3gConnection.(AbstractJdbc3gConnection.java:22) at org.postgresql.jdbc4.AbstractJdbc4Connection.(AbstractJdbc4Connection.java:30) at org.postgresql.jdbc4.Jdbc4Connection.(Jdbc4Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:393) at org.postgresql.Driver.connect(Driver.java:267) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at itpug.pljava.RowGenerator.getResultSet(RowGenerator.java:43) at org.postgresql.pljava.internal.ResultSetPicker.(ResultSetPicker.java:25) The code I use is the following: public ResultSet getResultSet() throws SQLException { org.postgresql.Driver driver = new org.postgresql.Driver(); Connection connection = DriverManager.getConnection( this.databaseName, this.username, this.password ); Statement statement = connection.createStatement(); return statement.executeQuery(" SELECT * FROM "+ this.tableName ); } Any idea? Thanks, Luca From fluca1978 at infinito.it Thu Jun 3 13:43:21 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Thu, 3 Jun 2010 15:43:21 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <201006031539.14616.fluca1978@infinito.it> References: <201006031052.33192.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> <201006031539.14616.fluca1978@infinito.it> Message-ID: <201006031543.21939.fluca1978@infinito.it> On Thursday 03 June 2010 03:39:14 pm Luca Ferrari's cat walking on the keyboard wrote: > java.lang.NoClassDefFoundError: Could not initialize class > sun.security.provider.NativePRNG I've noted that when the function is called the first time the logs are differents and provide the following stacktrace: Caused by: java.lang.SecurityException: read on /dev/random at org.postgresql.pljava.internal.Backend$1.assertPermission(Backend.java:176) at org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.nonRecursiveCheck(Backend.java:111) at org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.checkPermission(Backend.java:89) at java.lang.SecurityManager.checkRead(SecurityManager.java:871) at java.io.File.exists(File.java:731) at sun.security.provider.NativePRNG$1.run(NativePRNG.java:60) at java.security.AccessController.doPrivileged(Native Method) at sun.security.provider.NativePRNG.initIO(NativePRNG.java:57) at sun.security.provider.NativePRNG.(NativePRNG.java:54) ... 31 more 2010-06-03 15:39:43 CEST ERROR: java.lang.ExceptionInInitializerError so it seems a problem of reading /dev/random, even if the user has the permissions: $ ls -l /dev/random crw-rw-rw- 1 root root 1, 8 2010-06-03 15:31 /dev/random Any idea? Thanks, Luca From thomas at tada.se Thu Jun 3 14:32:41 2010 From: thomas at tada.se (Thomas Hallgren) Date: Thu, 03 Jun 2010 16:32:41 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <201006031543.21939.fluca1978@infinito.it> References: <201006031052.33192.fluca1978@infinito.it> <8661B041D452404E8088FBD47D2443BE019EC515@NDCEXCUS703.int.asurion.com> <201006031539.14616.fluca1978@infinito.it> <201006031543.21939.fluca1978@infinito.it> Message-ID: <4C07BD09.1070302@tada.se> PL/Java is implemented as a trusted procedure language. It will therefore prevent all access to the filesystem. You can use language "javaU" if you want untrusted. More details here: http://wiki.tada.se/index.php/Security. Regards, Thomas Hallgren On 2010-06-03 15:43, Luca Ferrari wrote: > On Thursday 03 June 2010 03:39:14 pm Luca Ferrari's cat walking on the > keyboard wrote: > >> java.lang.NoClassDefFoundError: Could not initialize class >> sun.security.provider.NativePRNG >> > > I've noted that when the function is called the first time the logs are > differents and provide the following stacktrace: > > Caused by: java.lang.SecurityException: read on /dev/random > at > org.postgresql.pljava.internal.Backend$1.assertPermission(Backend.java:176) > at > org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.nonRecursiveCheck(Backend.java:111) > at > org.postgresql.pljava.internal.Backend$PLJavaSecurityManager.checkPermission(Backend.java:89) > at java.lang.SecurityManager.checkRead(SecurityManager.java:871) > at java.io.File.exists(File.java:731) > at sun.security.provider.NativePRNG$1.run(NativePRNG.java:60) > at java.security.AccessController.doPrivileged(Native Method) > at sun.security.provider.NativePRNG.initIO(NativePRNG.java:57) > at sun.security.provider.NativePRNG.(NativePRNG.java:54) > ... 31 more > 2010-06-03 15:39:43 CEST ERROR: java.lang.ExceptionInInitializerError > > > so it seems a problem of reading /dev/random, even if the user has the > permissions: > > $ ls -l /dev/random > crw-rw-rw- 1 root root 1, 8 2010-06-03 15:31 /dev/random > > > Any idea? > > Thanks, > Luca > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > From fluca1978 at infinito.it Fri Jun 4 08:42:18 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Fri, 4 Jun 2010 10:42:18 +0200 Subject: [Pljava-dev] cannot set the classpath to a specific jar to get anexternal connection In-Reply-To: <4C07BD09.1070302@tada.se> References: <201006031052.33192.fluca1978@infinito.it> <201006031543.21939.fluca1978@infinito.it> <4C07BD09.1070302@tada.se> Message-ID: <201006041042.18443.fluca1978@infinito.it> On Thursday 03 June 2010 04:32:41 pm Thomas Hallgren's cat walking on the keyboard wrote: > PL/Java is implemented as a trusted procedure language. It will > therefore prevent all access to the filesystem. You can use language > "javaU" if you want untrusted. More details here: > http://wiki.tada.se/index.php/Security. Thanks, it solved the problem! Luca From jcllario at hotmail.com Fri Jun 4 21:11:37 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Fri, 4 Jun 2010 23:11:37 +0200 Subject: [Pljava-dev] Cancelling a trigger operation Message-ID: Hi all pljava users, First of all, im sorry because I already sent this post some month ago but I really need to find a solution. I was looking for something that I already read in this list (year 2006). That is: How can I cancel a trigger operation?. For example in plpgsql I can return a null so the trigger is cancelled. http://pgfoundry.org/pipermail/pljava-dev/2006/001000.html http://pgfoundry.org/pipermail/pljava-dev/2006/001001.html Has someone already worked in this issue? There is any plan to fix it? Thanks to all, Best, Jose _________________________________________________________________ ?Un navegador seguro buscando est?s? ?Protegete ya en www.ayudartepodria.com! www.ayudartepodria.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanscottalexx at gmail.com Wed Jun 9 05:51:11 2010 From: stefanscottalexx at gmail.com (Stefan Scott Alexander) Date: Wed, 9 Jun 2010 02:51:11 -0300 Subject: [Pljava-dev] Can't install pljava with Postgres 8.3 and Java 1.5 on WinXP Pro (for Adempiere 3.42s) Message-ID: Hi - I need to install pljava so that I can use Adempiere 3.42s, an open-source ERP (enterprise resource planning) suite which uses Java, Postgres, and pljava. I've been trying for three days to install pljava with Postgres 8.3 and Java 1.5 on Windows XP, but it always returns an error message about not being able to load pljava.dll. (I admit that I wasted a day trying to install pljava with Postgres 8.4 and Java 1.6, until I finally found a message here: http://old.nabble.com/pljava-install-problems-td28493671.html saying that this isn't supported. More specifically, it says that there *is* a way to install pljava with Postgres 8.4 and run with Java 1.6, if you use use CVS to download the sources for pljava and build using Java 1.5. I installed Tortoise CVS and managed to checkout the sources to my WinXP machine, but then I got stuck because I couldn't figure out how to do the build. I noticed that the sources included a file called Makefile, and also included some C header files. This confused me. I've only done builds in Java on Windows using Ant or Maven - I have no idea how to do a build in Java on Windows involving a Makefile. I do have a Debian server elsewhere, so I thought about trying to do the build there - but it's already running Java 1.6 under Debian Lenny, and I'm afraid of messing that server up if I were to install Java 1.5 on it just for the purpose of trying to build pljava from source. Anyways, the errors I've been getting always involve a file called pljava.dll, and I'm not sure that doing a make under Debian would produce a dll file, as they are used for Windows.) I'm on the verge of a nervous breakdown now from frustration and lack of sleep, since every time I attempt a new approach, I think I'm close to getting it to work this time... and then I end up staying up till 4 or 5 in the morning until finally collapsing from exhaustion. I'm accustomed to encountering difficulties when installing new software. However, this situation seems worse that the normal, because Google turns up lots of people with this same problem, but no people offering a solution. According to this Google search, pljava may be broken since Postgres 8.3: http://www.google.com/search?&safe=off&q=pljava+broken+8.3RC1 This is unfortunate, as pljava is an important procedural language for Postgres. In particular, pljava is required by Adempiere, which is one of the top open-source ERP (enterprise resource planning) packages. Does anyone have a fix to enable installing pljava in Postgres 8.3 (or later) on Windows? +++ As far as I understand, there are two methods for installing pljava. Neither one has worked. The complete error messages are shown below, essentially saying: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found. By the way, the file pljava.dll does exist in the above directory. I assume the error message means that some other module (which pljava.dll is dependent on) couldn't be found. Method 1: C:\Program Files\PostgreSQL\8.3\share\pljava>java org.postgresql.pljava.deploy.Deployer -install -database adempiere -user postgres -password postgres org.postgresql.util.PSQLException: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:328) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) Method 2: C:\Program Files\PostgreSQL\8.3\share\pljava>psql -f install.sql adempiere postgres Password for user postgres: CREATE SCHEMA GRANT psql:install.sql:6: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found. psql:install.sql:8: ERROR: function sqlj.java_call_handler() does not exist psql:install.sql:12: ERROR: could not load library "C:/Program Files/PostgreSQL/8.3/lib/pljava.dll": The specified module could not be found psql:install.sql:14: ERROR: function sqlj.javau_call_handler() does not exist psql:install.sql:23: NOTICE: CREATE TABLE will create implicit sequence "jar_repository_jarid_seq" for serial column "jar_repository.jarid" psql:install.sql:23: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "jar_repository_pkey" for table "jar_repository" psql:install.sql:23: NOTICE: CREATE TABLE / UNIQUE will create implicit index "jar_repository_jarname_key" for table "jar_repository" CREATE TABLE GRANT psql:install.sql:32: NOTICE: CREATE TABLE will create implicit sequence "jar_entry_entryid_seq" for serial column "jar_entry.entryid" psql:install.sql:32: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "jar_entry_pkey" for table "jar_entry" psql:install.sql:32: NOTICE: CREATE TABLE / UNIQUE will create implicit index "jar_entry_jarid_key" for table "jar_entry" CREATE TABLE GRANT ALTER TABLE psql:install.sql:43: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "classpath_entry_pkey" for table "classpath_entry" CREATE TABLE GRANT psql:install.sql:50: NOTICE: CREATE TABLE will create implicit sequence "typemap_entry_mapid_seq" for serial column "typemap_entry.mapid" psql:install.sql:50: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "typemap_entry_pkey" for table "typemap_entry" CREATE TABLE GRANT psql:install.sql:55: ERROR: language "java" does not exist psql:install.sql:59: ERROR: language "java" does not exist psql:install.sql:63: ERROR: language "java" does not exist psql:install.sql:67: ERROR: language "java" does not exist psql:install.sql:71: ERROR: language "java" does not exist psql:install.sql:75: ERROR: language "java" does not exist psql:install.sql:79: ERROR: language "java" does not exist psql:install.sql:83: ERROR: language "java" does not exist psql:install.sql:87: ERROR: language "java" does not exist Method 3 - Following the instructions here: http://www.adempiere.com/index.php/Adempiere_Install_WinXp I added the following lines to the file C:\Program Files\PostgreSQL\8.3\data\postgresql.conf: custom_variable_classes = 'pljava' pljava.classpath = 'C:\\Program Files\\PostgreSQL\\8.3\\share\\pljava\\pljava.jar' pljava.release_lingering_savepoints = true pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48' pljava.debug = false and and stopped and started the Postgres server before attempting the above two methods, but they still returned the same error messages. +++ Here are the attempts I've made to try to diagnose and fix this problem. None of these attempts has worked. Attempt 1 - I checked my JRE_HOME environment variable in WinXP. I made sure that it was a system variable (not a user variable), and that it's included in the PATH environment variable. I also rebooted the computer. If I do: dir %JRE_HOME%\bin\client the output looks ok: Directory of C:\programs\Java\jdk1.5.0_22\jre\bin\client 06/08/2010 02:43 PM . 06/08/2010 02:43 PM .. 06/08/2010 02:43 PM 12,713,984 classes.jsa 10/09/2009 03:16 AM 1,626,233 jvm.dll 06/08/2010 02:37 PM 1,447 Xusage.txt If I do: PATH the output (with some returns added for readability) also looks ok: PATH= C:\windows\system32; C:\Programs\MaudeFW\2.4\cygwin\bin; C:\Program Files\PC Connectivity Solution; C:\Program Files\ATI Technologies\ATI.ACE\Core-Static; C:\Program Files\TortoiseSVN\bin; C:\Sun\SDK\lib\ant\bin; C:\programs\maven\apache-maven-2.2.1\bin; C:\Programs\PostgreSQL\8.4\bin; C:\programs\Java\jdk1.5.0_22\bin; C:\programs\Java\jdk1.5.0_22\jre\bin; C:\programs\Java\jdk1.5.0_22\jre\bin\client; C:\Program Files\CVSNT\;C:\Program Files\PostgreSQL\8.3\bin So the file jvm.dll should be available. By the way, I have un-installed Postgres 8.3, deleted the WinXP user postgres, re-booted the computer, re-installed Postgres 8.3 (with the above environment variables in effect), hoping that this might make the Postgres 8.3 installer add pljava during the install, but no luck. During the Postgres 8.3 install, there is a tree of components to be installed which initially shows "PL/Java" with a red "X" on it, so of course I changed this to "Install to hard disk". Later during the install, there is a list of procedural languages which can be installed, and only the first one is checked - the remaining ones (including "PL/Java") are all dimmed, and unchecked, and cannot be checked. Attempt 2 - I used a program called Dependency Walker to check whether pljava.dll has any unsatisfied dependencies. This program gave one error and one warning: - The error said that there was a dll which pljava.dll depended on, called c:\windows\system32\libeay32.dll, which had "an unresolved import due to a missing export function in an implicitly dependent module." - The warning said that there was a dll which pljava.dll depdended on, called c:\windows\system32\mpr.dll, which had an "unresolved import due to a missing export function in a delay-load dependent module." I tried two ways of fixing the error: First, I tried to install OpenSSH for Windows, which includes the dll libeay32.dll, and I copied this dll into C:\windows\system32. That didn't resolve the error message. Then I noticed that directory c:\Program Files\PostgreSQL\8.3\bin also contains a file called libeay32.dll, so I copied that into c:\windows\system32, and that resolved the error message. I couldn't figure out a way to resolve the warning about the other dll, mpr.dll - but since it's only a warning (not an error), maybe it's not fatal. Attempt 3 - I also tried installing using various EnterpriseDB installers, to see if they gave different results. But the same error messages continued to occur. +++ I'm totally stuck and I don't know what to do now. I'd really like to be able to use pljava with Postgres. Thanks for any help. - Scott Alexander -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierce at hogranch.com Wed Jun 9 06:18:36 2010 From: pierce at hogranch.com (John R Pierce) Date: Tue, 08 Jun 2010 23:18:36 -0700 Subject: [Pljava-dev] Can't install pljava with Postgres 8.3 and Java 1.5 on WinXP Pro (for Adempiere 3.42s) In-Reply-To: References: Message-ID: <4C0F323C.4020808@hogranch.com> Stefan Scott Alexander wrote: > Hi - > > I need to install pljava so that I can use Adempiere 3.42s, an > open-source ERP (enterprise resource planning) suite which uses Java, > Postgres, and pljava. according to the adempiere website, this installer here http://www.adempiere.com/index.php/Windows_Installer has everything you need, including Postgres, for Windows. From stefanscottalexx at gmail.com Wed Jun 9 06:28:17 2010 From: stefanscottalexx at gmail.com (Stefan Scott Alexander) Date: Wed, 9 Jun 2010 03:28:17 -0300 Subject: [Pljava-dev] Can't install pljava with Postgres 8.3 and Java 1.5 on WinXP Pro (for Adempiere 3.42s) In-Reply-To: <4C0F323C.4020808@hogranch.com> References: <4C0F323C.4020808@hogranch.com> Message-ID: Thanks John. I did try the Windows installer you mentioned: http://www.adempiere.com/index.php/Windows_Installer However, it gave an "erroneous" error message immediately after launching, saying that the version of Postgres installed on the machine was earlier than 8.1. This error message was wrong, since I had either: - NO Postgres installed (because I assumed that the Windows installer would include Postgres) - later I had Postgres 8.3 installed. The Windows installer quit immediately after displaying this message. On Wed, Jun 9, 2010 at 3:18 AM, John R Pierce wrote: > Stefan Scott Alexander wrote: > >> Hi - >> >> I need to install pljava so that I can use Adempiere 3.42s, an open-source >> ERP (enterprise resource planning) suite which uses Java, Postgres, and >> pljava. >> > > according to the adempiere website, this installer here > http://www.adempiere.com/index.php/Windows_Installer has everything you > need, including Postgres, for Windows. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierce at hogranch.com Wed Jun 9 06:34:43 2010 From: pierce at hogranch.com (John R Pierce) Date: Tue, 08 Jun 2010 23:34:43 -0700 Subject: [Pljava-dev] Can't install pljava with Postgres 8.3 and Java 1.5 on WinXP Pro (for Adempiere 3.42s) In-Reply-To: References: <4C0F323C.4020808@hogranch.com> Message-ID: <4C0F3603.5030905@hogranch.com> Stefan Scott Alexander wrote: > Thanks John. > > I did try the Windows installer you mentioned: > > http://www.adempiere.com/index.php/Windows_Installer > > However, it gave an "erroneous" error message immediately after > launching, saying that the version of Postgres installed on the > machine was earlier than 8.1. This error message was wrong, since I > had either: > > - NO Postgres installed (because I assumed that the Windows installer > would include Postgres) > > - later I had Postgres 8.3 installed. > > The Windows installer quit immediately after displaying this message. then, I'd contact whatever support forums this project has. until you posted here, I'd never heard of this 'most popular ERP' package. btw, I also see that the newest versions no longer require PLJava, per http://www.adempiere.com/index.php/PLJAVA From stefanscottalexx at gmail.com Thu Jun 10 01:28:25 2010 From: stefanscottalexx at gmail.com (Stefan Scott Alexander) Date: Wed, 9 Jun 2010 22:28:25 -0300 Subject: [Pljava-dev] Can't install pljava with Postgres 8.3 and Java 1.5 on WinXP Pro (for Adempiere 3.42s) In-Reply-To: <4C0F3603.5030905@hogranch.com> References: <4C0F323C.4020808@hogranch.com> <4C0F3603.5030905@hogranch.com> Message-ID: Thanks for the reply. I have managed to fix the problem. My JRE_HOME was pointing to Java 1.5, but my CLASSPATH was pointing to Java 1.6. And I couldn't get PL/Java 1.4 to install using Java 1.6. Actually there was a further twist involving the ERP application Adempiere-3.4.2-s I was trying to install: it apparently won't run with Java 1.5, only with Java 1.6! So I had to use Java 1.5 to install PL/Java, and then Java 1.6 to run the application Adempiere-3.4-2-s. (I can't wait till deployment dependencies for big Java projects such as Adempiere ERP are always routinely encoded in an executable Maven POM file rather than scattered across the internet in how-to's and forums... but that's off-topic. :-) On Wed, Jun 9, 2010 at 3:34 AM, John R Pierce wrote: > Stefan Scott Alexander wrote: > >> Thanks John. >> >> I did try the Windows installer you mentioned: >> >> http://www.adempiere.com/index.php/Windows_Installer >> >> However, it gave an "erroneous" error message immediately after launching, >> saying that the version of Postgres installed on the machine was earlier >> than 8.1. This error message was wrong, since I had either: >> >> - NO Postgres installed (because I assumed that the Windows installer >> would include Postgres) >> >> - later I had Postgres 8.3 installed. >> >> The Windows installer quit immediately after displaying this message. >> > > > then, I'd contact whatever support forums this project has. until you > posted here, I'd never heard of this 'most popular ERP' package. > > btw, I also see that the newest versions no longer require PLJava, per > http://www.adempiere.com/index.php/PLJAVA > > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > > http://pgfoundry.org/mailman/listinfo/pljava-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From muhammad.mansoor at enterprisedb.com Wed Jun 16 20:35:31 2010 From: muhammad.mansoor at enterprisedb.com (Muhammad Mansoor) Date: Wed, 16 Jun 2010 16:35:31 -0400 Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6 Message-ID: Hi, The attached patch takes care of the following issues. 1. It adds PostgreSQL 9.0 support. 2. It has the JDK support patch ( taken from *Petr Mich?lek original patch* ) 3. It enables PLjava to be compiled with both JDK 5 and JDK 6. Enabling PLjava to compile with both JDK versions is little bit tricky. If we have to compile with JDK 6 , we need to implement some extra JDBC API methods, that are not there in the JDK 1.5. So by keeping the same code we cannot compile it against both JDK versions. So instead of having *org/postgresql/pljava/jdbc *directory, we will have two directories i.e. *org/postgresql/pljava/jdbc3 (have JDK 1.5 compliant implementation)* *org/postgresql/pljava/jdbc4 ( have JDK 6 compliant implementation)* * * When we run make it will generate a * **org/postgresql/pljava/jdbc * directory* *based on target JDK. By default it will be JDK 1.5, if user exports USE_JDK6 then will be build with JDK 6 compliant. * * Thanks, -- Syed Muhammad Mansoor Architect EnterpriseDB Corporation The Enterprise Postgres Company Website: http://www.enterprisedb.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pljava_pg90_jdk5_jdk6.patch Type: text/x-patch Size: 1091747 bytes Desc: not available URL: From books at ejurka.com Wed Jun 16 20:54:45 2010 From: books at ejurka.com (Kris Jurka) Date: Wed, 16 Jun 2010 13:54:45 -0700 Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6 In-Reply-To: References: Message-ID: <4C193A15.7030409@ejurka.com> On 6/16/2010 1:35 PM, Muhammad Mansoor wrote: > Hi, > > The attached patch takes care of the following issues. > > 1. It adds PostgreSQL 9.0 support. The code in CVS already supports postgresql 9.0. You need to create your patch from CVS, not from the 1.4.0 source release. > 2. It has the JDK support patch ( taken from /Petr Mich?lek original > patch/ ) Your patch has all the problems his does, tons of gratuitous whitespace changes. You should not be reformatting/re-indenting unrelated code. > 3. It enables PLjava to be compiled with both JDK 5 and JDK 6. It does not appear to do this. A quick search through the patch doesn't reveal any matches for JDBC4 or USE_JDK6. Kris Jurka From muhammad.mansoor at enterprisedb.com Wed Jun 16 21:06:23 2010 From: muhammad.mansoor at enterprisedb.com (Muhammad Mansoor) Date: Wed, 16 Jun 2010 17:06:23 -0400 Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6 In-Reply-To: <4C193A15.7030409@ejurka.com> References: <4C193A15.7030409@ejurka.com> Message-ID: On Wed, Jun 16, 2010 at 4:54 PM, Kris Jurka wrote: > On 6/16/2010 1:35 PM, Muhammad Mansoor wrote: > >> Hi, >> >> The attached patch takes care of the following issues. >> >> 1. It adds PostgreSQL 9.0 support. >> > > The code in CVS already supports postgresql 9.0. You need to create your > patch from CVS, not from the 1.4.0 source release. > Sure I will do that. > > 2. It has the JDK support patch ( taken from /Petr Mich?lek original >> patch/ ) >> > > Your patch has all the problems his does, tons of gratuitous whitespace > changes. You should not be reformatting/re-indenting unrelated code. > > > 3. It enables PLjava to be compiled with both JDK 5 and JDK 6. >> > > It does not appear to do this. A quick search through the patch doesn't > reveal any matches for JDBC4 or USE_JDK6. > These changes are there in the start of patch. + output := $(shell rm -rf "src/java/pljava/org/postgresql/pljava/jdbc") + + ifdef USE_JDK6 + output := $(shell cp -rf "src/java/pljava/org/postgresql/pljava/jdbc4" "src/java/pljava/org/postgresql/pljava/jdbc") + else + output := $(shell cp -rf "src/java/pljava/org/postgresql/pljava/jdbc3" "src/java/pljava/org/postgresql/pljava/jdbc") + endif + I will make it more cleaner. Do you agree with the solution? Thanks, > Kris Jurka > -- Syed Muhammad Mansoor Architect EnterpriseDB Corporation The Enterprise Postgres Company -------------- next part -------------- An HTML attachment was scrubbed... URL: From books at ejurka.com Wed Jun 16 21:23:20 2010 From: books at ejurka.com (Kris Jurka) Date: Wed, 16 Jun 2010 14:23:20 -0700 Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6 In-Reply-To: References: <4C193A15.7030409@ejurka.com> Message-ID: <4C1940C8.9020102@ejurka.com> On 6/16/2010 2:06 PM, Muhammad Mansoor wrote: > On Wed, Jun 16, 2010 at 4:54 PM, Kris Jurka > wrote: > > It does not appear to do this. A quick search through the patch > doesn't reveal any matches for JDBC4 or USE_JDK6. > > > These changes are there in the start of patch. Sorry, I was looking at the wrong patch. I was looking at a version of Petr's original patch. So my comments about whitespace changes are also incorrect. > > + output := $(shell rm -rf > "src/java/pljava/org/postgresql/pljava/jdbc") > + > + ifdef USE_JDK6 > + output := $(shell cp -rf > "src/java/pljava/org/postgresql/pljava/jdbc4" > "src/java/pljava/org/postgresql/pljava/jdbc") > + else > + output := $(shell cp -rf > "src/java/pljava/org/postgresql/pljava/jdbc3" > "src/java/pljava/org/postgresql/pljava/jdbc") > + endif > + > > I will make it more cleaner. Do you agree with the solution? > No, keeping two complete copies of slightly different code is not the way to go. If you want to make pljava build against either JDK version you need to provide JDBC4 classes extending JDBC3 classes like the regular JDBC driver does so that only new JDBC4 code goes into the JDBC4 class, not a complete copy of the JDBC3 code. That's a significant amount of work to do though and based on other comments on this list, perhaps the best thing to do is to simply require JDK6 from here on out. Kris Jurka From rath.swaroop at gmail.com Wed Jun 16 22:11:11 2010 From: rath.swaroop at gmail.com (swaroop) Date: Wed, 16 Jun 2010 23:11:11 +0100 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver Message-ID: Hi I compiled and installed Postgres in Ubuntu Jaunty. I need to develop an extension to PostgreSQL and this is why I choose to compile from the sources, rather than using an installer. I tried to install pljava and followed the steps outlines in " http://wiki.tada.se/index.php/Installing_on_Linux_(or_other_*nix)" sincerely. I am sure that I did things correct. The last step says, run the deployer program. I did that but unfortunately I get an exception. Please help me here. The exception is below. I tried to download the jdbc driver at http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and added it to classpath. But this did not help. Please advice. swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar org.postgresql.pljava.deploy.Deployer -install java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:264) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:238) Regards Swaroop -------------- next part -------------- An HTML attachment was scrubbed... URL: From books at ejurka.com Wed Jun 16 22:32:01 2010 From: books at ejurka.com (Kris Jurka) Date: Wed, 16 Jun 2010 15:32:01 -0700 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver In-Reply-To: References: Message-ID: <4C1950E1.3030206@ejurka.com> On 6/16/2010 3:11 PM, swaroop wrote: > The last step says, run the deployer program. I did that but > unfortunately I get an exception. Please help me here. The exception is > below. I tried to download the jdbc driver at > http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and > added it to classpath. But this did not help. Please advice. > > swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar > org.postgresql.pljava.deploy.Deployer -install > java.lang.ClassNotFoundException: org.postgresql.Driver You need to add it to the classpath here: java -cp postgresql-8.4-701.jdbc3.jar:deploy.jar org.postgresql.pljava.deploy.Deployer -install From thomas at tada.se Wed Jun 16 22:45:50 2010 From: thomas at tada.se (Thomas Hallgren) Date: Thu, 17 Jun 2010 00:45:50 +0200 Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6 In-Reply-To: <4C1940C8.9020102@ejurka.com> References: <4C193A15.7030409@ejurka.com> <4C1940C8.9020102@ejurka.com> Message-ID: <4C19541E.3080707@tada.se> On 06/16/2010 11:23 PM, Kris Jurka wrote: > ... perhaps the best thing to do is to simply require JDK6 from here > on out. > Yes, that approach has my vote. I doubt we make anyone happy by continuing support for Java 1.5. If you're really conservative, chances are you won't jump on a new release anyway. - thomas From rath.swaroop at gmail.com Wed Jun 16 23:17:32 2010 From: rath.swaroop at gmail.com (swaroop) Date: Thu, 17 Jun 2010 00:17:32 +0100 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver In-Reply-To: <4C1950E1.3030206@ejurka.com> References: <4C1950E1.3030206@ejurka.com> Message-ID: Thanks a lot Kris. My this problem is solved. The next error I get is below. Please have a look. I really need this up and running and really appreciate your help. pljava.so is there in the directory. I think it needs libjvm.so. Where do I find it ? swaroop at swaroop-laptop:~/Project/pljava$ java -cp postgresql-8.4-701.jdbc4.jar:deploy.jar org.postgresql.pljava.deploy.Deployer -install org.postgresql.util.PSQLException: ERROR: could not load library "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: cannot open shared object file: No such file or directory at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) Regards Swaroop On Wed, Jun 16, 2010 at 11:32 PM, Kris Jurka wrote: > On 6/16/2010 3:11 PM, swaroop wrote: > >> The last step says, run the deployer program. I did that but >> unfortunately I get an exception. Please help me here. The exception is >> below. I tried to download the jdbc driver at >> http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and >> added it to classpath. But this did not help. Please advice. >> >> swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar >> org.postgresql.pljava.deploy.Deployer -install >> java.lang.ClassNotFoundException: org.postgresql.Driver >> > > You need to add it to the classpath here: > > java -cp postgresql-8.4-701.jdbc3.jar:deploy.jar > org.postgresql.pljava.deploy.Deployer -install > -------------- next part -------------- An HTML attachment was scrubbed... URL: From syedmmansoor at gmail.com Wed Jun 16 23:33:13 2010 From: syedmmansoor at gmail.com (Syed Muhammad Mansoor) Date: Wed, 16 Jun 2010 19:33:13 -0400 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver In-Reply-To: References: <4C1950E1.3030206@ejurka.com> Message-ID: You need to set LD_LIBRARY_PATH. export LD_LIBARARY_PATH=:$LD_LIBRARY_PATH or this one would be more better *export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client*. Thanks --Mansoor EnterpriseDB Corporation The Enterprise Postgres Company Website: http://www.enterprisedb.com On Wed, Jun 16, 2010 at 7:17 PM, swaroop wrote: > Thanks a lot Kris. My this problem is solved. The next error I get is > below. Please have a look. I really need this up and running and really > appreciate your help. pljava.so is there in the directory. I think it needs > libjvm.so. Where do I find it ? > > swaroop at swaroop-laptop:~/Project/pljava$ java -cp > postgresql-8.4-701.jdbc4.jar:deploy.jar > org.postgresql.pljava.deploy.Deployer -install > org.postgresql.util.PSQLException: ERROR: could not load library > "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: > cannot open shared object file: No such file or directory > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) > at > org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) > at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) > > > Regards > Swaroop > > > > On Wed, Jun 16, 2010 at 11:32 PM, Kris Jurka wrote: > >> On 6/16/2010 3:11 PM, swaroop wrote: >> >>> The last step says, run the deployer program. I did that but >>> unfortunately I get an exception. Please help me here. The exception is >>> below. I tried to download the jdbc driver at >>> http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and >>> added it to classpath. But this did not help. Please advice. >>> >>> swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar >>> org.postgresql.pljava.deploy.Deployer -install >>> java.lang.ClassNotFoundException: org.postgresql.Driver >>> >> >> You need to add it to the classpath here: >> >> java -cp postgresql-8.4-701.jdbc3.jar:deploy.jar >> org.postgresql.pljava.deploy.Deployer -install >> > > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rath.swaroop at gmail.com Wed Jun 16 23:36:34 2010 From: rath.swaroop at gmail.com (swaroop) Date: Thu, 17 Jun 2010 00:36:34 +0100 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver In-Reply-To: References: <4C1950E1.3030206@ejurka.com> Message-ID: I already have that - swaroop at swaroop-laptop:~/Project/pljava$ echo $LD_LIBRARY_PATH /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads Still I have the error :(. I tried copying libjvm.so to "database/lib/postgresql" but that did not solve the problem either. :( I copy the stack trace here for reference. org.postgresql.util.PSQLException: ERROR: could not load library "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: cannot open shared object file: No such file or directory at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) Regards Swaroop On Thu, Jun 17, 2010 at 12:33 AM, Syed Muhammad Mansoor < syedmmansoor at gmail.com> wrote: > You need to set LD_LIBRARY_PATH. > export LD_LIBARARY_PATH= libjvm.so>:$LD_LIBRARY_PATH > or this one would be more better > *export > LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client*. > > Thanks > --Mansoor > EnterpriseDB Corporation > The Enterprise Postgres Company > Website: http://www.enterprisedb.com > > > On Wed, Jun 16, 2010 at 7:17 PM, swaroop wrote: > >> Thanks a lot Kris. My this problem is solved. The next error I get is >> below. Please have a look. I really need this up and running and really >> appreciate your help. pljava.so is there in the directory. I think it needs >> libjvm.so. Where do I find it ? >> >> swaroop at swaroop-laptop:~/Project/pljava$ java -cp >> postgresql-8.4-701.jdbc4.jar:deploy.jar >> org.postgresql.pljava.deploy.Deployer -install >> org.postgresql.util.PSQLException: ERROR: could not load library >> "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: >> cannot open shared object file: No such file or directory >> at >> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) >> at >> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) >> at >> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) >> at >> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) >> at >> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) >> at >> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) >> at >> org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) >> at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) >> >> >> Regards >> Swaroop >> >> >> >> On Wed, Jun 16, 2010 at 11:32 PM, Kris Jurka wrote: >> >>> On 6/16/2010 3:11 PM, swaroop wrote: >>> >>>> The last step says, run the deployer program. I did that but >>>> unfortunately I get an exception. Please help me here. The exception is >>>> below. I tried to download the jdbc driver at >>>> http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and >>>> added it to classpath. But this did not help. Please advice. >>>> >>>> swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar >>>> org.postgresql.pljava.deploy.Deployer -install >>>> java.lang.ClassNotFoundException: org.postgresql.Driver >>>> >>> >>> You need to add it to the classpath here: >>> >>> java -cp postgresql-8.4-701.jdbc3.jar:deploy.jar >>> org.postgresql.pljava.deploy.Deployer -install >>> >> >> >> _______________________________________________ >> Pljava-dev mailing list >> Pljava-dev at pgfoundry.org >> http://pgfoundry.org/mailman/listinfo/pljava-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From syedmmansoor at gmail.com Wed Jun 16 23:52:45 2010 From: syedmmansoor at gmail.com (Syed Muhammad Mansoor) Date: Wed, 16 Jun 2010 19:52:45 -0400 Subject: [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver In-Reply-To: References: <4C1950E1.3030206@ejurka.com> Message-ID: Do you have LD_LIBRARY_PATH set in the session, in which database server is running. Database server should see the same LD_LIBRARY_PARH. Thanks, --Mansoor EnterpriseDB Corporation The Enterprise Postgres Company Website: http://www.enterprisedb.com On Wed, Jun 16, 2010 at 7:36 PM, swaroop wrote: > I already have that - > swaroop at swaroop-laptop:~/Project/pljava$ echo $LD_LIBRARY_PATH > > /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads > > > Still I have the error :(. I tried copying libjvm.so to > "database/lib/postgresql" but that did not solve the problem either. :( I > copy the stack trace here for reference. > > org.postgresql.util.PSQLException: ERROR: could not load library > "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: > cannot open shared object file: No such file or directory > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) > at > org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) > at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) > > > Regards > Swaroop > > > On Thu, Jun 17, 2010 at 12:33 AM, Syed Muhammad Mansoor < > syedmmansoor at gmail.com> wrote: > >> You need to set LD_LIBRARY_PATH. >> export LD_LIBARARY_PATH=> libjvm.so>:$LD_LIBRARY_PATH >> or this one would be more better >> *export >> LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client*. >> >> Thanks >> --Mansoor >> EnterpriseDB Corporation >> The Enterprise Postgres Company >> Website: http://www.enterprisedb.com >> >> >> On Wed, Jun 16, 2010 at 7:17 PM, swaroop wrote: >> >>> Thanks a lot Kris. My this problem is solved. The next error I get is >>> below. Please have a look. I really need this up and running and really >>> appreciate your help. pljava.so is there in the directory. I think it needs >>> libjvm.so. Where do I find it ? >>> >>> swaroop at swaroop-laptop:~/Project/pljava$ java -cp >>> postgresql-8.4-701.jdbc4.jar:deploy.jar >>> org.postgresql.pljava.deploy.Deployer -install >>> org.postgresql.util.PSQLException: ERROR: could not load library >>> "/home/swaroop/Project/MayBMS/database/lib/postgresql/pljava.so": libjvm.so: >>> cannot open shared object file: No such file or directory >>> at >>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062) >>> at >>> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795) >>> at >>> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) >>> at >>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479) >>> at >>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353) >>> at >>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345) >>> at >>> org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474) >>> at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269) >>> >>> >>> Regards >>> Swaroop >>> >>> >>> >>> On Wed, Jun 16, 2010 at 11:32 PM, Kris Jurka wrote: >>> >>>> On 6/16/2010 3:11 PM, swaroop wrote: >>>> >>>>> The last step says, run the deployer program. I did that but >>>>> unfortunately I get an exception. Please help me here. The exception is >>>>> below. I tried to download the jdbc driver at >>>>> http://jdbc.postgresql.org/download/postgresql-8.4-701.jdbc3.jar and >>>>> added it to classpath. But this did not help. Please advice. >>>>> >>>>> swaroop at swaroop-laptop:~/Project/pljava$ java -cp deploy.jar >>>>> org.postgresql.pljava.deploy.Deployer -install >>>>> java.lang.ClassNotFoundException: org.postgresql.Driver >>>>> >>>> >>>> You need to add it to the classpath here: >>>> >>>> java -cp postgresql-8.4-701.jdbc3.jar:deploy.jar >>>> org.postgresql.pljava.deploy.Deployer -install >>>> >>> >>> >>> _______________________________________________ >>> Pljava-dev mailing list >>> Pljava-dev at pgfoundry.org >>> http://pgfoundry.org/mailman/listinfo/pljava-dev >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rath.swaroop at gmail.com Thu Jun 17 15:19:22 2010 From: rath.swaroop at gmail.com (swaroop) Date: Thu, 17 Jun 2010 16:19:22 +0100 Subject: [Pljava-dev] plJava installation problems in Windows 7 Message-ID: Hi I installed postgresql on windows 7 usign the standard installer. The document at "http://wiki.tada.se/index.php/Windows_Installation" says that pljava will be automatically installed. I doubt if it was installed. I tried running install.sql script in C:\Project\Postgre_installer\share\pljava. The following sql fails with the error "ERROR: could not load library "C:/Project/Postgre_installer/lib/pljava.dll": The specified module could not be found." I made sure that jvm.dll is on my path.I am using jdk1.6. "C:\"Program Files (x86)"\Java\jdk1.6.0_11\jre" Please help me here. I have been trying a lot of workarounds but nothing seems to work. CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C; Regards Swaroop -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jon.Roberts at asurion.com Thu Jun 17 15:30:22 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Thu, 17 Jun 2010 10:30:22 -0500 Subject: [Pljava-dev] plJava installation problems in Windows 7 In-Reply-To: References: Message-ID: <8661B041D452404E8088FBD47D2443BE02037762@NDCEXCUS703.int.asurion.com> I use Windows 7 64 bit with PostgreSQL 8.3 and Java 1.6. I have the following settings: Environment Variables CLASSPATH=C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar JAVA_HOME=C:\Program Files (x86)\Java\jre6 LD_LIBRARY_PATH=C:\Program Files (x86)\PostgreSQL\8.3\lib;C:\Program Files (x86)\Java\jre6\lib\i386 PATH includes: C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\Java\jre6\bin\client;C:\Program Files (x86)\Java\jdk1.6.0_20\bin; And in my postgresql.conf file custom_variable_classes = 'pljava' pljava.classpath = 'C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar' Jon From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of swaroop Sent: Thursday, June 17, 2010 10:19 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] plJava installation problems in Windows 7 Hi I installed postgresql on windows 7 usign the standard installer. The document at "http://wiki.tada.se/index.php/Windows_Installation" says that pljava will be automatically installed. I doubt if it was installed. I tried running install.sql script in C:\Project\Postgre_installer\share\pljava. The following sql fails with the error "ERROR: could not load library "C:/Project/Postgre_installer/lib/pljava.dll": The specified module could not be found." I made sure that jvm.dll is on my path.I am using jdk1.6. "C:\"Program Files (x86)"\Java\jdk1.6.0_11\jre" Please help me here. I have been trying a lot of workarounds but nothing seems to work. CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C; Regards Swaroop -------------- next part -------------- An HTML attachment was scrubbed... URL: From rath.swaroop at gmail.com Thu Jun 17 16:04:17 2010 From: rath.swaroop at gmail.com (swaroop) Date: Thu, 17 Jun 2010 17:04:17 +0100 Subject: [Pljava-dev] plJava installation problems in Windows 7 In-Reply-To: <8661B041D452404E8088FBD47D2443BE02037762@NDCEXCUS703.int.asurion.com> References: <8661B041D452404E8088FBD47D2443BE02037762@NDCEXCUS703.int.asurion.com> Message-ID: Hi Jon Thanks for the instructions. I tried everything below but no luck. It still says cannot find pljava.dll. Jon/Guys - Any other suggestion ? Regards Swaroop On Thu, Jun 17, 2010 at 4:30 PM, Roberts, Jon wrote: > I use Windows 7 64 bit with PostgreSQL 8.3 and Java 1.6. I have the > following settings: > > > > Environment Variables > > CLASSPATH=C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar > > JAVA_HOME=C:\Program Files (x86)\Java\jre6 > > LD_LIBRARY_PATH=C:\Program Files (x86)\PostgreSQL\8.3\lib;C:\Program Files > (x86)\Java\jre6\lib\i386 > > PATH includes: C:\Program Files (x86)\Java\jre6\bin;C:\Program Files > (x86)\Java\jre6\bin\client;C:\Program Files (x86)\Java\jdk1.6.0_20\bin; > > > > And in my postgresql.conf file > > custom_variable_classes = 'pljava' > > pljava.classpath = 'C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar' > > > > > > Jon > > *From:* pljava-dev-bounces at pgfoundry.org [mailto: > pljava-dev-bounces at pgfoundry.org] *On Behalf Of *swaroop > *Sent:* Thursday, June 17, 2010 10:19 AM > *To:* pljava-dev at pgfoundry.org > *Subject:* [Pljava-dev] plJava installation problems in Windows 7 > > > > Hi > > > > I installed postgresql on windows 7 usign the standard installer. The > document at "http://wiki.tada.se/index.php/Windows_Installation" says that > pljava will be automatically installed. > > > > I doubt if it was installed. I tried running install.sql script > in C:\Project\Postgre_installer\share\pljava. The following sql fails with > the error "ERROR: could not load library > "C:/Project/Postgre_installer/lib/pljava.dll": The specified module could > not be found." > > > > I made sure that jvm.dll is on my path.I am using jdk1.6. "C:\"Program > Files (x86)"\Java\jdk1.6.0_11\jre" Please help me here. I have been trying a > lot of workarounds but nothing seems to work. > > > > CREATE FUNCTION sqlj.java_call_handler() > > RETURNS language_handler AS 'pljava' > > LANGUAGE C; > > > > Regards > > Swaroop > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jon.Roberts at asurion.com Thu Jun 17 16:09:18 2010 From: Jon.Roberts at asurion.com (Roberts, Jon) Date: Thu, 17 Jun 2010 11:09:18 -0500 Subject: [Pljava-dev] plJava installation problems in Windows 7 In-Reply-To: References: <8661B041D452404E8088FBD47D2443BE02037762@NDCEXCUS703.int.asurion.com> Message-ID: <8661B041D452404E8088FBD47D2443BE020377B6@NDCEXCUS703.int.asurion.com> Do you have pljava.dll in C:\Program Files (x86)\PostgreSQL\8.3\lib ? Jon From: swaroop [mailto:rath.swaroop at gmail.com] Sent: Thursday, June 17, 2010 11:04 AM To: Roberts, Jon; pljava-dev at pgfoundry.org Subject: Re: [Pljava-dev] plJava installation problems in Windows 7 Hi Jon Thanks for the instructions. I tried everything below but no luck. It still says cannot find pljava.dll. Jon/Guys - Any other suggestion ? Regards Swaroop On Thu, Jun 17, 2010 at 4:30 PM, Roberts, Jon wrote: I use Windows 7 64 bit with PostgreSQL 8.3 and Java 1.6. I have the following settings: Environment Variables CLASSPATH=C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar JAVA_HOME=C:\Program Files (x86)\Java\jre6 LD_LIBRARY_PATH=C:\Program Files (x86)\PostgreSQL\8.3\lib;C:\Program Files (x86)\Java\jre6\lib\i386 PATH includes: C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\Java\jre6\bin\client;C:\Program Files (x86)\Java\jdk1.6.0_20\bin; And in my postgresql.conf file custom_variable_classes = 'pljava' pljava.classpath = 'C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar' Jon From: pljava-dev-bounces at pgfoundry.org [mailto:pljava-dev-bounces at pgfoundry.org] On Behalf Of swaroop Sent: Thursday, June 17, 2010 10:19 AM To: pljava-dev at pgfoundry.org Subject: [Pljava-dev] plJava installation problems in Windows 7 Hi I installed postgresql on windows 7 usign the standard installer. The document at "http://wiki.tada.se/index.php/Windows_Installation" says that pljava will be automatically installed. I doubt if it was installed. I tried running install.sql script in C:\Project\Postgre_installer\share\pljava. The following sql fails with the error "ERROR: could not load library "C:/Project/Postgre_installer/lib/pljava.dll": The specified module could not be found." I made sure that jvm.dll is on my path.I am using jdk1.6. "C:\"Program Files (x86)"\Java\jdk1.6.0_11\jre" Please help me here. I have been trying a lot of workarounds but nothing seems to work. CREATE FUNCTION sqlj.java_call_handler() RETURNS language_handler AS 'pljava' LANGUAGE C; Regards Swaroop -------------- next part -------------- An HTML attachment was scrubbed... URL: From rath.swaroop at gmail.com Thu Jun 17 16:13:52 2010 From: rath.swaroop at gmail.com (swaroop) Date: Thu, 17 Jun 2010 17:13:52 +0100 Subject: [Pljava-dev] plJava installation problems in Windows 7 In-Reply-To: <8661B041D452404E8088FBD47D2443BE020377B6@NDCEXCUS703.int.asurion.com> References: <8661B041D452404E8088FBD47D2443BE02037762@NDCEXCUS703.int.asurion.com> <8661B041D452404E8088FBD47D2443BE020377B6@NDCEXCUS703.int.asurion.com> Message-ID: Yes, I have it in the lib folder of my Pljava installation which is at - C:/Project/Postgre_installer/lib/pljava.dll Regards Swaroop On Thu, Jun 17, 2010 at 5:09 PM, Roberts, Jon wrote: > Do you have pljava.dll in C:\Program Files (x86)\PostgreSQL\8.3\lib ? > > > > > > Jon > > *From:* swaroop [mailto:rath.swaroop at gmail.com] > *Sent:* Thursday, June 17, 2010 11:04 AM > *To:* Roberts, Jon; pljava-dev at pgfoundry.org > *Subject:* Re: [Pljava-dev] plJava installation problems in Windows 7 > > > > Hi Jon > > > > Thanks for the instructions. I tried everything below but no luck. It > still says cannot find pljava.dll. > > > > Jon/Guys - Any other suggestion ? > > > > Regards > Swaroop > > On Thu, Jun 17, 2010 at 4:30 PM, Roberts, Jon > wrote: > > I use Windows 7 64 bit with PostgreSQL 8.3 and Java 1.6. I have the > following settings: > > > > Environment Variables > > CLASSPATH=C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar > > JAVA_HOME=C:\Program Files (x86)\Java\jre6 > > LD_LIBRARY_PATH=C:\Program Files (x86)\PostgreSQL\8.3\lib;C:\Program Files > (x86)\Java\jre6\lib\i386 > > PATH includes: C:\Program Files (x86)\Java\jre6\bin;C:\Program Files > (x86)\Java\jre6\bin\client;C:\Program Files (x86)\Java\jdk1.6.0_20\bin; > > > > And in my postgresql.conf file > > custom_variable_classes = 'pljava' > > pljava.classpath = 'C:\Program Files (x86)\PostgreSQL\8.3\share\pljava.jar' > > > > > > Jon > > *From:* pljava-dev-bounces at pgfoundry.org [mailto: > pljava-dev-bounces at pgfoundry.org] *On Behalf Of *swaroop > *Sent:* Thursday, June 17, 2010 10:19 AM > *To:* pljava-dev at pgfoundry.org > *Subject:* [Pljava-dev] plJava installation problems in Windows 7 > > > > Hi > > > > I installed postgresql on windows 7 usign the standard installer. The > document at "http://wiki.tada.se/index.php/Windows_Installation" says that > pljava will be automatically installed. > > > > I doubt if it was installed. I tried running install.sql script > in C:\Project\Postgre_installer\share\pljava. The following sql fails with > the error "ERROR: could not load library > "C:/Project/Postgre_installer/lib/pljava.dll": The specified module could > not be found." > > > > I made sure that jvm.dll is on my path.I am using jdk1.6. "C:\"Program > Files (x86)"\Java\jdk1.6.0_11\jre" Please help me here. I have been trying a > lot of workarounds but nothing seems to work. > > > > CREATE FUNCTION sqlj.java_call_handler() > > RETURNS language_handler AS 'pljava' > > LANGUAGE C; > > > > Regards > > Swaroop > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fluca1978 at infinito.it Mon Jun 21 05:45:09 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 21 Jun 2010 07:45:09 +0200 Subject: [Pljava-dev] possible patch for cancelling a trigger operation Message-ID: <201006210745.10291.fluca1978@infinito.it> Dear Pl/Java users and developers, please find attached a minimal patch for cancelling a trigger operation. I attach also a simple Java file that provides a trigger function that counts each insert/update operations and will allow only even operations. The trigger can be used against any table once the jar is installed in the database as follows: CREATE FUNCTION trigger_test() RETURNS trigger AS 'itpug.pljava.CancelStatementTriggerTest.triggerFunction' LANGUAGE 'java'; CREATE TRIGGER trigger_test_impl BEFORE INSERT OR UPDATE OR DELETE ON java_table FOR EACH ROW EXECUTE PROCEDURE trigger_test(); (substitute java_table with your own table - be aware that the trigger will print a message on the logs). I've tested the patch against the following system: - PostgreSQL 8.4.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit - the latest version of the pljava sources - jdk 1.5.0_22 on Ubuntu 64 bit - gcc 4.4.3 The patch works as follows: 0) since TriggerData is the only way to interact with the backed, the logic of cancelling the current insert/update/delete statements must pass thru the TriggerData class. To allows this I've inserted two methods to set the current statement as cancelled and to know if the current statement has been cancelled. 1) the internal/TriggerData class now implements such methods using a simple boolean flag to indicate if the current statement must be cancelled or not. Please note that there is a utility method to check the conditions on which a statement can be aborted. 2) the internal/TriggerData class when returning the tuple to apply, simply returns 0 if the statement has been cancelled. Such 0 is interpreted as a NULL result in the backend code (Functions.c) and therefore the trigger aborts the current operation. 3) when asking for a newResultSet on TriggerData, the system checks if the trigger has already been marked for cancelling the current statement, so that the returned result set is set read-only. This is not the optimal solution, since one can get the result set before cancelling the trigger, but in any case the getTriggerResultTuple will avoid insertions/updates. I've also inserted a few comments while studying the call flow in order to better understand. Hope this can be applied as a stable patch, in such case I've other ideas to better improve the patch on which I can work (e.g., propagate the status to the ResultSets, use a static flag instead of an instance one, etc.). Luca -------------- next part -------------- diff --git a/src/C/pljava/Function.c b/src/C/pljava/Function.c index 434d9a9..b8012da 100644 --- a/src/C/pljava/Function.c +++ b/src/C/pljava/Function.c @@ -755,12 +755,26 @@ Datum Function_invoke(Function self, PG_FUNCTION_ARGS) return retVal; } + +/* + * This function is called from the backend.c when a trigger must execute, that means when a user-defined + * function must be executed as a trigger function. + * As for any backend-trigger function written in C, this function receives the PG_FUNCTION_ARGS that + * defines the user-defined function parameters. Moreover, the function receives the Function "self" pointer + * that is a struct that contains information about the Java method to call, the result type, if the function + * is a multi-call one (i.e., it requires/it will allocate a memory context) and so on. + */ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) { jvalue arg; Datum ret; + // create a trigger data object starting from the current trigger data passed from + // the backend to the function (remember that context here is the trigger data). + // This method simply creates a Java object starting from the C TriggerData one. arg.l = TriggerData_create((TriggerData*)fcinfo->context); + + // if the trigger data cannot be created than the trigger must abort (i.e., return null) if(arg.l == 0) return 0; @@ -769,7 +783,8 @@ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) fcinfo->isnull = false; if(JNI_exceptionCheck()) - ret = 0; + // exception, so return null (i.e., abort the trigger) + ret = 0; else { /* A new Tuple may or may not be created here. If it is, ensure that @@ -778,9 +793,15 @@ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) MemoryContext currCtx = Invocation_switchToUpperContext(); ret = PointerGetDatum(TriggerData_getTriggerReturnTuple(arg.l, &fcinfo->isnull)); - /* Triggers are not allowed to set the fcinfo->isnull, even when + /* + * Triggers are not allowed to set the fcinfo->isnull, even when * they return null. - */ + * In fact fcinfo->isnull means that the function is returning a NULL SQL value, while a + * trigger returning null means that the current statement must be cancelled, not that + * the trigger is returning a NULL SQL value. + * Please note that the method TriggerData.getTriggerReturnTuple will set the fcinfo->isnull + * value according to the trigger function returning NULL, but this is not useful here. + */ fcinfo->isnull = false; MemoryContextSwitchTo(currCtx); diff --git a/src/C/pljava/type/TriggerData.c b/src/C/pljava/type/TriggerData.c index 1d65bc3..95359d5 100644 --- a/src/C/pljava/type/TriggerData.c +++ b/src/C/pljava/type/TriggerData.c @@ -35,7 +35,11 @@ HeapTuple TriggerData_getTriggerReturnTuple(jobject jtd, bool* wasNull) { Ptr2Long p2l; HeapTuple ret = 0; - p2l.longVal = JNI_callLongMethod(jtd, s_TriggerData_getTriggerReturnTuple); + + // call the method identified by the "s_triggerData_getTriggerReturnTuple" id on the + // object "jtd", that is a Java instance of the TriggerData + p2l.longVal = JNI_callLongMethod(jtd, // java TriggerData + s_TriggerData_getTriggerReturnTuple); // method id to call if(p2l.longVal != 0) ret = heap_copytuple((HeapTuple)p2l.ptrVal); else diff --git a/src/java/pljava/org/postgresql/pljava/TriggerData.java b/src/java/pljava/org/postgresql/pljava/TriggerData.java index 78aa87c..8cca8d9 100644 --- a/src/java/pljava/org/postgresql/pljava/TriggerData.java +++ b/src/java/pljava/org/postgresql/pljava/TriggerData.java @@ -144,4 +144,24 @@ public interface TriggerData * if the contained native buffer has gone stale. */ boolean isFiredByUpdate() throws SQLException; + + + /** + * Sets the aborted flag of this TriggerData. A TriggerData aborted + * will return an empty result set, so that the trigger will abort its execution and + * the insertion/update will be aborted too. + * Please note that this can be set only for a trigger invoked before each row and for + * insert/update. + */ + public void cancelCurrentStatement( boolean abort ) throws SQLException; + + + /** + * Is this trigger aborted? + */ + public boolean isCurrentStatementCancelled() throws SQLException; + + + + } diff --git a/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java b/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java index da9c16b..7aed3f8 100644 --- a/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java +++ b/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java @@ -34,9 +34,12 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be null for delete triggers and for triggers that was fired for * statement.
The returned set will be updateable and positioned on a * valid row. + * If the current statement has been cancelled the returned result set will be + * read-only. * - * @return An updateable ResultSet containing one row or - * null. + * @return An updateable ResultSet containing one row (if the trigger has been invoked for each row, before and the + * current statement has not been cancelled), a read-only result set in the case of an after trigger (or if the + * current statement has been cancelled) or null. * @throws SQLException * if the contained native buffer has gone stale. */ @@ -55,9 +58,8 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr ? this.getTriggerTuple() : this.getNewTuple(); - // Triggers fired after will always have a read-only row - // - m_new = new TriggerResultSet(this.getRelation().getTupleDesc(), tuple, this.isFiredAfter()); + // Triggers fired after will always have a read-only row, and so do triggers that have been cancelled. + m_new = new TriggerResultSet(this.getRelation().getTupleDesc(), tuple, (this.isFiredAfter() | this.isCurrentStatementCancelled()) ); return m_new; } @@ -66,6 +68,9 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be null for insert triggers and for triggers that was fired for * statement.
The returned set will be read-only and positioned on a * valid row. + * + * Please note that a result set will be returned even if the current statement is cancelled, this is not + * a security hole since the result set will be read-only! * * @return A read-only ResultSet containing one row or * null. @@ -77,12 +82,69 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr if (m_old != null) return m_old; - if (this.isFiredByInsert() || this.isFiredForStatement()) + if (this.isFiredByInsert() || this.isFiredForStatement() ) return null; m_old = new TriggerResultSet(this.getRelation().getTupleDesc(), this.getTriggerTuple(), true); return m_old; } + + + /** + * This flag indicates if the trigger must be aborted, that is if the trigger must return a null tuple + * so to abort the current operation. This flag is not made static in order to allow the trigger to start from a clean + * value for each row. If this is made static, than the trigger status will be kept along invocations of the same trigger function. + */ + private boolean aborted = false; + + /** + * Sets the aborted flag of this TriggerData. A TriggerData aborted + * will return an empty result set, so that the trigger will abort its execution and + * the insertion/update will be aborted too. + * Please note that this can be set only for a trigger invoked before each row and for + * insert/update/delete. + */ + public final synchronized void cancelCurrentStatement( boolean abort ) throws SQLException{ + // check that this is called only on a insert/update trigger for before events + if( ! this.canCancelStatement() ) + throw new SQLException("Cannot abort a trigger not handling a before event for inserts/updates!"); + + this.aborted = abort; + } + + /** + * Is this trigger aborted? + */ + public final synchronized boolean isCurrentStatementCancelled() throws SQLException{ + // security check + if( ! this.canCancelStatement() ) + this.aborted = false; + + + return this.aborted; + } + + + /** + * An utility method to test if the current trigger can cancel the current statement, that means + * if it can delete the current in-progress operation (for instance INSERT command). + * A trigger can cancel the current statement only if (and logical conditions): + * - it is invoked for a before event + * - it is invoked on each row + * - it is invoked for an insert/update/delete + * + * and this means that it cannot cancel the statement if (or logical conditions): + * - it is invoked for an after event + * - it is invoked for a statement + */ + private final boolean canCancelStatement() throws SQLException{ + if( this.isFiredAfter() || this.isFiredForStatement() ) + return false; + else + return true; + } + + /** * Commits the changes made on the ResultSet representing * new and returns the native pointer of new tuple. This @@ -90,11 +152,12 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be called in any other way. * * @return The modified tuple, or if no modifications have been made, the - * original tuple. + * original tuple. In the case no one tuple must be returned, than + * this method will return a zero value. */ public long getTriggerReturnTuple() throws SQLException { - if(this.isFiredForStatement() || this.isFiredAfter()) + if(this.isFiredForStatement() || this.isFiredAfter() || this.isCurrentStatementCancelled() ) // // Only triggers fired before each row can have a return // value. -------------- next part -------------- A non-text attachment was scrubbed... Name: CancelStatementTriggerTest.java Type: text/x-java Size: 1303 bytes Desc: not available URL: From cwelton at greenplum.com Mon Jul 12 20:47:27 2010 From: cwelton at greenplum.com (Caleb Welton) Date: Mon, 12 Jul 2010 13:47:27 -0700 Subject: [Pljava-dev] pljava error logging levels Message-ID: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> Hello, I had several questions about the ELogHandler in pljava, was hoping someone could comment on it. In postgres there is code to handle the filtering of logging levels and this is controlled by several gucs for different types of logging. For instance log_min_messages is used to control the logging level that gets written to the log file, while client_min_messages is used to control the logging level that gets displayed to the client. Looking at ELogHandler.java I see that pljava bases its own decision on how the JVM should filter logging level based on the setting of log_min_messages at the time of JVM initialization. This has several consequences, including: 1) Future changes to the logging level are ignored by the JVM which will continue to use the setting at JVM initialization. 2) The setting of client_min_messages is ignored, so a setting where INFO messages should be returned to the client but not written to the log is not handled correctly. Question) Why does PLJava even try to install its own log level filtering when the Postgres logger already is handling this? Additionally there seems to an additional problem with the actual mapping of logging levels. In Java there are the following logging levels, from highest to lowest: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST In Postgres the logging levels, from highest to lowest are: PANIC, FATAL, ERROR, WARNING, NOTICE, INFO, LOG, DEBUG1, DEBUG2, ... pljava creates a mapping as follows: SEVERE => ERROR WARNING => WARNING INFO => INFO CONFIG => NOTICE Note that in Java "CONFIG" is a finer logging level than "INFO", whereas in Postgres "NOTICE" is a coarser logging level than "INFO", which makes this mapping of error levels incorrect. Thanks, Caleb From claudio.sistemica at gmail.com Thu Jul 15 16:36:22 2010 From: claudio.sistemica at gmail.com (Claudio Campos) Date: Thu, 15 Jul 2010 13:36:22 -0300 Subject: [Pljava-dev] Unable to find static method with signature (LJava/lang/String) Message-ID: Hello, I have the following error with pl/java and a java function that receive an string as parameters: select javatest.resultSetToken('HOLA MUNDO') ERROR: Unable to find static method org.postgresql.pljava.lucenetest.ResultSetToken.executeSelect with signature (Ljava/lang/String;)Ljava/util/Iterator; ********** Error ********** ERROR: Unable to find static method org.postgresql.pljava.lucenetest.ResultSetToken.executeSelect with signature (Ljava/lang/String;)Ljava/util/Iterator; SQL state: XX000 ********** Error ********** follow the suggestions described here (http://pgfoundry.org/pipermail/pljava-dev/2006/000714.html) but did not work could someone help me? Thanks in advance, Claudio Campos ********** SCRIPT POSGRESQL ********** select sqlj.remove_jar('lucenetest',true) select sqlj.install_jar('file:///C:/Archivos de programa/PostgreSQL/8.4/lib/lucenetest.jar' ,'lucenetest', true) CREATE OR REPLACE FUNCTION javatest.resultSetToken(text) RETURNS SETOF text AS 'org.postgresql.pljava.lucenetest.ResultSetToken.executeSelect(java.lang.String)' LANGUAGE 'java' COST 100; ALTER FUNCTION javatest.resultSetToken(text) OWNER TO postgres; SELECT sqlj.set_classpath('javatest', 'lucenetest'); select javatest.resultSetToken('HOLA MUNDO') ********** JAVA FUNCTION ********** package org.postgresql.pljava.lucenetest; import java.sql.ResultSet; import java.sql.SQLException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.SimpleAnalyzer; import java.io.StringReader; import java.io.IOException; import org.postgresql.pljava.ResultSetProvider; public class ResultSetToken implements ResultSetProvider { private final java.lang.String m_string; private TokenStream m_stream; public static org.postgresql.pljava.ResultSetProvider executeSelect(java.lang.String paramStr) throws SQLException { return new ResultSetToken(paramStr); } From swaroop.rath at comlab.ox.ac.uk Sat Jul 17 08:11:14 2010 From: swaroop.rath at comlab.ox.ac.uk (swaroop) Date: Sat, 17 Jul 2010 09:11:14 +0100 Subject: [Pljava-dev] PlJava for Postgres 8.4 Message-ID: Hi Please let me know if we have PlJava supported for Postgres 8.4. We are using Postgres 8.4 and get the below error while trying to install plJava - Trying to deploy pljava on Postgres 8.4 confirms this issue: ERROR: incompatible library "/home/rf/Documents/Oxford DPhil/ICDE2011/svntree/pljava32/pljava.so": version mismatch DETAIL: Server is version 8.4, library is version 8.3. But PlJava works well in Postgres 8.3. Regards Swaroop -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Sat Jul 17 14:23:28 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Sat, 17 Jul 2010 16:23:28 +0200 Subject: [Pljava-dev] possible patch for cancelling a trigger operation (Luca Ferrari) Message-ID: Hi, I did not have time to try it on yet but for sure i will. Do you know if this patch is going to be included in the official pljava distribution?. I hope so because its kind of troublesome to build it. Do you have any jar and dll or .so which I can try it on? Thanks a lot Luca for your work, Dear Pl/Java users and developers, please find attached a minimal patch for cancelling a trigger operation. I attach also a simple Java file that provides a trigger function that counts each insert/update operations and will allow only even operations. The trigger can be used against any table once the jar is installed in the database as follows: CREATE FUNCTION trigger_test() RETURNS trigger AS 'itpug.pljava.CancelStatementTriggerTest.triggerFunction' LANGUAGE 'java'; CREATE TRIGGER trigger_test_impl BEFORE INSERT OR UPDATE OR DELETE ON java_table FOR EACH ROW EXECUTE PROCEDURE trigger_test(); (substitute java_table with your own table - be aware that the trigger will print a message on the logs). I've tested the patch against the following system: - PostgreSQL 8.4.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit - the latest version of the pljava sources - jdk 1.5.0_22 on Ubuntu 64 bit - gcc 4.4.3 The patch works as follows: 0) since TriggerData is the only way to interact with the backed, the logic of cancelling the current insert/update/delete statements must pass thru the TriggerData class. To allows this I've inserted two methods to set the current statement as cancelled and to know if the current statement has been cancelled. 1) the internal/TriggerData class now implements such methods using a simple boolean flag to indicate if the current statement must be cancelled or not. Please note that there is a utility method to check the conditions on which a statement can be aborted. 2) the internal/TriggerData class when returning the tuple to apply, simply returns 0 if the statement has been cancelled. Such 0 is interpreted as a NULL result in the backend code (Functions.c) and therefore the trigger aborts the current operation. 3) when asking for a newResultSet on TriggerData, the system checks if the trigger has already been marked for cancelling the current statement, so that the returned result set is set read-only. This is not the optimal solution, since one can get the result set before cancelling the trigger, but in any case the getTriggerResultTuple will avoid insertions/updates. I've also inserted a few comments while studying the call flow in order to better understand. Hope this can be applied as a stable patch, in such case I've other ideas to better improve the patch on which I can work (e.g., propagate the status to the ResultSets, use a static flag instead of an instance one, etc.). Luca -------------- next part -------------- diff --git a/src/C/pljava/Function.c b/src/C/pljava/Function.c index 434d9a9..b8012da 100644 --- a/src/C/pljava/Function.c +++ b/src/C/pljava/Function.c @@ -755,12 +755,26 @@ Datum Function_invoke(Function self, PG_FUNCTION_ARGS) return retVal; } + +/* + * This function is called from the backend.c when a trigger must execute, that means when a user-defined + * function must be executed as a trigger function. + * As for any backend-trigger function written in C, this function receives the PG_FUNCTION_ARGS that + * defines the user-defined function parameters. Moreover, the function receives the Function "self" pointer + * that is a struct that contains information about the Java method to call, the result type, if the function + * is a multi-call one (i.e., it requires/it will allocate a memory context) and so on. + */ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) { jvalue arg; Datum ret; + // create a trigger data object starting from the current trigger data passed from + // the backend to the function (remember that context here is the trigger data). + // This method simply creates a Java object starting from the C TriggerData one. arg.l = TriggerData_create((TriggerData*)fcinfo->context); + + // if the trigger data cannot be created than the trigger must abort (i.e., return null) if(arg.l == 0) return 0; @@ -769,7 +783,8 @@ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) fcinfo->isnull = false; if(JNI_exceptionCheck()) - ret = 0; + // exception, so return null (i.e., abort the trigger) + ret = 0; else { /* A new Tuple may or may not be created here. If it is, ensure that @@ -778,9 +793,15 @@ Datum Function_invokeTrigger(Function self, PG_FUNCTION_ARGS) MemoryContext currCtx = Invocation_switchToUpperContext(); ret = PointerGetDatum(TriggerData_getTriggerReturnTuple(arg.l, &fcinfo->isnull)); - /* Triggers are not allowed to set the fcinfo->isnull, even when + /* + * Triggers are not allowed to set the fcinfo->isnull, even when * they return null. - */ + * In fact fcinfo->isnull means that the function is returning a NULL SQL value, while a + * trigger returning null means that the current statement must be cancelled, not that + * the trigger is returning a NULL SQL value. + * Please note that the method TriggerData.getTriggerReturnTuple will set the fcinfo->isnull + * value according to the trigger function returning NULL, but this is not useful here. + */ fcinfo->isnull = false; MemoryContextSwitchTo(currCtx); diff --git a/src/C/pljava/type/TriggerData.c b/src/C/pljava/type/TriggerData.c index 1d65bc3..95359d5 100644 --- a/src/C/pljava/type/TriggerData.c +++ b/src/C/pljava/type/TriggerData.c @@ -35,7 +35,11 @@ HeapTuple TriggerData_getTriggerReturnTuple(jobject jtd, bool* wasNull) { Ptr2Long p2l; HeapTuple ret = 0; - p2l.longVal = JNI_callLongMethod(jtd, s_TriggerData_getTriggerReturnTuple); + + // call the method identified by the "s_triggerData_getTriggerReturnTuple" id on the + // object "jtd", that is a Java instance of the TriggerData + p2l.longVal = JNI_callLongMethod(jtd, // java TriggerData + s_TriggerData_getTriggerReturnTuple); // method id to call if(p2l.longVal != 0) ret = heap_copytuple((HeapTuple)p2l.ptrVal); else diff --git a/src/java/pljava/org/postgresql/pljava/TriggerData.java b/src/java/pljava/org/postgresql/pljava/TriggerData.java index 78aa87c..8cca8d9 100644 --- a/src/java/pljava/org/postgresql/pljava/TriggerData.java +++ b/src/java/pljava/org/postgresql/pljava/TriggerData.java @@ -144,4 +144,24 @@ public interface TriggerData * if the contained native buffer has gone stale. */ boolean isFiredByUpdate() throws SQLException; + + + /** + * Sets the aborted flag of this TriggerData. A TriggerData aborted + * will return an empty result set, so that the trigger will abort its execution and + * the insertion/update will be aborted too. + * Please note that this can be set only for a trigger invoked before each row and for + * insert/update. + */ + public void cancelCurrentStatement( boolean abort ) throws SQLException; + + + /** + * Is this trigger aborted? + */ + public boolean isCurrentStatementCancelled() throws SQLException; + + + + } diff --git a/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java b/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java index da9c16b..7aed3f8 100644 --- a/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java +++ b/src/java/pljava/org/postgresql/pljava/internal/TriggerData.java @@ -34,9 +34,12 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be null for delete triggers and for triggers that was fired for * statement.
The returned set will be updateable and positioned on a * valid row. + * If the current statement has been cancelled the returned result set will be + * read-only. * - * @return An updateable ResultSet containing one row or - * null. + * @return An updateable ResultSet containing one row (if the trigger has been invoked for each row, before and the + * current statement has not been cancelled), a read-only result set in the case of an after trigger (or if the + * current statement has been cancelled) or null. * @throws SQLException * if the contained native buffer has gone stale. */ @@ -55,9 +58,8 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr ? this.getTriggerTuple() : this.getNewTuple(); - // Triggers fired after will always have a read-only row - // - m_new = new TriggerResultSet(this.getRelation().getTupleDesc(), tuple, this.isFiredAfter()); + // Triggers fired after will always have a read-only row, and so do triggers that have been cancelled. + m_new = new TriggerResultSet(this.getRelation().getTupleDesc(), tuple, (this.isFiredAfter() | this.isCurrentStatementCancelled()) ); return m_new; } @@ -66,6 +68,9 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be null for insert triggers and for triggers that was fired for * statement.
The returned set will be read-only and positioned on a * valid row. + * + * Please note that a result set will be returned even if the current statement is cancelled, this is not + * a security hole since the result set will be read-only! * * @return A read-only ResultSet containing one row or * null. @@ -77,12 +82,69 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr if (m_old != null) return m_old; - if (this.isFiredByInsert() || this.isFiredForStatement()) + if (this.isFiredByInsert() || this.isFiredForStatement() ) return null; m_old = new TriggerResultSet(this.getRelation().getTupleDesc(), this.getTriggerTuple(), true); return m_old; } + + + /** + * This flag indicates if the trigger must be aborted, that is if the trigger must return a null tuple + * so to abort the current operation. This flag is not made static in order to allow the trigger to start from a clean + * value for each row. If this is made static, than the trigger status will be kept along invocations of the same trigger function. + */ + private boolean aborted = false; + + /** + * Sets the aborted flag of this TriggerData. A TriggerData aborted + * will return an empty result set, so that the trigger will abort its execution and + * the insertion/update will be aborted too. + * Please note that this can be set only for a trigger invoked before each row and for + * insert/update/delete. + */ + public final synchronized void cancelCurrentStatement( boolean abort ) throws SQLException{ + // check that this is called only on a insert/update trigger for before events + if( ! this.canCancelStatement() ) + throw new SQLException("Cannot abort a trigger not handling a before event for inserts/updates!"); + + this.aborted = abort; + } + + /** + * Is this trigger aborted? + */ + public final synchronized boolean isCurrentStatementCancelled() throws SQLException{ + // security check + if( ! this.canCancelStatement() ) + this.aborted = false; + + + return this.aborted; + } + + + /** + * An utility method to test if the current trigger can cancel the current statement, that means + * if it can delete the current in-progress operation (for instance INSERT command). + * A trigger can cancel the current statement only if (and logical conditions): + * - it is invoked for a before event + * - it is invoked on each row + * - it is invoked for an insert/update/delete + * + * and this means that it cannot cancel the statement if (or logical conditions): + * - it is invoked for an after event + * - it is invoked for a statement + */ + private final boolean canCancelStatement() throws SQLException{ + if( this.isFiredAfter() || this.isFiredForStatement() ) + return false; + else + return true; + } + + /** * Commits the changes made on the ResultSet representing * new and returns the native pointer of new tuple. This @@ -90,11 +152,12 @@ public class TriggerData extends JavaWrapper implements org.postgresql.pljava.Tr * be called in any other way. * * @return The modified tuple, or if no modifications have been made, the - * original tuple. + * original tuple. In the case no one tuple must be returned, than + * this method will return a zero value. */ public long getTriggerReturnTuple() throws SQLException { - if(this.isFiredForStatement() || this.isFiredAfter()) + if(this.isFiredForStatement() || this.isFiredAfter() || this.isCurrentStatementCancelled() ) // // Only triggers fired before each row can have a return // value. -------------- next part -------------- A non-text attachment was scrubbed... Name: CancelStatementTriggerTest.java Type: text/x-java Size: 1303 bytes Desc: not available URL: ------------------------------ _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev End of Pljava-dev Digest, Vol 72, Issue 14 ****************************************** _________________________________________________________________ Accede a tu Hotmail en un solo clic ?Desc?rgate Internet Explorer 8 y empieza a disfrutar de todas las ventajas! http://www.ayudartepodria.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at mgscreativa.com Sat Jul 17 15:45:22 2010 From: martin at mgscreativa.com (Martin Sebastian Brilla Ghia) Date: Sat, 17 Jul 2010 12:45:22 -0300 Subject: [Pljava-dev] Postgre 8.4 AMD64 compatible binaries In-Reply-To: References: Message-ID: <4C41D012.90602@mgscreativa.com> Hi...i can not compile pljava from CVS, it throws me a lot of compiler errors. Can someone kindly provide me the plsql amd64 compiled binaries compatible with postgresql 8.4? Thanks a lot! From dan.olteanu at comlab.ox.ac.uk Sat Jul 17 11:23:14 2010 From: dan.olteanu at comlab.ox.ac.uk (Dan Olteanu) Date: Sat, 17 Jul 2010 12:23:14 +0100 Subject: [Pljava-dev] PlJava for Postgres 8.4 In-Reply-To: References: Message-ID: Hi Swaroop, thanks for checking. I assume you have not seen Robert's email on this - he also found out it does not work. Dan On Sat, Jul 17, 2010 at 9:11 AM, swaroop wrote: > Hi > ?Please let me know if we have PlJava supported for Postgres 8.4. We are > using Postgres 8.4 and get the below error while trying to install plJava - > Trying to deploy pljava on Postgres 8.4 confirms this issue: > ? ? ? ?ERROR: ?incompatible library "/home/rf/Documents/Oxford > DPhil/ICDE2011/svntree/pljava32/pljava.so": version mismatch > ? ? ? ?DETAIL: ?Server is version 8.4, library is version 8.3. > ?? ? ? ? ? ? ? ? ? ?But PlJava works well in Postgres 8.3. > Regards > Swaroop > From fluca1978 at infinito.it Wed Jul 21 09:44:57 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Wed, 21 Jul 2010 11:44:57 +0200 Subject: [Pljava-dev] possible patch for cancelling a trigger operation (Luca Ferrari) In-Reply-To: References: Message-ID: <201007211144.57467.fluca1978@infinito.it> On Saturday, July 17, 2010 04:23:28 pm JOSE CARLOS MARTINEZ LLARIO's cat walking on the keyboard wrote: > Hi, > > I did not have time to try it on yet but for sure i will. > > Do you know if this patch is going to be included in the official pljava > distribution?. I hope so because its kind of troublesome > > to build it. > Well, I don't know, but the patch is the queue: http://www.progettidiimpresa.it/servizi/notizie/notizie_homepage.aspx?mp=1 > Do you have any jar and dll or .so which I can try it on? > I can compile a version for you and send to you via e-mail. Luca From fluca1978 at infinito.it Wed Jul 21 10:22:51 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Wed, 21 Jul 2010 12:22:51 +0200 Subject: [Pljava-dev] possible patch for cancelling a trigger operation (Luca Ferrari) In-Reply-To: <201007211144.57467.fluca1978@infinito.it> References: <201007211144.57467.fluca1978@infinito.it> Message-ID: <201007211222.51977.fluca1978@infinito.it> Ops...wrong link, this is the right one: http://pgfoundry.org/tracker/index.php?func=detail&aid=1010848&group_id=1000038&atid=336 Luca From fluca1978 at infinito.it Wed Jul 21 13:05:50 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Wed, 21 Jul 2010 15:05:50 +0200 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> Message-ID: <201007211505.50676.fluca1978@infinito.it> On Monday, July 12, 2010 10:47:27 pm Caleb Welton's cat walking on the keyboard wrote: > Hello, I had several questions about the ELogHandler in pljava, was hoping > someone could comment on it. > > In postgres there is code to handle the filtering of logging levels and > this is controlled by several gucs for different types of logging. For > instance log_min_messages is used to control the logging level that gets > written to the log file, while client_min_messages is used to control the > logging level that gets displayed to the client. Looking at > ELogHandler.java I see that pljava bases its own decision on how the JVM > should filter logging level based on the setting of log_min_messages at > the time of JVM initialization. > Not sure to get it straight, however what I see is that: 1) the Backend.c has a method to set the log level that is used in JNICalls.c in the printStackTraceMethod using DEBUG1 as thresold to print out logs (this sounds ok to me); 2) in ELogHandler.java the publish method calls the Backend.log method, that resolves to a native one that uses the ereport method in the Backend.c with the declared level. So what can happen is that, once the pljava process has started, someone on the server increases the logging level (log_min_messages) and pljava continues to use the old value. This is due to the fact that the correct reading of the log_min_messages is done only in the init() method (more exactly in the getPgLevel one). If this is the issue you are talking about the only solution I see is to correct the Backend.log method in order to call the getPgLevel before issuing the log record. However, this should not be a problem, since the logging system of the server should ignore any message with a wrong logging category. So, let's say you must log an DEBUG3 message and the server has an INFO level, the message should be ignored at all, even if issued. When the log_min_messages is raised to DEBUG3, another message should be logged. Isn't it? > Question) Why does PLJava even try to install its own log level filtering > when the Postgres logger already is handling this? > I don't get this, in my opinion the pljava is not installing a filter handler, but a translation handler from the Java levels to the Pg ones. > In Java there are the following logging levels, from highest to lowest: > SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST In Postgres the logging > levels, from highest to lowest are: PANIC, FATAL, ERROR, WARNING, NOTICE, > INFO, LOG, DEBUG1, DEBUG2, ... > > pljava creates a mapping as follows: > SEVERE => ERROR > WARNING => WARNING > INFO => INFO > CONFIG => NOTICE Right, pg's notice is mapped over Java's config, that is higher than INFO- >INFO. Moreover I don't understand why fatal is mapped to OFF and not to SEVERE. Maybe the patch I attach can fix the problem, but since we are mapping more levels than those available in Java we have some clashes. Luca -------------- next part -------------- A non-text attachment was scrubbed... Name: log.patch Type: text/x-patch Size: 2381 bytes Desc: not available URL: From cwelton at greenplum.com Thu Jul 22 18:23:58 2010 From: cwelton at greenplum.com (Caleb Welton) Date: Thu, 22 Jul 2010 11:23:58 -0700 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <201007211505.50676.fluca1978@infinito.it> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> <201007211505.50676.fluca1978@infinito.it> Message-ID: <910AD504-DD44-40EC-9592-426A84F5FA05@greenplum.com> On Jul 21, 2010, at 6:05 AM, Luca Ferrari wrote: On Monday, July 12, 2010 10:47:27 pm Caleb Welton's cat walking on the keyboard wrote: Hello, I had several questions about the ELogHandler in pljava, was hoping someone could comment on it. In postgres there is code to handle the filtering of logging levels and this is controlled by several gucs for different types of logging. For instance log_min_messages is used to control the logging level that gets written to the log file, while client_min_messages is used to control the logging level that gets displayed to the client. Looking at ELogHandler.java I see that pljava bases its own decision on how the JVM should filter logging level based on the setting of log_min_messages at the time of JVM initialization. Not sure to get it straight, however what I see is that: 1) the Backend.c has a method to set the log level that is used in JNICalls.c in the printStackTraceMethod using DEBUG1 as thresold to print out logs (this sounds ok to me); Agreed. 2) in ELogHandler.java the publish method calls the Backend.log method, that resolves to a native one that uses the ereport method in the Backend.c with the declared level. The problem is that the ELogHandler.publish() method only seems to be called when the item being logged is within the current LogHandler level. If it is not in the LogHandler level then the Backend.c ereport method is never called. So what can happen is that, once the pljava process has started, someone on the server increases the logging level (log_min_messages) and pljava continues to use the old value. This is due to the fact that the correct reading of the log_min_messages is done only in the init() method (more exactly in the getPgLevel one). If this is the issue you are talking about the only solution I see is to correct the Backend.log method in order to call the getPgLevel before issuing the log record. However, this should not be a problem, since the logging system of the server should ignore any message with a wrong logging category. So, let's say you must log an DEBUG3 message and the server has an INFO level, the message should be ignored at all, even if issued. When the log_min_messages is raised to DEBUG3, another message should be logged. Isn't it? The changing of the setting is one of the problems I was commenting on. The other point that you missed is that log_min_messages and client_min_messages are different settings with different meanings. In my configuration I have these settings: log_min_messages = 'warning' client_min_messages = 'info' Which is to say that I want INFO messages returned to the client, but I do not want them logged to the database log. In this configuration what I see is that PL/Python has set its logging level to 'WARNING' and as such the LogHandler never calls publish on messages of level 'INFO' and thus these messages never get returned to the client like they should due to the current setting of client_min_messages. This is demonstratable using the "logMessage" function from the pljava examples.jar. postgres=# show client_min_messages; client_min_messages --------------------- notice (1 row) postgres=# show log_min_messages; log_min_messages ------------------ warning (1 row) postgres=# SELECT javatest.logMessage('INFO', 'hello'); logmessage ------------ (1 row) postgres=# SELECT javatest.logMessage('WARNING', 'hello'); WARNING: 22 Jul 10 11:17:00 org.postgresql.example.LoggerTest hello logmessage ------------ (1 row) Note how the WARNING message was output, but the INFO message was not. Starting a new session I can get different results if I change log_min_messages to match client_min_messages, despite the fact that log_min_messages should not affect what messages are returned to the client. postgres=# set log_min_messages=notice; SET postgres=# SELECT javatest.logMessage('INFO', 'hello'); INFO: 22 Jul 10 11:20:31 org.postgresql.example.LoggerTest hello logmessage ------------ (1 row) Question) Why does PLJava even try to install its own log level filtering when the Postgres logger already is handling this? I don't get this, in my opinion the pljava is not installing a filter handler, but a translation handler from the Java levels to the Pg ones. The example above clearly indicates that the logLevel is being used as a filter as well as a translation. In Java there are the following logging levels, from highest to lowest: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST In Postgres the logging levels, from highest to lowest are: PANIC, FATAL, ERROR, WARNING, NOTICE, INFO, LOG, DEBUG1, DEBUG2, ... pljava creates a mapping as follows: SEVERE => ERROR WARNING => WARNING INFO => INFO CONFIG => NOTICE Right, pg's notice is mapped over Java's config, that is higher than INFO- INFO. Moreover I don't understand why fatal is mapped to OFF and not to SEVERE. Maybe the patch I attach can fix the problem, but since we are mapping more levels than those available in Java we have some clashes. Luca Thanks, Caleb -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcllario at hotmail.com Sat Jul 24 19:26:18 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Sat, 24 Jul 2010 21:26:18 +0200 Subject: [Pljava-dev] JASPA (JAva SPAtial) For PostgreSQL (through PLJAVA) and H2 Message-ID: (sorry for the cross posting) After one year of development, we are pleased to announce the release 0.1RC1 of JASPA (JAva SPAtial). JASPA potentially brings around 200 spatial functions to any relational database system that supports a full set of java store procedures. In this 0.1 version JASPA supports PostgreSQL and H2, and we are already working with HSQLDB. JASPA has a similar functionality as PostGIS 1.4, supporting spatial operators and predicates, arrays of geometries, spatial aggregates, etc. JASPA is written in java and is easy to extend using java store procedures. JASPA is licensed under the GNU GPL. This project has been possible thanks to other open source projects. Besides to take advantage of these projects we have used their mailing lists and they helped us a lot. The JASPA team is very grateful to them: - PostGIS. The mirror on which JASPA has been looking at. - JTS (Java Topology Suite). This library is widely used in JASPA and many open source initiatives bringing the possibility to use spatial analysis to the java open source world. - GeoTools (used for projections, KML support and Shape to JASPA converters) - PostgreSQL and PLJAVA (Java store procedures for PostgreSQL) - H2 and H2Spatial (a Java database and its spatial extension used at the beginning of JASPA) - HSQLDB (a Java database which probably will be supported by JASPA in the next release) - gvSIG (a desktop SIG which we hope it can connect to JASPA soon) The authors of this project are: Jose C. Martinez-Llario. Developer and project director. (1) Marta Gonzalez-Alcaide. Tester and document builder. (1) (1) Deparment of Cartographic Engineering, Geodesy and Photogrammetry at La Universidad Politecnica de Valencia (Spain). Any contributor is very welcomed to join the JASPA project. JASPA Download: - The latest software can be found at: http://forge.osor.eu/projects/jaspa/ - The full JASPA documentation can be found at: http://jaspa.forge.osor.eu/. The online manual (the pdf version has more than 300 pages) includes the installation process from binaries and source, a tutorial and a complete reference of the JASPA commands. - Mailing list: http://lists.forge.osor.eu/mailman/listinfo/jaspa-users - JASPA is hosted on OSOR.EU at: http://www.osor.eu/projects/jaspa _________________________________________________________________ No has visto nada como el nuevo Messenger, ?te sorprender?! http://explore.live.com/windows-live-messenger -------------- next part -------------- An HTML attachment was scrubbed... URL: From fluca1978 at infinito.it Mon Jul 26 10:00:04 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 26 Jul 2010 12:00:04 +0200 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <910AD504-DD44-40EC-9592-426A84F5FA05@greenplum.com> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> <201007211505.50676.fluca1978@infinito.it> <910AD504-DD44-40EC-9592-426A84F5FA05@greenplum.com> Message-ID: <201007261200.05370.fluca1978@infinito.it> Maybe now I get the point: 1) Session calls ELogHandler.init() that initializes the parameters, including the logging level; 2) the Java logging framework does not call publish if the logging level is not adeguate, and therefore changes in the log/client_min_messages are not seen. In this situation there are three solutions I guess: 1) each time a logging is successful (i.e., publish has been called), we need to reconfigure the log level of the handler. The problem with this is that we risk to get unlogged messages for a while, until one pass the publish method. 2) once a new handler is created it must self update its value of the log level. The problem with this is that if the handler is kept for a while, the changes are not seen. 3) create a thread that, once a while, reloads the log level and set it into the current log level, but this causes a lot of threads (one per handler) 4) keep a map of all created handlers and update them each time a new one is created. The problem is that the thread will execute when the control is on the java space, due to the locking mechanism of the backend, and therefore it will update the handlers with a little lag once a java call is made. This should not represent a big problem, because before a java call is made there is no need to change the java logging setting. I attach a patch also for this solution mixed with the number 2. Any comments? Luca -------------- next part -------------- A non-text attachment was scrubbed... Name: eloghandler.thread.patch Type: text/x-patch Size: 10671 bytes Desc: not available URL: From cwelton at greenplum.com Mon Jul 26 21:08:34 2010 From: cwelton at greenplum.com (Caleb Welton) Date: Mon, 26 Jul 2010 14:08:34 -0700 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <201007261200.05370.fluca1978@infinito.it> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> <201007211505.50676.fluca1978@infinito.it> <910AD504-DD44-40EC-9592-426A84F5FA05@greenplum.com> <201007261200.05370.fluca1978@infinito.it> Message-ID: <6C857822-01B2-417D-8CFE-04309DB12A98@greenplum.com> Well the original question I asked was "Why does PL/Java try to filter log levels at all?". If we simply disabled the log filtering from PL/Java and let the log filtering happen naturally in Postgres then all of these problems just go away. This could be accomplished using the attached patch. Alternatively, significant improvement could be made by at least setting the log level correctly at init time by checking both log_min_messages AND client_min_messages and setting the log level to whichever is FINER grained logging. But since this still doesn't address changes to the GUCs over time it seems like a less desirable approach. Regards, Caleb -------------- next part -------------- A non-text attachment was scrubbed... Name: logHandler.patch Type: application/octet-stream Size: 4589 bytes Desc: logHandler.patch URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001..txt URL: From fluca1978 at infinito.it Tue Jul 27 07:00:33 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Tue, 27 Jul 2010 09:00:33 +0200 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <6C857822-01B2-417D-8CFE-04309DB12A98@greenplum.com> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> <201007261200.05370.fluca1978@infinito.it> <6C857822-01B2-417D-8CFE-04309DB12A98@greenplum.com> Message-ID: <201007270900.34396.fluca1978@infinito.it> On Monday, July 26, 2010 11:08:34 pm Caleb Welton's cat walking on the keyboard wrote: > Well the original question I asked was "Why does PL/Java try to filter log > levels at all?". If we simply disabled the log filtering from PL/Java and > let the log filtering happen naturally in Postgres then all of these > problems just go away. > > This could be accomplished using the attached patch. > > Alternatively, significant improvement could be made by at least setting > the log level correctly at init time by checking both log_min_messages AND > client_min_messages and setting the log level to whichever is FINER > grained logging. But since this still doesn't address changes to the > GUCs over time it seems like a less desirable approach. The patch is doing exactly this: choosing the finer logging level between client and log_min_messages, but this is a static setup, as you say. I think we should have a way to get notified of when the server settings have changed. Moreover, what happen if you change the client_min_messages within an interactive session before calling a Java method? With a setup done at the initialization phase we could have the same problem of logs missed. So I guess we should re-initialize log levels at least as soon as the handler is created (not only at the jvm initialization) and maybe each time (or each n-times) the publish method is called. That's why I proposed a threaded solution. However, the best is to be notified about changes in the configuration of the session and/or of the server. Luca From autisi at yahoo.com Tue Jul 27 10:51:40 2010 From: autisi at yahoo.com (Smith Roman) Date: Tue, 27 Jul 2010 03:51:40 -0700 (PDT) Subject: [Pljava-dev] Pljava-dev Digest, Vol 73, Issue 9 In-Reply-To: Message-ID: <9285.77127.qm@web59807.mail.ac4.yahoo.com> Hello Everyone, Congratulations on the release of JASPA?(JAva SPAtial). I must say this work is very commendable. Just reading about it for the first time. Though I am perfectly satisfied with postgis, however this work has huge potentials especially if it begins to have more functionality than postgis by virtue of the fact that it is in pure java. For example for embedded devices requiring a small footprint db (H2 or HSQLDB). >From now on, I will keep an eye on the project. I also hope it will be brought to other databases e.g. oracle. probably to serve as an alternative to oracle spatial which depending on the use case can be too costly. Is there going to be a user mailing list ? Well done !!! Smith Roman. --- On Sun, 7/25/10, pljava-dev-request at pgfoundry.org wrote: From: pljava-dev-request at pgfoundry.org Subject: Pljava-dev Digest, Vol 73, Issue 9 To: pljava-dev at pgfoundry.org Date: Sunday, July 25, 2010, 12:00 PM Send Pljava-dev mailing list submissions to ??? pljava-dev at pgfoundry.org To subscribe or unsubscribe via the World Wide Web, visit ??? http://pgfoundry.org/mailman/listinfo/pljava-dev or, via email, send a message with subject or body 'help' to ??? pljava-dev-request at pgfoundry.org You can reach the person managing the list at ??? pljava-dev-owner at pgfoundry.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Pljava-dev digest..." Today's Topics: ???1. JASPA (JAva SPAtial) For PostgreSQL (through PLJAVA)??? and H2 ? ? ? (JOSE CARLOS MARTINEZ LLARIO) ---------------------------------------------------------------------- Message: 1 Date: Sat, 24 Jul 2010 21:26:18 +0200 From: JOSE CARLOS MARTINEZ LLARIO Subject: [Pljava-dev] JASPA (JAva SPAtial) For PostgreSQL (through ??? PLJAVA)??? and H2 To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" (sorry for the cross posting) After one year of development, we are pleased to announce the release 0.1RC1 of JASPA (JAva SPAtial). JASPA potentially brings around 200 spatial functions to any relational database system that supports a full set of java store procedures. In this 0.1 version JASPA supports PostgreSQL and H2, and we are already working with HSQLDB. JASPA has a similar functionality as PostGIS 1.4, supporting spatial operators and predicates, arrays of geometries, spatial aggregates, etc. JASPA is written in java and is easy to extend using java store procedures. JASPA is licensed under the GNU GPL. This project has been possible thanks to other open source projects. Besides to take advantage of these projects we have used their mailing lists and they helped us a lot. The JASPA team is very grateful to them: - PostGIS. The mirror on which JASPA has been looking at. - JTS (Java Topology Suite). This library is widely used in JASPA and many open source initiatives bringing the possibility to use spatial analysis to the java open source world. - GeoTools (used for projections, KML support and Shape to JASPA converters) - PostgreSQL and PLJAVA (Java store procedures for PostgreSQL) - H2 and H2Spatial (a Java database and its spatial extension used at the beginning of JASPA) - HSQLDB (a Java database which probably will be supported by JASPA in the next release) - gvSIG (a desktop SIG which we hope it can connect to JASPA soon) The authors of this project are: ? Jose C. Martinez-Llario. Developer and project director. (1) ? Marta Gonzalez-Alcaide. Tester and document builder. (1) ? (1)? ? Deparment of Cartographic Engineering, Geodesy and Photogrammetry at La Universidad Politecnica de Valencia (Spain). ? Any contributor is very welcomed to join the JASPA project. JASPA Download: - The latest software can be found at: http://forge.osor.eu/projects/jaspa/ - The full JASPA documentation can be found at: http://jaspa.forge.osor.eu/. The online manual (the pdf version has more than 300 pages) includes the installation process from binaries and source, a tutorial and a complete reference of the JASPA commands. - Mailing list: http://lists.forge.osor.eu/mailman/listinfo/jaspa-users - JASPA is hosted on OSOR.EU at: http://www.osor.eu/projects/jaspa ??? ???????? ?????? ??? ? _________________________________________________________________ No has visto nada como el nuevo Messenger, ?te sorprender?! http://explore.live.com/windows-live-messenger -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev End of Pljava-dev Digest, Vol 73, Issue 9 ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From cwelton at greenplum.com Tue Jul 27 17:57:15 2010 From: cwelton at greenplum.com (Caleb Welton) Date: Tue, 27 Jul 2010 10:57:15 -0700 Subject: [Pljava-dev] pljava error logging levels In-Reply-To: <201007270900.34396.fluca1978@infinito.it> References: <3F082C5B-116B-4CB7-9755-B3D306B8C942@greenplum.com> <201007261200.05370.fluca1978@infinito.it> <6C857822-01B2-417D-8CFE-04309DB12A98@greenplum.com> <201007270900.34396.fluca1978@infinito.it> Message-ID: <72AB0F3B-AFA8-4B2E-B235-D798F2F1D0BB@greenplum.com> On Jul 27, 2010, at 12:00 AM, Luca Ferrari wrote: > On Monday, July 26, 2010 11:08:34 pm Caleb Welton's cat walking on the > keyboard wrote: >> Well the original question I asked was "Why does PL/Java try to filter log >> levels at all?". If we simply disabled the log filtering from PL/Java and >> let the log filtering happen naturally in Postgres then all of these >> problems just go away. >> >> This could be accomplished using the attached patch. > > The patch is doing exactly this: choosing the finer logging level between > client and log_min_messages, but this is a static setup, as you say. I direct your attention to the line: props.setProperty(".level", getPgLevel().getName()); Which my patch removed from ELogHandler.init(). By removing this property setting the instantiated log handler no longer filters log messages as they come in and all log messages get published and passed to Postgres. That alone fixes the problem. At which point getPgLevel() becomes largely obsolete, but I figured I would "fix" it as well since it was defined as a public method and it was conceivable that someone might be using it. Removing and/or deprecating getPgLevel() would also be an option. > I think > we should have a way to get notified of when the server settings have changed. > Moreover, what happen if you change the client_min_messages within an > interactive session before calling a Java method? That was never an issue to begin with. Since setup occurs on the first function call any GUC changes that occur prior to that simply look like the normal server settings. > With a setup done at the > initialization phase we could have the same problem of logs missed. > So I guess we should re-initialize log levels at least as soon as the handler > is created (not only at the jvm initialization) and maybe each time (or each > n-times) the publish method is called. That's why I proposed a threaded > solution. I didn't like the threaded solution because behavior would be non-deterministic depending on thread execution timing. > However, the best is to be notified about changes in the configuration > of the session and/or of the server. I think this and not having Java pre-filter the messages are roughly equivalent, and since not pre-filtering seemed less complicated it was what I did in the patch. From JDW at Fodoze.com Wed Aug 4 02:05:05 2010 From: JDW at Fodoze.com (John D. West) Date: Tue, 3 Aug 2010 19:05:05 -0700 Subject: [Pljava-dev] problem implementing with ResultSetProvider Message-ID: Hi, All. When I create and try to run a function implementing ResultSetProvider, I get a "Unable to find static method with signature..." error. Java code: import edu.sc.seis.TauP.Arrival; import edu.sc.seis.TauP.TauModelException; import edu.sc.seis.TauP.TauP_Time; import java.sql.ResultSet; import java.sql.SQLException; import org.postgresql.pljava.ResultSetProvider; public class emTauP implements ResultSetProvider { private ResultSet rs; private static TauP_Time tt; private static Arrival[] arr; public emTauP(String model, String phaselist, double depth, double gcarc) throws SQLException { // instantiate TauP_Time object, passing it the model name tt = new TauP_Time(model); // add the list of phases tt.parsePhaseList(phaselist); // correct for the source depth tt.depthCorrect(depth); // calculate for the distance in degrees tt.calculate(gcarc); // get the array of Arrival objects arr = tt.getArrivals(); } public static ResultSetProvider TTimes(String model, String phaselist, double depth, double gcarc) throws SQLException { // instantiate a new TauP class object return new emTauP(model, phaselist, depth, gcarc); } public boolean assignRowValues(ResultSet trs, int RowNum) throws SQLException { if (rs.next()) { trs.updateString(1, arr[RowNum].getName()); trs.updateDouble(2, arr[RowNum].getTime()); trs.updateDouble(3, arr[RowNum].getRayParam()); return(true); } else { return(false); } } public void close() throws SQLException { // does nothing, but required to implement ResultSetProvider } } I install the class in postgres (8.4), using: SELECT sqlj.install_jar( 'file:///EMERALD/Java/emTauP/emTauP.jar', 'emTauP', true ) I create the function: CREATE OR REPLACE FUNCTION em_ttimes(em_model text, em_phaselist text, em_depth double precision, em_gcarc double precision) RETURNS SETOF public.em_ttime AS 'emTauP.TTimes(java.lang.String, java.lang.String, double, double)' LANGUAGE java; Then when I run it, I get the following error: ERROR: Unable to find static method emTauP.TTimes with signature (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; I can create and run functions which do not implement ResultSetProvider, no problem. Can anyone see something I'm doing wrong, or is this a bug? Thanks very much! ? ?? -- John From fluca1978 at infinito.it Wed Aug 4 06:59:16 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Wed, 4 Aug 2010 08:59:16 +0200 Subject: [Pljava-dev] problem implementing with ResultSetProvider In-Reply-To: References: Message-ID: <201008040859.17264.fluca1978@infinito.it> On Wednesday, August 04, 2010 04:05:05 am John D. West's cat walking on the keyboard wrote: > Then when I run it, I get the following error: > ERROR: Unable to find static method emTauP.TTimes with signature > (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetPro > vider; > > I can create and run functions which do not implement > ResultSetProvider, no problem. Can anyone see something I'm doing > wrong, or is this a bug? > I have recreated it on my system and I can invoke the function. It should not be a classpath problem, since that will lead to a class not found exception. Could you post the log to see if there is an hint? Luca From JDW at Fodoze.com Wed Aug 4 16:32:56 2010 From: JDW at Fodoze.com (John D. West) Date: Wed, 4 Aug 2010 10:32:56 -0600 Subject: [Pljava-dev] problem implementing with ResultSetProvider In-Reply-To: <201008040859.17264.fluca1978@infinito.it> References: <201008040859.17264.fluca1978@infinito.it> Message-ID: I set the logging levels to Debug5, and this is what I got when trying to run the function: 2010-08-04 09:22:04 PDT DEBUG: 00000: 04 Aug 10 09:22:04 org.postgresql.pljava.internal.Backend Using SecurityManager for trusted language 2010-08-04 09:22:04 PDT LOCATION: Java_org_postgresql_pljava_internal_Backend__1log, /usr/share/pljava/src/C/pljava/Backend.c:890 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: className = 'emTauP', methodName = 'TTimes', parameters = 'java.lang.String,java.lang.String,double,double', returnType = 'null' 2010-08-04 09:22:04 PDT LOCATION: parseFunction, /usr/share/pljava/src/C/pljava/Function.c:400 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: 04 Aug 10 09:22:04 org.postgresql.pljava.sqlj.Loader Creating typeMappings for schema public 2010-08-04 09:22:04 PDT LOCATION: Java_org_postgresql_pljava_internal_Backend__1log, /usr/share/pljava/src/C/pljava/Backend.c:890 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: Loading class emTauP 2010-08-04 09:22:04 PDT LOCATION: Function_init, /usr/share/pljava/src/C/pljava/Function.c:539 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: Obtaining method emTauP.TTimes (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; 2010-08-04 09:22:04 PDT LOCATION: Function_init, /usr/share/pljava/src/C/pljava/Function.c:569 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: Method emTauP.TTimes (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; not found 2010-08-04 09:22:04 PDT LOCATION: Function_init, /usr/share/pljava/src/C/pljava/Function.c:578 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT DEBUG: 00000: Obtaining method emTauP.TTimes (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetHandle; 2010-08-04 09:22:04 PDT LOCATION: Function_init, /usr/share/pljava/src/C/pljava/Function.c:608 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); 2010-08-04 09:22:04 PDT ERROR: XX000: Unable to find static method emTauP.TTimes with signature (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; 2010-08-04 09:22:04 PDT LOCATION: PgObject_throwMemberError, /usr/share/pljava/src/C/pljava/PgObject.c:101 2010-08-04 09:22:04 PDT STATEMENT: select * from em_ttimes('PREM', 'SKS', 50, 99); Does that cast light on anything? Thanks! -- John On Wed, Aug 4, 2010 at 12:59 AM, Luca Ferrari wrote: > On Wednesday, August 04, 2010 04:05:05 am John D. West's cat walking on the > keyboard wrote: > >> Then when I run it, I get the following error: >> ERROR: Unable to find static method emTauP.TTimes with signature >> (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetPro >> vider; >> >> I can create and run functions which do not implement >> ResultSetProvider, no problem. ?Can anyone see something I'm doing >> wrong, or is this a bug? >> > > I have recreated it on my system and I can invoke the function. It should not > be a classpath problem, since that will lead to a class not found exception. > Could you post the log to see if there is an hint? > > Luca > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > From JDW at Fodoze.com Wed Aug 4 20:20:37 2010 From: JDW at Fodoze.com (John D. West) Date: Wed, 4 Aug 2010 13:20:37 -0700 Subject: [Pljava-dev] problem implementing with ResultSetProvider In-Reply-To: References: <201008040859.17264.fluca1978@infinito.it> Message-ID: This seems to have been caused by my not installing into the database (using sqlj.install_jar()) the external jar files this function depends on. It mostly works now. thanks! ? ?? -- John On Wed, Aug 4, 2010 at 9:32 AM, John D. West wrote: > I set the logging levels to Debug5, and this is what I got when trying > to run the function: > 2010-08-04 09:22:04 PDT DEBUG: ?00000: 04 Aug 10 09:22:04 > org.postgresql.pljava.internal.Backend Using SecurityManager for > trusted language > 2010-08-04 09:22:04 PDT LOCATION: > Java_org_postgresql_pljava_internal_Backend__1log, > /usr/share/pljava/src/C/pljava/Backend.c:890 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: className = 'emTauP', > methodName = 'TTimes', parameters = > 'java.lang.String,java.lang.String,double,double', returnType = 'null' > 2010-08-04 09:22:04 PDT LOCATION: ?parseFunction, > /usr/share/pljava/src/C/pljava/Function.c:400 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: 04 Aug 10 09:22:04 > org.postgresql.pljava.sqlj.Loader Creating typeMappings for schema > public > 2010-08-04 09:22:04 PDT LOCATION: > Java_org_postgresql_pljava_internal_Backend__1log, > /usr/share/pljava/src/C/pljava/Backend.c:890 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: Loading class emTauP > 2010-08-04 09:22:04 PDT LOCATION: ?Function_init, > /usr/share/pljava/src/C/pljava/Function.c:539 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: Obtaining method emTauP.TTimes > (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; > 2010-08-04 09:22:04 PDT LOCATION: ?Function_init, > /usr/share/pljava/src/C/pljava/Function.c:569 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: Method emTauP.TTimes > (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; > not found > 2010-08-04 09:22:04 PDT LOCATION: ?Function_init, > /usr/share/pljava/src/C/pljava/Function.c:578 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT DEBUG: ?00000: Obtaining method emTauP.TTimes > (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetHandle; > 2010-08-04 09:22:04 PDT LOCATION: ?Function_init, > /usr/share/pljava/src/C/pljava/Function.c:608 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > 2010-08-04 09:22:04 PDT ERROR: ?XX000: Unable to find static method > emTauP.TTimes with signature > (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetProvider; > 2010-08-04 09:22:04 PDT LOCATION: ?PgObject_throwMemberError, > /usr/share/pljava/src/C/pljava/PgObject.c:101 > 2010-08-04 09:22:04 PDT STATEMENT: ?select * from em_ttimes('PREM', > 'SKS', 50, 99); > > Does that cast light on anything? > > Thanks! > > ? ? -- John > > On Wed, Aug 4, 2010 at 12:59 AM, Luca Ferrari wrote: >> On Wednesday, August 04, 2010 04:05:05 am John D. West's cat walking on the >> keyboard wrote: >> >>> Then when I run it, I get the following error: >>> ERROR: Unable to find static method emTauP.TTimes with signature >>> (Ljava/lang/String;Ljava/lang/String;DD)Lorg/postgresql/pljava/ResultSetPro >>> vider; >>> >>> I can create and run functions which do not implement >>> ResultSetProvider, no problem. ?Can anyone see something I'm doing >>> wrong, or is this a bug? >>> >> >> I have recreated it on my system and I can invoke the function. It should not >> be a classpath problem, since that will lead to a class not found exception. >> Could you post the log to see if there is an hint? >> >> Luca >> _______________________________________________ >> Pljava-dev mailing list >> Pljava-dev at pgfoundry.org >> http://pgfoundry.org/mailman/listinfo/pljava-dev >> > From freget at googlemail.com Sun Aug 8 20:01:01 2010 From: freget at googlemail.com (Thilo Schneider) Date: Sun, 8 Aug 2010 22:01:01 +0200 Subject: [Pljava-dev] Endianness and SQLInput Message-ID: <288F38E7-7B7A-4576-97E1-982FC8EA6C38@googlemail.com> Dear list, is there any way to let SQLInput and SQLOutput work with little endian formatted numbers as well? As far as I could find Markus Schaber suggested a patch for SQL[Input/Outout]FromJunk.java back in 2006. (see http://pgfoundry.org/pipermail/pljava-dev/2006/000909.html). Has this patch been applied or was another solution found? If not, what would have to be changed? Is changing these files enough, or are there some obstacles in the C-Code as well? Thank you for your help! Cheers Thilo Schneider P.S.: I had some problems setting up the mailing list. There is a slight chance that you receive this email duplicated. In this case: sorry! -------------- next part -------------- An HTML attachment was scrubbed... URL: