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: From p.brewer at cornell.edu Fri Sep 24 17:16:13 2010 From: p.brewer at cornell.edu (Peter W. Brewer) Date: Fri, 24 Sep 2010 13:16:13 -0400 Subject: [Pljava-dev] Plea for 8.4 support Message-ID: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu> Hi all, I see from the archives and various forums on the web that I am not the only one who would desperately like pljava support for PG8.4. I see there is a fix in CVS so is there any chance the developers can make a new release? I would be *extremely* grateful! I put in a request to Debian/Ubuntu to get a package in the repositories but the maintainer is not responding. The existing pljava in Ubuntu is unusable as it works against an earlier version of PG which is no longer supported. I am perfectly happy to compile for myself on my own system, but I want to release a server application that relies on pljava. I can't expect my users to manually compile dependencies! Many thanks Peter From thomas at tada.se Fri Sep 24 22:26:53 2010 From: thomas at tada.se (Thomas Hallgren) Date: Sat, 25 Sep 2010 00:26:53 +0200 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu> Message-ID: <4C9D25AD.8080104@tada.se> Hi Peter, A lot could be done to improve pljava in various ways. Support for generics, PostgreSQL 8.4, more secure trust etc. What's lacking is resources. So far, very few has come forward and offered any real help in terms of resources or funding. So to all of you PL/Java users that want 8.4 support or other improvements, any chance you can help out and make it happen? Kind Regards, Thomas Hallgren On 09/24/2010 07:16 PM, Peter W. Brewer wrote: > Hi all, > > I see from the archives and various forums on the web that I am not the > only one who would desperately like pljava support for PG8.4. I see > there is a fix in CVS so is there any chance the developers can make a > new release? I would be *extremely* grateful! > > I put in a request to Debian/Ubuntu to get a package in the repositories > but the maintainer is not responding. The existing pljava in Ubuntu is > unusable as it works against an earlier version of PG which is no longer > supported. > > I am perfectly happy to compile for myself on my own system, but I want > to release a server application that relies on pljava. I can't expect > my users to manually compile dependencies! > > Many thanks > > Peter > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > From p.brewer at cornell.edu Sat Sep 25 03:36:19 2010 From: p.brewer at cornell.edu (Peter W. Brewer) Date: Fri, 24 Sep 2010 23:36:19 -0400 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <4C9D25AD.8080104@tada.se> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> Message-ID: <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> Hi Thomas, My small group has contributed practically in the past, but unfortunately I no longer have anyone on my team that can help out in this way. Resources are often a problem with smaller open source projects. What sort of funding do you think is required to get PG8.4 support? Are you (or any other developer of this list) in a position to implement this for a bounty? Regards Peter ________________________________________ From: pljava-dev-bounces at pgfoundry.org [pljava-dev-bounces at pgfoundry.org] On Behalf Of Thomas Hallgren [thomas at tada.se] Sent: 24 September 2010 18:26 To: pljava-dev at pgfoundry.org Subject: Re: [Pljava-dev] Plea for 8.4 support Hi Peter, A lot could be done to improve pljava in various ways. Support for generics, PostgreSQL 8.4, more secure trust etc. What's lacking is resources. So far, very few has come forward and offered any real help in terms of resources or funding. So to all of you PL/Java users that want 8.4 support or other improvements, any chance you can help out and make it happen? Kind Regards, Thomas Hallgren On 09/24/2010 07:16 PM, Peter W. Brewer wrote: > Hi all, > > I see from the archives and various forums on the web that I am not the > only one who would desperately like pljava support for PG8.4. I see > there is a fix in CVS so is there any chance the developers can make a > new release? I would be *extremely* grateful! > > I put in a request to Debian/Ubuntu to get a package in the repositories > but the maintainer is not responding. The existing pljava in Ubuntu is > unusable as it works against an earlier version of PG which is no longer > supported. > > I am perfectly happy to compile for myself on my own system, but I want > to release a server application that relies on pljava. I can't expect > my users to manually compile dependencies! > > Many thanks > > Peter > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > _______________________________________________ Pljava-dev mailing list Pljava-dev at pgfoundry.org http://pgfoundry.org/mailman/listinfo/pljava-dev From lucas at mcsnw.com Sun Sep 26 07:02:25 2010 From: lucas at mcsnw.com (Lucas Madar) Date: Sun, 26 Sep 2010 00:02:25 -0700 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> Message-ID: <4C9EF001.4010600@mcsnw.com> I've built packages for postgres 8.4 using the latest pljava CVS. These were built on ubuntu lucid, so they match the current postgres version there (8.4.4). I have no easy way to test them on an earlier distro. These just install the .jar and the .so, so proper configuration of the postgresql server is still necessary. http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_amd64.deb http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_i386.deb (sources and such at http://mcsnw.com/pljava/) If you're still offering a bounty... ;) Enjoy, Lucas On 09/24/2010 08:36 PM, Peter W. Brewer wrote: > Hi Thomas, > > My small group has contributed practically in the past, but unfortunately I no longer have anyone on my team that can help out in this way. Resources are often a problem with smaller open source projects. What sort of funding do you think is required to get PG8.4 support? Are you (or any other developer of this list) in a position to implement this for a bounty? > > Regards > > Peter > > ________________________________________ > From: pljava-dev-bounces at pgfoundry.org [pljava-dev-bounces at pgfoundry.org] On Behalf Of Thomas Hallgren [thomas at tada.se] > Sent: 24 September 2010 18:26 > To: pljava-dev at pgfoundry.org > Subject: Re: [Pljava-dev] Plea for 8.4 support > > Hi Peter, > > A lot could be done to improve pljava in various ways. Support for > generics, PostgreSQL 8.4, more secure trust etc. What's lacking is > resources. So far, very few has come forward and offered any real help > in terms of resources or funding. So to all of you PL/Java users that > want 8.4 support or other improvements, any chance you can help out and > make it happen? > > Kind Regards, > Thomas Hallgren > > > On 09/24/2010 07:16 PM, Peter W. Brewer wrote: > >> Hi all, >> >> I see from the archives and various forums on the web that I am not the >> only one who would desperately like pljava support for PG8.4. I see >> there is a fix in CVS so is there any chance the developers can make a >> new release? I would be *extremely* grateful! >> >> I put in a request to Debian/Ubuntu to get a package in the repositories >> but the maintainer is not responding. The existing pljava in Ubuntu is >> unusable as it works against an earlier version of PG which is no longer >> supported. >> >> I am perfectly happy to compile for myself on my own system, but I want >> to release a server application that relies on pljava. I can't expect >> my users to manually compile dependencies! >> >> Many thanks >> >> Peter >> From thomas at tada.se Sun Sep 26 09:43:55 2010 From: thomas at tada.se (Thomas Hallgren) Date: Sun, 26 Sep 2010 11:43:55 +0200 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> Message-ID: <4C9F15DB.5050402@tada.se> Hi Peter, Personally, I have very little time to devote to this project but if someone else steps up, I promise to do what I can to get needed patches etc. into the source tree. Regards, Thomas Hallgren On 09/25/2010 05:36 AM, Peter W. Brewer wrote: > Hi Thomas, > > My small group has contributed practically in the past, but unfortunately I no longer have anyone on my team that can help out in this way. Resources are often a problem with smaller open source projects. What sort of funding do you think is required to get PG8.4 support? Are you (or any other developer of this list) in a position to implement this for a bounty? > > Regards > > Peter > > ________________________________________ > From: pljava-dev-bounces at pgfoundry.org [pljava-dev-bounces at pgfoundry.org] On Behalf Of Thomas Hallgren [thomas at tada.se] > Sent: 24 September 2010 18:26 > To: pljava-dev at pgfoundry.org > Subject: Re: [Pljava-dev] Plea for 8.4 support > > Hi Peter, > > A lot could be done to improve pljava in various ways. Support for > generics, PostgreSQL 8.4, more secure trust etc. What's lacking is > resources. So far, very few has come forward and offered any real help > in terms of resources or funding. So to all of you PL/Java users that > want 8.4 support or other improvements, any chance you can help out and > make it happen? > > Kind Regards, > Thomas Hallgren > > > On 09/24/2010 07:16 PM, Peter W. Brewer wrote: > >> Hi all, >> >> I see from the archives and various forums on the web that I am not the >> only one who would desperately like pljava support for PG8.4. I see >> there is a fix in CVS so is there any chance the developers can make a >> new release? I would be *extremely* grateful! >> >> I put in a request to Debian/Ubuntu to get a package in the repositories >> but the maintainer is not responding. The existing pljava in Ubuntu is >> unusable as it works against an earlier version of PG which is no longer >> supported. >> >> I am perfectly happy to compile for myself on my own system, but I want >> to release a server application that relies on pljava. I can't expect >> my users to manually compile dependencies! >> >> Many thanks >> >> Peter >> _______________________________________________ >> Pljava-dev mailing list >> Pljava-dev at pgfoundry.org >> http://pgfoundry.org/mailman/listinfo/pljava-dev >> >> > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > From p.brewer at cornell.edu Mon Sep 27 14:50:05 2010 From: p.brewer at cornell.edu (Peter Brewer) Date: Mon, 27 Sep 2010 10:50:05 -0400 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <4C9EF001.4010600@mcsnw.com> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> <4C9EF001.4010600@mcsnw.com> Message-ID: <4CA0AF1D.4030506@cornell.edu> Hi Lucas, Awesome! I didn't realise you were still using pljava. Do the normal main stream deb packages do other configuration of postgres? Can we propose these packages get pushed into the Ubuntu repositories? Cheers Pete P.S. Bounty will be in the post shortly! ;-) On 26/9/10 3:02 AM, Lucas Madar wrote: > I've built packages for postgres 8.4 using the latest pljava CVS. These > were built on ubuntu lucid, so they match the current postgres version > there (8.4.4). I have no easy way to test them on an earlier distro. > These just install the .jar and the .so, so proper configuration of the > postgresql server is still necessary. > > http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_amd64.deb > http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_i386.deb > > (sources and such at http://mcsnw.com/pljava/) > > If you're still offering a bounty... ;) > > Enjoy, > Lucas > > On 09/24/2010 08:36 PM, Peter W. Brewer wrote: >> Hi Thomas, >> >> My small group has contributed practically in the past, but unfortunately I no longer have anyone on my team that can help out in this way. Resources are often a problem with smaller open source projects. What sort of funding do you think is required to get PG8.4 support? Are you (or any other developer of this list) in a position to implement this for a bounty? >> >> Regards >> >> Peter >> >> ________________________________________ >> From: pljava-dev-bounces at pgfoundry.org [pljava-dev-bounces at pgfoundry.org] On Behalf Of Thomas Hallgren [thomas at tada.se] >> Sent: 24 September 2010 18:26 >> To: pljava-dev at pgfoundry.org >> Subject: Re: [Pljava-dev] Plea for 8.4 support >> >> Hi Peter, >> >> A lot could be done to improve pljava in various ways. Support for >> generics, PostgreSQL 8.4, more secure trust etc. What's lacking is >> resources. So far, very few has come forward and offered any real help >> in terms of resources or funding. So to all of you PL/Java users that >> want 8.4 support or other improvements, any chance you can help out and >> make it happen? >> >> Kind Regards, >> Thomas Hallgren >> >> >> On 09/24/2010 07:16 PM, Peter W. Brewer wrote: >> >>> Hi all, >>> >>> I see from the archives and various forums on the web that I am not the >>> only one who would desperately like pljava support for PG8.4. I see >>> there is a fix in CVS so is there any chance the developers can make a >>> new release? I would be *extremely* grateful! >>> >>> I put in a request to Debian/Ubuntu to get a package in the repositories >>> but the maintainer is not responding. The existing pljava in Ubuntu is >>> unusable as it works against an earlier version of PG which is no longer >>> supported. >>> >>> I am perfectly happy to compile for myself on my own system, but I want >>> to release a server application that relies on pljava. I can't expect >>> my users to manually compile dependencies! >>> >>> Many thanks >>> >>> Peter >>> > From lucas at mcsnw.com Mon Sep 27 20:58:15 2010 From: lucas at mcsnw.com (Lucas Madar) Date: Mon, 27 Sep 2010 13:58:15 -0700 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: <4CA0AF1D.4030506@cornell.edu> References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> <4C9EF001.4010600@mcsnw.com> <4CA0AF1D.4030506@cornell.edu> Message-ID: I think something getting in the way of a new package is that there's no official release from the pl/java team. Could the current version be released as pljava-1.4.1? It looks like nothing has changed in CVS in over a year. On 9/27/2010 7:50 AM, Peter Brewer wrote: > Hi Lucas, > > Awesome! I didn't realise you were still using pljava. > > Do the normal main stream deb packages do other configuration of > postgres? Can we propose these packages get pushed into the Ubuntu > repositories? > > Cheers > > Pete > > P.S. Bounty will be in the post shortly! ;-) > > > > On 26/9/10 3:02 AM, Lucas Madar wrote: >> I've built packages for postgres 8.4 using the latest pljava CVS. These >> were built on ubuntu lucid, so they match the current postgres version >> there (8.4.4). I have no easy way to test them on an earlier distro. >> These just install the .jar and the .so, so proper configuration of the >> postgresql server is still necessary. >> >> http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_amd64.deb >> http://mcsnw.com/pljava/postgresql-8.4-pljava_1.4.0.20100925-1_i386.deb >> >> (sources and such at http://mcsnw.com/pljava/) >> >> If you're still offering a bounty... ;) >> >> Enjoy, >> Lucas From tim.clarke at manifest.co.uk Tue Sep 28 14:33:54 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Tue, 28 Sep 2010 15:33:54 +0100 Subject: [Pljava-dev] Plea for 8.4 support In-Reply-To: References: <9732D60D9245D94EBE30D29729CD1DD80245891EC1@MBXC.exchange.cornell.edu>, <4C9D25AD.8080104@tada.se> <9732D60D9245D94EBE30D29729CD1DD80245891EC4@MBXC.exchange.cornell.edu> <4C9EF001.4010600@mcsnw.com> <4CA0AF1D.4030506@cornell.edu> Message-ID: <4CA1FCD2.7090206@manifest.co.uk> On 27/09/10 21:58, Lucas Madar wrote: > I think something getting in the way of a new package is that there's > no official release from the pl/java team. Could the current version > be released as pljava-1.4.1? It looks like nothing has changed in CVS > in over a year. Time to raise the subject of PG9 support too? -- Tim Clarke AMBCS 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 johann at myrkraverk.com Sun Oct 3 19:28:25 2010 From: johann at myrkraverk.com (Johann "Myrkraverk" Oskarsson) Date: Sun, 3 Oct 2010 19:28:25 +0000 Subject: [Pljava-dev] Postgresql 8.4 Support (with patch) Message-ID: Dear pljava-dev, Here is a preliminary patch for PostgreSQL 8.4 support. There are still some C warnings I'd like to get rid of and the issue of not compiling with java 6; my system supplied OpenJDK. Successfully compiled with: Sun Java 1.4.2_19 GCC: 4.4.3 PostgreSQL 8.4 (system supplied) System: Ubuntu 10.04 LTS - the Lucid Lynx uname -a: Linux asuka 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686 GNU/Linux The patch may need some cleanup - perhaps only whitespace before it's applied. I'll look into Java 6 support if I get some pointers on what exactly the issue is. I must confess Java is not my strongest language. Also, setting CFLAGS=-Werror before running make does not seem to have any effects. Will some (gnu)make expert fix that for me? Johann -------------- next part -------------- A non-text attachment was scrubbed... Name: pljava-1.4.0-8.4.patch Type: application/octet-stream Size: 4164 bytes Desc: not available URL: From johann at myrkraverk.com Mon Oct 4 23:14:47 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Mon, 4 Oct 2010 23:14:47 +0000 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond Message-ID: Dear pljava-dev, As you may have noticed I ported the 1.4 source tree for 8.4 in a way that "works for me" before I came across this mailing list and saw that the CVS may have some support already. That effort took about 2-3 hours so I'm not crying over a time wasted. I am now in a position to work more or less full time on pljava if I have some funding to do so. How and where to get such funding is something I don't really know so please come forward with ideas if you can. There are plenty of ways in which it can be improved. The Java code needs to be updated, my 8.4 changes made it incompatible with 8.3. Asserting that it works for different platforms than just Linux and Windows (Solaris and FreeBSD come to mind). Perhaps do not rely on GCC. Create binary packages for the major repositories and/or work with Postgres package maintainers. And so on and so on. Please let me know if you have some immediate needs and I can perhaps fulfill them. Johann From p.brewer at cornell.edu Tue Oct 5 13:51:35 2010 From: p.brewer at cornell.edu (Peter Brewer) Date: Tue, 05 Oct 2010 09:51:35 -0400 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: References: Message-ID: <4CAB2D67.1090502@cornell.edu> Hi Johann, As Lucas said last week, we'll need an official release if the major repositories are to accept an 8.4 version. Is this something that can happen now? My personal needs were fixed temporarily by Lucas' binary, but I would feel *much* more comfortable if an official binary was in the major respositories. In terms of Ubuntu at least, pljava is already several releases behind the times. The mismatch in versions means that there hasn't been a functioning pljava for several releases now, and Maverick is just days away from launch. With the release and gradual adoption of PG9, things are getting even more desperate. I guess there is the possibility of getting modest funds from my lab, but I couldn't begin to ask for money until a firm plan with milestones was in place. What sort of ballpark are we talking here? Hours, days, weeks or months? It sounds to me like we're just a few hours away from 8.4 support, but what about 9? Cheers Peter On 4/10/10 7:14 PM, Johann 'Myrkraverk' Oskarsson wrote: > Dear pljava-dev, > > As you may have noticed I ported the 1.4 source tree for 8.4 in a way > that "works for me" before I came across this mailing list and saw > that the CVS may have some support already. > > That effort took about 2-3 hours so I'm not crying over a time wasted. > > I am now in a position to work more or less full time on pljava if I > have some funding to do so. How and where to get such funding is > something I don't really know so please come forward with ideas if you > can. > > There are plenty of ways in which it can be improved. The Java code > needs to be updated, my 8.4 changes made it incompatible with 8.3. > Asserting that it works for different platforms than just Linux and > Windows (Solaris and FreeBSD come to mind). Perhaps do not rely on > GCC. Create binary packages for the major repositories and/or work > with Postgres package maintainers. And so on and so on. > > Please let me know if you have some immediate needs and I can perhaps > fulfill them. > > > Johann > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev From thomas at tada.se Tue Oct 5 16:27:00 2010 From: thomas at tada.se (Thomas Hallgren) Date: Tue, 05 Oct 2010 18:27:00 +0200 Subject: [Pljava-dev] New team member Message-ID: <4CAB51D4.9040902@tada.se> Hi, Please welcome Johann 'Myrkraverk' Oskarsson as a new developer in the PL/Java team. I have good hopes that he will be able to help out with an official PostgreSQL 8.4 / Java 1.6 release. Kind Regards, Thomas Hallgren From tim.clarke at manifest.co.uk Tue Oct 5 16:30:53 2010 From: tim.clarke at manifest.co.uk (Tim Clarke) Date: Tue, 05 Oct 2010 17:30:53 +0100 Subject: [Pljava-dev] New team member In-Reply-To: <4CAB51D4.9040902@tada.se> References: <4CAB51D4.9040902@tada.se> Message-ID: <4CAB52BD.7000309@manifest.co.uk> On 05/10/10 17:27, Thomas Hallgren wrote: > Hi, > > Please welcome Johann 'Myrkraverk' Oskarsson as a new developer in the > PL/Java team. I have good hopes that he will be able to help out with > an official PostgreSQL 8.4 / Java 1.6 release. > > Kind Regards, > Thomas Hallgren Well done Johann :-) -- Tim Clarke AMBCS 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 johann at myrkraverk.com Tue Oct 5 16:50:13 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 5 Oct 2010 16:50:13 +0000 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: <4CAB2D67.1090502@cornell.edu> References: <4CAB2D67.1090502@cornell.edu> Message-ID: Hi Peter, On Tue, Oct 5, 2010 at 1:51 PM, Peter Brewer wrote: > Hi Johann, > > As Lucas said last week, we'll need an official release if the major > repositories are to accept an 8.4 version. ?Is this something that can > happen now? Yes with a caveat: There is no Java 6 support yet. The 8.3 Ubuntu package used GCJ, possibly for this reason. This means that the version (binary) I am using was compiled with Java 1.4. I have fixed one Java 6 compile error. There are new virtual methods in the JDBC interfaces that the SPI driver needs to implement. I estimate 2-3 days of actual coding to get it up to speed and 3-5 days more for testing. > My personal needs were fixed temporarily by Lucas' binary, but I would feel > *much* more comfortable if an official binary was in the major > respositories. That is what I want to see as well. > In terms of Ubuntu at least, pljava is already several releases behind the > times. ?The mismatch in versions means that there hasn't been a functioning > pljava for several releases now, and Maverick is just days away from launch. > ?With the release and gradual adoption of PG9, things are getting even more > desperate. I also have questions: What PG releases do we (I?) need to support? Java 6 and the Postgres releases are two different coding projects (for the most part). What combinations do we want? Java 4 and 5 have already been EoLd, PG 7, 8.0 and 8.1 are on life support. Do we freeze 8.3 and below at Java 5 and below or is there need/want for Java 6 for the older Postgres releases? Here I'll point out that this is only relevant when compiling pljava, of course it will run on a later JVM. > I guess there is the possibility of getting modest funds from my lab, but I > couldn't begin to ask for money until a firm plan with milestones was in > place. ?What sort of ballpark are we talking here? ?Hours, days, weeks or > months? ?It sounds to me like we're just a few hours away from 8.4 support, > but what about 9? A firm plan is something I can't make until I realize what the milestones are and get more familiar with the code/project. One which I found earlier is that the SPI driver isn't fully JDBC compliant. Adding that as a milestone with certification and everything can easily add several weeks to the project. Installing 9 on my poor laptop just to try out pljava is something I'm not very inclined to do. At least not without a good reason (as in money). With an access to a 9 play server I'd be willing to give it a go next week. There is also the question of continued support. Java 7 will be with us soon enough. There are platforms to consider, 32 and 64 bits and so on. So far I've only tested this on a 32 bit Ubuntu. (Open)Solaris x64 is next on my list since I'm already familiar with the platform. Throwing out a release for 8.4 is useless if it only runs on 32 bit Ubuntu running on my personal laptop. Johann From johann at myrkraverk.com Tue Oct 5 16:51:56 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 5 Oct 2010 16:51:56 +0000 Subject: [Pljava-dev] New team member In-Reply-To: <4CAB52BD.7000309@manifest.co.uk> References: <4CAB51D4.9040902@tada.se> <4CAB52BD.7000309@manifest.co.uk> Message-ID: Hi, On Tue, Oct 5, 2010 at 4:30 PM, Tim Clarke wrote: > ?On 05/10/10 17:27, Thomas Hallgren wrote: >> Hi, >> >> Please welcome Johann 'Myrkraverk' Oskarsson as a new developer in the >> PL/Java team. I have good hopes that he will be able to help out with >> an official PostgreSQL 8.4 / Java 1.6 release. >> >> Kind Regards, >> Thomas Hallgren > > Well done Johann :-) Thank you. Johann From p.brewer at cornell.edu Tue Oct 5 20:15:48 2010 From: p.brewer at cornell.edu (Peter Brewer) Date: Tue, 05 Oct 2010 16:15:48 -0400 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: References: <4CAB2D67.1090502@cornell.edu> Message-ID: <4CAB8774.3090601@cornell.edu> Hi Johann, > I also have questions: What PG releases do we (I?) need to support? > Java 6 and the Postgres releases are two different coding projects > (for the most part). What combinations do we want? Java 4 and 5 have > already been EoLd, PG 7, 8.0 and 8.1 are on life support. > > Do we freeze 8.3 and below at Java 5 and below or is there need/want > for Java 6 for the older Postgres releases? > > Here I'll point out that this is only relevant when compiling pljava, > of course it will run on a later JVM. Seeing as we clearly have very limited resources I'd vote for trimming down support to as few combinations as possible. Certainly we shouldn't worry about EoLd stuff. I'd vote for only supporting Java6 and current PG versions. > Installing 9 on my poor laptop just to try out pljava is something I'm > not very inclined to do. At least not without a good reason (as in > money). > > With an access to a 9 play server I'd be willing to give it a go next week. > > There is also the question of continued support. Java 7 will be with > us soon enough. There are platforms to consider, 32 and 64 bits and > so on. So far I've only tested this on a 32 bit Ubuntu. > (Open)Solaris x64 is next on my list since I'm already familiar with > the platform. > > Throwing out a release for 8.4 is useless if it only runs on 32 bit > Ubuntu running on my personal laptop. I get your point - although it would solve my problems! ;-) Cheers Peter From thomas at tada.se Tue Oct 5 21:00:26 2010 From: thomas at tada.se (Thomas Hallgren) Date: Tue, 05 Oct 2010 23:00:26 +0200 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: <4CAB8774.3090601@cornell.edu> References: <4CAB2D67.1090502@cornell.edu> <4CAB8774.3090601@cornell.edu> Message-ID: <4CAB91EA.50309@tada.se> On 10/05/2010 10:15 PM, Peter Brewer wrote: > Hi Johann, > >> I also have questions: What PG releases do we (I?) need to support? >> Java 6 and the Postgres releases are two different coding projects >> (for the most part). What combinations do we want? Java 4 and 5 have >> already been EoLd, PG 7, 8.0 and 8.1 are on life support. >> >> Do we freeze 8.3 and below at Java 5 and below or is there need/want >> for Java 6 for the older Postgres releases? >> >> Here I'll point out that this is only relevant when compiling pljava, >> of course it will run on a later JVM. > > Seeing as we clearly have very limited resources I'd vote for trimming > down support to as few combinations as possible. Certainly we > shouldn't worry about EoLd stuff. I'd vote for only supporting Java6 > and current PG versions. That gets my vote too. It's not like the old releases will vanish just because we release new stuff and releasing combination's like Java 1.4 or even 1.5 on Postgres 8.4 or later doesn't make much sense. - thomas From johann at myrkraverk.com Tue Oct 5 21:11:27 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 5 Oct 2010 21:11:27 +0000 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: <4CAB8774.3090601@cornell.edu> References: <4CAB2D67.1090502@cornell.edu> <4CAB8774.3090601@cornell.edu> Message-ID: Hi pljava, On Tue, Oct 5, 2010 at 8:15 PM, Peter Brewer wrote: > Seeing as we clearly have very limited resources I'd vote for trimming down > support to as few combinations as possible. ?Certainly we shouldn't worry > about EoLd stuff. ?I'd vote for only supporting Java6 and current PG > versions. >From the release/support policy page: PostgreSQL 7.4 July 2010 (extended) PostgreSQL 8.0 July 2010 (extended) PostgreSQL 8.1 November 2010 PostgreSQL 8.2 December 2011 PostgreSQL 8.3 February 2013 PostgreSQL 8.4 July 2014 PostgreSQL 9.0 September 2015 This means (right now) Java 6 support for 8.{2,3,4} and 9. If someone is willing to give me access to (virtual) unix servers running the current PGs it will speed up my workflow. Everytime I need to download, possibly compile, and install yet another PG release is time I won't be coding. That task may even be put off indefinitely since system administration is not my favorite sport. If you want to support me directly with the project you can: o Give me access to a unix server running something I don't have at the moment. o Or better, send me a fully set up and configured box. o Pay me to work on a specific release/platform. Possibly with funds to buy hardware/software. Right now, my time is being spent, casually, on Java 6 support for 8.4 on a 32 bit Linux. That work should apply directly to 8.3 and 8.2 but at the moment I don't have a way to test it. Coding pljava itself is taking my time away from actually using it, and coding that project is taking time away from using it for what I started with in the first place. If you want Java 6 *now* you'll have to bring out some bucks and I can probably give you "something that works" within a week. Johann From johann at myrkraverk.com Wed Oct 6 10:08:25 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 6 Oct 2010 10:08:25 +0000 Subject: [Pljava-dev] Ongoing Development (funding): 8.4, Java 6 and beyond In-Reply-To: <4CAB2D67.1090502@cornell.edu> References: <4CAB2D67.1090502@cornell.edu> Message-ID: Hi Peter, On Tue, Oct 5, 2010 at 1:51 PM, Peter Brewer wrote: > It sounds to me like we're just a few hours away from 8.4 support, > but what about 9? I just became aware of https://launchpad.net/~pitti/+archive/postgresql PG9 may be sooner than I thought. Johann From johann at myrkraverk.com Wed Oct 6 11:09:49 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 6 Oct 2010 11:09:49 +0000 Subject: [Pljava-dev] Blog: Creating Immutable Columns with PL/Java in PostgreSQL Message-ID: I decidet to pimp PL/Java a little bit: http://my.opera.com/myrkraverk/blog/2010/10/06/creating-immutable-columns-with-pl-java-in-postgresql Enjoy, Johann From johann at myrkraverk.com Wed Oct 6 23:33:07 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 6 Oct 2010 23:33:07 +0000 Subject: [Pljava-dev] Java 6: Copy code from the JDBC driver? Message-ID: Hi pljava, Glossary JDBC Driver: The driver for Java client applications. SPI Driver: The PL/Java internal JDBC driver. The Java 6 JDBC API defines several new virtual methods. One of which is Connection.createStruct(). The JDBC Driver throws in a roundabout way an equivalent to throw new SQLException( "Method SPIConnect.createStruct(String, Object[]) is not yet implemented.", "0A000"); Using a utility class PSQLException and the constant "0A000" comes from the static PSQLState object NOT_IMPLEMENTED. Is it worthwhile to copy this code as-is from the JDBC driver or should we implement our own "not implemented" exception code path, such as using SQLFeatureNotSupportedException? I'm inclined to the latter. Johann From johann at myrkraverk.com Thu Oct 7 11:22:33 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Thu, 7 Oct 2010 11:22:33 +0000 Subject: [Pljava-dev] Java 6: Copy code from the JDBC driver? In-Reply-To: <4CAD5718.6060900@tada.se> References: <4CAD5718.6060900@tada.se> Message-ID: Hi Thomas, On Thu, Oct 7, 2010 at 5:14 AM, Thomas Hallgren wrote: > On 10/07/2010 01:33 AM, Johann 'Myrkraverk' Oskarsson wrote: >> The Java 6 JDBC API defines several new virtual methods. ?One of which >> is Connection.createStruct(). ?The JDBC Driver throws in a roundabout >> way an equivalent to .... >> Using a utility class PSQLException and the constant "0A000" comes >> from the static PSQLState object NOT_IMPLEMENTED. >> >> Is it worthwhile to copy this code as-is from the JDBC driver or >> should we implement our own "not implemented" exception code path, >> such as using SQLFeatureNotSupportedException? >> >> I'm inclined to the latter. > So am I. It's much easier to trap exceptions when using inheritance. The > important thing is that we propagate correct error codes on uncaught > exceptions. The PSQLException does inherit SQLException. I'll start throwing SQLFeatureNotSupportedExceptions. Stay tuned for CVS updates. Johann From johann at myrkraverk.com Fri Oct 8 00:01:40 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 00:01:40 +0000 Subject: [Pljava-dev] SPIConnection.java: Java 6 patch Message-ID: Hi pljava, Here is a Java 6 patch for SPIConnection.java. I'd like some comments on it. In particular isWrapperFor() and unwrap(). Commens on the code lifted from the JDBC Driver would also be helpful, the *ClientInfo() methods. If Postgres implements any of this functionality, I'd rather have a real implementation that just throw "not implemented" at the user. I've not had/given myself the time to look it up. Johann -------------- next part -------------- A non-text attachment was scrubbed... Name: SPIConnection.java.patch Type: application/octet-stream Size: 4945 bytes Desc: not available URL: From thomas at tada.se Fri Oct 8 07:09:45 2010 From: thomas at tada.se (Thomas Hallgren) Date: Fri, 08 Oct 2010 09:09:45 +0200 Subject: [Pljava-dev] SPIConnection.java: Java 6 patch In-Reply-To: References: Message-ID: <4CAEC3B9.3030208@tada.se> An HTML attachment was scrubbed... URL: From johann at myrkraverk.com Fri Oct 8 12:17:39 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 12:17:39 +0000 Subject: [Pljava-dev] SPIConnection.java: Java 6 patch In-Reply-To: <4CAEC3B9.3030208@tada.se> References: <4CAEC3B9.3030208@tada.se> Message-ID: Hi Thomas, On Fri, Oct 8, 2010 at 7:09 AM, Thomas Hallgren wrote: > Hi Johann, > > Everything in this patch looks OK to me. I haven't seen anything that > resembles client info in PostgreSQL. It's been committed. I'd like to return to this again when everything compiles with Java 6. Johann From johann at myrkraverk.com Fri Oct 8 13:22:14 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 13:22:14 +0000 Subject: [Pljava-dev] SPIStamement.java: Java 6 patch Message-ID: Hi pljava, I've just committed the following patch. I'm attaching it here since it doesn't seem to have showed up on the pljava-commits archive. Comments welcome. Johann -------------- next part -------------- A non-text attachment was scrubbed... Name: SPIStatement.java.patch Type: application/octet-stream Size: 1324 bytes Desc: not available URL: From johann at myrkraverk.com Fri Oct 8 15:02:45 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 15:02:45 +0000 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 39th of October with Java 6 & PostgreSQL 8.4 and 9.0 Message-ID: Hi pljava, My current commit schedule is 1 file per day which should be an hour or less of work. That means Java 6 support should be completed at Thursday 28th of October. If there are no compile errors for PostgreSQL 8.4 and 9.0 with and without GCJ, 1.4.1 will be released as source Friday 29th of October 2010 by me. I may or may not release binaries. If I do they will lag behind a day or more. If you want it sooner we can discuss funding. That may push the release as soon as the 15th. Maybe even earlier. Johann From johann at myrkraverk.com Fri Oct 8 15:03:45 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 15:03:45 +0000 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 29th of October with Java 6 & PostgreSQL 8.4 and 9.0 Message-ID: Of course I meant the 29th... Johann From johann at myrkraverk.com Fri Oct 8 22:52:08 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 8 Oct 2010 22:52:08 +0000 Subject: [Pljava-dev] Proper error and resource handling in triggers throwing exceptions? Message-ID: Hi pljava, Since there is no proper user forum (that I am aware of) I ask here. In a trigger that explicitly throws an exception, what is the proper way to close resources? In an attempt to do it properly I came up with this: public static void isAllowed( TriggerData td ) throws SQLException { Connection conn = null; PreparedStatement lookup = null; ResultSet r = null; try { // Errorchecks begin if ( td.isFiredForStatement() ) throw new TriggerException( td, "can't process STATEMENT events" ); if ( td.isFiredAfter() ) throw new TriggerException( td, "must be fired before event" ); if ( !td.isFiredByUpdate() ) throw new TriggerException( td, "can only process UPDATE events" ); // Errorchecks end String[] arguments = td.getArguments(); if ( arguments.length != 1 ) throw new TriggerException( td, "Exactly one argument required." ); String column = arguments[ 0 ]; conn = DriverManager.getConnection( "jdbc:default:connection" ); lookup = conn.prepareStatement( "SELECT value FROM is_allowed WHERE name = ? and value = ?;" ); ResultSet n = td.getNew(); String value = n.getString( column ); lookup.setString( 1, column ); lookup.setString( 2, value ); r = lookup.executeQuery(); if ( !r.next() ) { throw new TriggerException( td, "Value '" + value + "' not allowed." ); } } finally { if ( r != null ) r.close(); if ( lookup != null ) lookup.close(); if ( conn != null ) conn.close(); } } It takes a single column name as argument and looks the new value up in the table is_allowed which has the tubles ( 'column name', 'allowed value' ). Everything is TEXT. Is this enough or should I do the bloatware explained here: http://dmlloyd.blogspot.com/2008/07/proper-resource-management.html Johann From johann at myrkraverk.com Sat Oct 9 21:39:21 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sat, 9 Oct 2010 21:39:21 +0000 Subject: [Pljava-dev] PL/Java 1.5.0 Milestones Message-ID: Dear pljava-dev, As previously mentioned, the 1.4.1 milestones are Java 6, PostgreSQL 8.4 and 9.0 and the current release schedule is October 29th. 1.5.0 Milestones o Change row level trigger functions to return a ResultSet for the new value as explained in http://www.postgresql.org/docs/8.4/static/trigger-definition.html - this means the trigger does not have to throw an exception to prevent the action. o ... Ideas for further milestones are welcome. Johann From books at ejurka.com Mon Oct 11 03:48:16 2010 From: books at ejurka.com (Kris Jurka) Date: Sun, 10 Oct 2010 23:48:16 -0400 (EDT) Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 39th of October with Java 6 & PostgreSQL 8.4 and 9.0 In-Reply-To: References: Message-ID: On Fri, 8 Oct 2010, Johann 'Myrkraverk' Oskarsson wrote: > > That means Java 6 support should be completed at Thursday 28th of October. > > If there are no compile errors for PostgreSQL 8.4 and 9.0 with and > without GCJ, 1.4.1 will be released as source Friday 29th of October > 2010 by me. I think a release that changes support from JDBC3 -> JDBC4 should be a major release (that is 1.5), not 1.4.1 which seems like a minor change. Someone running a server that uses a 1.4 or 1.5 JVM will be taken by surprise if they try upgrading from 1.4 to 1.4.1. > I may or may not release binaries. If I do they will lag behind a day > or more. > I think it's important to release windows binaries. Building extensions on windows is a real pain, so to get any traction with the release, I think we need binaries. Releasing linux binaries is pretty easy, so I don't see a reason not to do it. Kris Jurka From pierce at hogranch.com Mon Oct 11 03:53:31 2010 From: pierce at hogranch.com (John R Pierce) Date: Sun, 10 Oct 2010 20:53:31 -0700 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 39th of October with Java 6 & PostgreSQL 8.4 and 9.0 In-Reply-To: References: Message-ID: <4CB28A3B.50701@hogranch.com> On 10/10/10 8:48 PM, Kris Jurka wrote: > I think it's important to release windows binaries. Building > extensions on windows is a real pain, so to get any traction with the > release, I think we need binaries. Releasing linux binaries is pretty > easy, so I don't see a reason not to do it. There's two major ports of Perl to MS Windows, ActivePerl and Strawberry Perl... There's also perl w/ cygwin. I suspect any binaries would be implementation specific. From johann at myrkraverk.com Mon Oct 11 16:58:48 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Mon, 11 Oct 2010 16:58:48 +0000 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 29th of October with Java 6 & PostgreSQL 8.4 and 9.0 Message-ID: On Mon, Oct 11, 2010 at 3:48 AM, Kris Jurka wrote: > > > On Fri, 8 Oct 2010, Johann 'Myrkraverk' Oskarsson wrote: > >> If there are no compile errors for PostgreSQL 8.4 and 9.0 with and >> without GCJ, 1.4.1 will be released as source Friday 29th of October >> 2010 by me. > > I think a release that changes support from JDBC3 -> JDBC4 should be a major > release (that is 1.5), not 1.4.1 which seems like a minor change. Someone > running a server that uses a 1.4 or 1.5 JVM will be taken by surprise if > they try upgrading from 1.4 to 1.4.1. I am mostly adding new interfaces and rarely change existing code. An exception would be something like todays commit. I am using JAVAC := javac -source 1.6 -target 1.6 in src/java/Makefile.global and it fails to compile with Java 5 and 4. I intend to commit this change when it compiles with Java 6. Binaries should therefore be clearly marked Java 6, such as having java6 in their name. So far, nothing I've done will affect existing code. If you still think this warrants a version number like 1.5, I'll be fine with it. >> I may or may not release binaries. ?If I do they will lag behind a day or >> more. >> > > I think it's important to release windows binaries. ?Building extensions on > windows is a real pain, so to get any traction with the release, I think we > need binaries. ?Releasing linux binaries is pretty easy, so I don't see a > reason not to do it. I, personally, will not make any effort at releasing binaries until November 1st at the earliest. Johann From thomas at tada.se Mon Oct 11 18:09:44 2010 From: thomas at tada.se (Thomas Hallgren) Date: Mon, 11 Oct 2010 20:09:44 +0200 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 29th of October with Java 6 & PostgreSQL 8.4 and 9.0 In-Reply-To: References: Message-ID: <4CB352E8.8090700@tada.se> On 10/11/2010 06:58 PM, Johann 'Myrkraverk' Oskarsson wrote: > On Mon, Oct 11, 2010 at 3:48 AM, Kris Jurka wrote: > >> >> On Fri, 8 Oct 2010, Johann 'Myrkraverk' Oskarsson wrote: >> >> >>> If there are no compile errors for PostgreSQL 8.4 and 9.0 with and >>> without GCJ, 1.4.1 will be released as source Friday 29th of October >>> 2010 by me. >>> >> I'm not a big fan of continuing new ports with retained compatibility for Java 5/GCJ. Seems to me it's a lot of work for no return. Who needs that? Why can't they just shift to Java 6 or stay put with an older version of PL/Java? Or, if they really need a Java 5 port, compile it themselves? >> I think a release that changes support from JDBC3 -> JDBC4 should be a major >> release (that is 1.5), not 1.4.1 which seems like a minor change. Someone >> running a server that uses a 1.4 or 1.5 JVM will be taken by surprise if >> they try upgrading from 1.4 to 1.4.1. >> > I am mostly adding new interfaces and rarely change existing code. An > exception would be something like todays commit. > > I am using > JAVAC := javac -source 1.6 -target 1.6 > in src/java/Makefile.global and it fails to compile with Java 5 and 4. > I intend to commit this change when it compiles with Java 6. > > Binaries should therefore be clearly marked Java 6, such as having > java6 in their name. > > If we are changing API, then we should bump the major version. I.e. breaking current API means go to 2.0.0 If we are making new additions in functionality while retaining backward compatibility, then bump minor, i.e. 1.5.0 Bumping the bugfix (or micro) number limits the addition to mere bugfixes. IMO, changing from JDBC 3 to 4 is indeed a breaking API change and calls for a new major version of PL/Java, so when that happens, we must go to 2.0.0, not 1.5.0. Adding interfaces while still retaining backward compatibility sounds like a minor version bump, i.e. 1.5.0. What I've said so far only relates to the actual version of the PL/Java source. Naming the various pre-compiled binaries is separate from that. I think that whatever is mainstream (i.e. Java >= 1.6) should typically not have the java version included in the name. Special ports for 1.5 or GCJ etc. should be the ones that get tagged. I think the term 'gnu' in the name is somewhat redundant. Perhaps we can use names like: pljava-1.5.0-pg8.4-linux-x86_64.tar.gz pljava-1.5.0-pg8.4-linux-x86.tar.gz pljava-1.5.0-pg8.4-windows-x86.tar.gz pljava-1.5.0-pg8.4-windows-x86-gcj5.tar.gz pljava-2.0.0-pg9.0-linux-x86_64.tar.gz ... I made an attempt to put things in order of importance to make it easier to read. Regards, Thomas Hallgren From jcllario at hotmail.com Wed Oct 13 10:25:22 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Wed, 13 Oct 2010 12:25:22 +0200 Subject: [Pljava-dev] congratulations about the next release Message-ID: I want to say thanks and congratulations to the people who have developed pljava and who is developing lately pljava and planning a new release.I think pljava is used by many projects and to improve it was a really need. Thanks to all of you. By the way, I want to ask if the patch which Luca Ferrari sent about canceling trigger operations are going to be included in the next release. Well done and keep going. Best, Jose From johann at myrkraverk.com Wed Oct 13 11:45:14 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 13 Oct 2010 11:45:14 +0000 Subject: [Pljava-dev] congratulations about the next release In-Reply-To: References: Message-ID: Dear Jose, On Wed, Oct 13, 2010 at 10:25 AM, JOSE CARLOS MARTINEZ LLARIO wrote: > > I want to say thanks and congratulations to the people who have developed pljava and who is developing lately pljava and planning a new release.I think pljava is used by many projects and to improve it was a really need. Thank you. > By the way, I want to ask if the patch which Luca Ferrari sent about canceling trigger operations are going to be included in the next release. All I can say is that I will take a look at any outstanding issues/patches once it compiles and runs on Java 6. Johann From johann at myrkraverk.com Wed Oct 13 17:43:38 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 13 Oct 2010 17:43:38 +0000 Subject: [Pljava-dev] 1.4.1 Release Schedule: Friday 29th of October with Java 6 & PostgreSQL 8.4 and 9.0 In-Reply-To: <4CB352E8.8090700@tada.se> References: <4CB352E8.8090700@tada.se> Message-ID: Dear pljava-dev, Just to inform you that even though there was no commit yesterday, the schedule still holds. Johann From jcllario at hotmail.com Fri Nov 5 19:43:18 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Fri, 5 Nov 2010 20:43:18 +0100 Subject: [Pljava-dev] 1.4.1 release Message-ID: Hi,I wanted to ask if there is any news about the 1.4.1 release date. Hope everything is ok about the release.Best,Jose -------------- next part -------------- An HTML attachment was scrubbed... URL: From johann at myrkraverk.com Fri Nov 5 19:56:01 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 5 Nov 2010 19:56:01 +0000 Subject: [Pljava-dev] 1.4.1 release In-Reply-To: References: Message-ID: On Fri, Nov 5, 2010 at 7:43 PM, JOSE CARLOS MARTINEZ LLARIO wrote: > Hi, > I wanted to ask if there is any news about the 1.4.1 release date. Hope > everything is ok about the release. Real life has interfered and I was unable to keep to the schedule. Hopefully I can make a new one after this weekend. Johann From nathanegge at yahoo.com Thu Nov 11 16:37:51 2010 From: nathanegge at yahoo.com (Nathan Egge) Date: Thu, 11 Nov 2010 08:37:51 -0800 (PST) Subject: [Pljava-dev] build broken in CVS Message-ID: <458889.95614.qm@web35708.mail.mud.yahoo.com> Is it just me, or is the build broken in CVS? ?I don't know why the -source and -target are set to 1.4 when we were moving everything to 1.6 and JDBC4. ?Is there some configuration I need to fix to get this building? nathan at neso ~/cvs/org.postgresql.pljava $ makemake[1]: Entering directory `/home/nathan/cvs/org.postgresql.pljava/build/classes/pljava'javac -source 1.4 -target 1.4 -d . /home/nathan/cvs/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIStatement.java:422: generics are not supported in -source 1.4(use -source 5 or higher to enable generics)?? ? ? ?public boolean isWrapperFor(Class iface)?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^/home/nathan/cvs/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/SPIConnection.java:943: generics are not supported in -source 1.4(use -source 5 or higher to enable generics)?? ? ? ?public boolean isWrapperFor(Class iface)?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^/home/nathan/cvs/org.postgresql.pljava/src/java/pljava/org/postgresql/pljava/jdbc/AbstractResultSet.java:690: generics are not supported in -source 1.4(use -source 5 or higher to enable generics)?? ? ? ?public boolean isWrapperFor(Class iface)?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^3 errorsmake[1]: *** [.timestamp] Error 1make[1]: Leaving directory `/home/nathan/cvs/org.postgresql.pljava/build/classes/pljava'make: *** [pljava_all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From books at ejurka.com Thu Nov 11 18:03:19 2010 From: books at ejurka.com (Kris Jurka) Date: Thu, 11 Nov 2010 13:03:19 -0500 (EST) Subject: [Pljava-dev] build broken in CVS In-Reply-To: <458889.95614.qm@web35708.mail.mud.yahoo.com> References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: On Thu, 11 Nov 2010, Nathan Egge wrote: > Is it just me, or is the build broken in CVS? ?I don't know why the -source > and -target are set to 1.4 when we were moving everything to 1.6 and JDBC4. > ?Is there some configuration I need to fix to get this building? CVS is pretty busted at the moment. You can edit src/java/Makefile.global to get rid of the -source and -target options, but it still won't build. Apparently the approach taken to getting pljava to JDBC4 has been to fix a file at a time. This is a poor approach because the time between the first file change and the last one means that it can't be built with either a new or old JDK. This switch really needs to happen in a single commit, not over the course of many. I'll let Johann comment, but perhaps it would be best to revert until full support is available. Kris Jurka From johann at myrkraverk.com Thu Nov 11 20:08:42 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Thu, 11 Nov 2010 20:08:42 +0000 Subject: [Pljava-dev] build broken in CVS In-Reply-To: References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: On Thu, Nov 11, 2010 at 6:03 PM, Kris Jurka wrote: > > > On Thu, 11 Nov 2010, Nathan Egge wrote: > >> Is it just me, or is the build broken in CVS? ?I don't know why the >> -source >> and -target are set to 1.4 when we were moving everything to 1.6 and >> JDBC4. >> ?Is there some configuration I need to fix to get this building? > > CVS is pretty busted at the moment. ?You can edit src/java/Makefile.global > to get rid of the -source and -target options, but it still won't build. > Apparently the approach taken to getting pljava to JDBC4 has been to fix a > file at a time. ?This is a poor approach because the time between the first > file change and the last one means that it can't be built with either a new > or old JDK. ?This switch really needs to happen in a single commit, not over > the course of many. ?I'll let Johann comment, but perhaps it would be best > to revert until full support is available. Yes, that's my fault. I wasn't thinking, sorry about that. It's probably simplest to revert all files that don't compile with Java 1.4 and 1.5. IIRC they are not that many. If no one has stepped up and done that, I'll try and take a look later this evening. Johann From johann at myrkraverk.com Fri Nov 12 01:35:05 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 12 Nov 2010 01:35:05 +0000 Subject: [Pljava-dev] build broken in CVS In-Reply-To: References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: On Thu, Nov 11, 2010 at 8:08 PM, Johann 'Myrkraverk' Oskarsson wrote: > On Thu, Nov 11, 2010 at 6:03 PM, Kris Jurka wrote: > If no one has stepped up and done that, I'll try and take a look later > this evening. It's too late for me to take a look now. I'll do that in the morning. Johann From johann at myrkraverk.com Sun Nov 14 00:18:58 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sun, 14 Nov 2010 00:18:58 +0000 Subject: [Pljava-dev] build broken in CVS In-Reply-To: References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: Dear pljava members, Sorry about the delay, HEAD should now work as expected and compile with Java 1.4. Please let me know if there are further issues. Enjoy, Johann From johann at myrkraverk.com Sun Nov 14 00:25:18 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sun, 14 Nov 2010 00:25:18 +0000 Subject: [Pljava-dev] build broken in CVS In-Reply-To: References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: On Sun, Nov 14, 2010 at 12:18 AM, Johann 'Myrkraverk' Oskarsson wrote: > Dear pljava members, > > Sorry about the delay, HEAD should now work as expected and compile > with Java 1.4. Furthermore, my Java 6 changes are now in a branch called java6. Johann From fluca1978 at infinito.it Mon Nov 15 15:57:57 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 15 Nov 2010 16:57:57 +0100 Subject: [Pljava-dev] build broken in CVS In-Reply-To: References: <458889.95614.qm@web35708.mail.mud.yahoo.com> Message-ID: <201011151657.57662.fluca1978@infinito.it> On Sunday, November 14, 2010 01:25:18 am Johann 'Myrkraverk' Oskarsson's cat walking on the keyboard wrote: > Furthermore, my Java 6 changes are now in a branch called java6. Thanks for your efforts. I'm curious if there is a roadmap published, maybe I can find some time to help coding. Luca From johann at myrkraverk.com Mon Nov 15 16:39:46 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Mon, 15 Nov 2010 16:39:46 +0000 Subject: [Pljava-dev] build broken in CVS In-Reply-To: <201011151657.57662.fluca1978@infinito.it> References: <458889.95614.qm@web35708.mail.mud.yahoo.com> <201011151657.57662.fluca1978@infinito.it> Message-ID: On Mon, Nov 15, 2010 at 3:57 PM, Luca Ferrari wrote: > On Sunday, November 14, 2010 01:25:18 am Johann 'Myrkraverk' Oskarsson's cat > walking on the keyboard wrote: > >> Furthermore, my Java 6 changes are now in a branch called java6. > > Thanks for your efforts. > I'm curious if there is a roadmap published, maybe I can find some time to help > coding. At the moment, there isn't one, really. I had a plan that unfortunately didn't work out. I'm still just taking it one file at time to make it compile with Java 6. You can try checking out the java6 tag and see if you can get one file to compile without errors. I'll try to do one today, if I can. Johann From sandeeptt at yahoo.com Thu Nov 18 12:51:49 2010 From: sandeeptt at yahoo.com (Sandeep Thakkar) Date: Thu, 18 Nov 2010 04:51:49 -0800 (PST) Subject: [Pljava-dev] undefined symbol: JNI_CreateJavaVM on installing pljava-1.3.0 on Postgresql8.3 Message-ID: <110419.41270.qm@web52008.mail.re2.yahoo.com> On Linux64 bit, when we try to load pljava.so, we get " undefined symbol: JNI_CreateJavaVM" error. This happens when we use PG8.3. We built pljava-1.3.0 from sources. Against PG8.4, the error goes away when we set /lib/amd64/server path to LD_LIBRARY_PATH, because this symbol is defined in libjvm.so. We built pljava-1.4.0 from sources. Is this a bug with pljava-1.3.0? Or something to do with PG8.3?? Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From johann at myrkraverk.com Thu Nov 18 14:29:54 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Thu, 18 Nov 2010 14:29:54 +0000 Subject: [Pljava-dev] undefined symbol: JNI_CreateJavaVM on installing pljava-1.3.0 on Postgresql8.3 In-Reply-To: <110419.41270.qm@web52008.mail.re2.yahoo.com> References: <110419.41270.qm@web52008.mail.re2.yahoo.com> Message-ID: On Thu, Nov 18, 2010 at 12:51 PM, Sandeep Thakkar wrote: > On Linux64 bit, when we try to load pljava.so, we get? " undefined symbol: > JNI_CreateJavaVM" error. This happens when we use PG8.3. We built > pljava-1.3.0 from sources. > > Against PG8.4, the error goes away when we set /lib/amd64/server > path to LD_LIBRARY_PATH, because this symbol is defined in libjvm.so. We > built pljava-1.4.0 from sources. > > Is this a bug with pljava-1.3.0? Or something to do with PG8.3?? JNI_CerateJavaVM is the function (entry point) that loads and creates the java virtual machine pljava uses. Pljava has to find it somewhere. That is why the (my) Postgres server is configured to have the location of libjvm.so somewehre in its LD_LIBRARY_PATH when you install pljava. When you say Linux 64 bit, I presume you mean the Postgres server, pljava and the virtual machine are built for amd64? For my server the environment is: JAVA_HOME = '/usr/lib/jvm/java-6-openjdk/jre' LD_LIBRARY_PATH = '/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386/native_threads' For amd64 binaries you will have to replace i386 with amd64. Hope this helps, Johann From sandeeptt at yahoo.com Fri Nov 19 06:31:07 2010 From: sandeeptt at yahoo.com (Sandeep Thakkar) Date: Thu, 18 Nov 2010 22:31:07 -0800 (PST) Subject: [Pljava-dev] undefined symbol: JNI_CreateJavaVM on installing pljava-1.3.0 on Postgresql8.3 In-Reply-To: References: <110419.41270.qm@web52008.mail.re2.yahoo.com> Message-ID: <381319.70885.qm@web52006.mail.re2.yahoo.com> Yes everything is built for amd64. My environment settings are: JAVA_HOME=/jre LD_LIBRARY_PATH=/jre/lib/amd64:/jre/lib/amd64/native_threads:/jre/lib/amd64/server:$LD_LIBRARY_PATH then I restart the dbserver and I install pljava. and I get the same error. another interesting thing is that 'ldd pljava.so' does not show the dependency on libjvm.so. $ ldd lib/pljava.so libc.so.6 => /lib64/libc.so.6 (0x00002ac7d831d000) /lib64/ld-linux-x86-64.so.2 (0x0000003b7f800000) ________________________________ From: Johann 'Myrkraverk' Oskarsson To: pljava-dev at pgfoundry.org Sent: Thu, November 18, 2010 7:59:54 PM Subject: Re: [Pljava-dev] undefined symbol: JNI_CreateJavaVM on installing pljava-1.3.0 on Postgresql8.3 On Thu, Nov 18, 2010 at 12:51 PM, Sandeep Thakkar wrote: > On Linux64 bit, when we try to load pljava.so, we get " undefined symbol: > JNI_CreateJavaVM" error. This happens when we use PG8.3. We built > pljava-1.3.0 from sources. > > Against PG8.4, the error goes away when we set /lib/amd64/server > path to LD_LIBRARY_PATH, because this symbol is defined in libjvm.so. We > built pljava-1.4.0 from sources. > > Is this a bug with pljava-1.3.0? Or something to do with PG8.3?? JNI_CerateJavaVM is the function (entry point) that loads and creates the java virtual machine pljava uses. Pljava has to find it somewhere. That is why the (my) Postgres server is configured to have the location of libjvm.so somewehre in its LD_LIBRARY_PATH when you install pljava. When you say Linux 64 bit, I presume you mean the Postgres server, pljava and the virtual machine are built for amd64? For my server the environment is: JAVA_HOME = '/usr/lib/jvm/java-6-openjdk/jre' LD_LIBRARY_PATH = '/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386/native_threads' For amd64 binaries you will have to replace i386 with amd64. Hope this helps, Johann _______________________________________________ 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 johann at myrkraverk.com Fri Nov 19 12:15:07 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 19 Nov 2010 12:15:07 +0000 Subject: [Pljava-dev] undefined symbol: JNI_CreateJavaVM on installing pljava-1.3.0 on Postgresql8.3 In-Reply-To: <381319.70885.qm@web52006.mail.re2.yahoo.com> References: <110419.41270.qm@web52008.mail.re2.yahoo.com> <381319.70885.qm@web52006.mail.re2.yahoo.com> Message-ID: Hi, On Fri, Nov 19, 2010 at 6:31 AM, Sandeep Thakkar wrote: > My environment settings are: > JAVA_HOME=/jre > LD_LIBRARY_PATH=/jre/lib/amd64:/jre/lib/amd64/native_threads:/jre/lib/amd64/server:$LD_LIBRARY_PATH > > then I restart the dbserver and I install pljava. and I get the same error. Just because your environment settings include the right LD_LIBRARY_PATH does not mean the server's does. In ubuntu (my setup) I have to put the variables in /etc/postgresql/8.4/main/environment. You can also try to build pljava.so with the paths built-in by using the -rpath flag. Again, I'm a bit hazy on how to do it but I think you can just add LDFLAGS='-rpath /jre/lib/amd64 -rpath /jre/lib/amd64/native_threads -rpath /jre/lib/amd64/server' before invoking ./configure? This assumes GCC. With the sunstudio compiler use -R instead. > another interesting thing is that 'ldd pljava.so' does not show the > dependency on libjvm.so. > $ ldd lib/pljava.so > ??? libc.so.6 => /lib64/libc.so.6 (0x00002ac7d831d000) > ??? /lib64/ld-linux-x86-64.so.2 (0x0000003b7f800000) That just means the virtual machine is loaded with dlopen(). The last time I did this in my own code, I was using OpenVMS so I'm a bit hazy on the Unix details. Johann From chantanand at gmail.com Fri Dec 3 11:50:21 2010 From: chantanand at gmail.com (Chantralekha Anandh kumar) Date: Fri, 3 Dec 2010 17:20:21 +0530 Subject: [Pljava-dev] Java VM stalls during "install_jar" Message-ID: Hi, I am trying to write back end function in postgresql DB using pljava. Please refer all the s/w components details below (all are built for 64-bit platform): 1. OS - FreeBSD lab-stor-01.xambala.local 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 2. JDK -1.5.0_16-p9 (Downloaded JDK source version 1.5.0 update 16, applied patch-9.0 through FreeBSD ports and got it built) 3. pljava - 1.4 (Download sources from pg_foundry CVS using V1_4_0 tag and patched "org.postgresql.pljava/src/C" with latest version for postgresql 8.4 support and got it built) 4. postgresql - 8.4.5 I could install the pljava language in postgress DB through "install.sql" script through "psql" client. When i try to install jar, "psql" got hangs and it didnot respond to Ctrl + C. From postgress DB log, i have found that program got stall during JVM create at location mentioned below:- initializeJavaVM, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Back end.c:675 Any help on this issue would be greatly appreciated! Thanks in advance! PS: Before moving to FreeBSD OS, i have tested the same in UBUNTU OS (2.6.31- 14-server #48-Ubuntu SMP). I could install jar, could create pljava function and execute through "psql".) -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Gradwell at vocalink.com Sun Dec 5 12:11:22 2010 From: David.Gradwell at vocalink.com (David.Gradwell at vocalink.com) Date: Sun, 5 Dec 2010 12:11:22 -0000 Subject: [Pljava-dev] Status of pljava with postgresql 9.0 and offer to test Message-ID: <032d01cb9475$88522380$98f66a80$@vocalink.com> Hi, Would it be possible to summarise the status of pljava with Postgresql 9.0 ? I have test rigs for Postgresql 9.0 on: a) Ubuntu 9.10 (Karmic Koala) b) Windows 7 on 64 bit c) Windows 7 on 32 bit d) Windows 2003 Server I would be happy to test on all of these and publish results. Could you point me to the latest build and I will have a go. All recent instructions welcome (I've looked at the wiki and http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pljava/org.postgresql.pljava/ ) Regards David JL Gradwell, M.A. (Cantab), F.B.C.S. Chartered Information Systems Practitioner Managing Director Gradwell Business Solutions Limited 16, Tekels Avenue, Camberley, Surrey, GU15 2LB Tel: 01276-81-81-81 Mobile: 07920-143-639 Fax: 01276-300-106 Email: david at gradwell.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chantanand at gmail.com Mon Dec 6 05:58:13 2010 From: chantanand at gmail.com (Anantha) Date: Sun, 5 Dec 2010 21:58:13 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: References: Message-ID: <1291615093757-3293612.post@n5.nabble.com> >>> PS: >>> Before moving to FreeBSD OS, i have tested the same in UBUNTU OS >>> (2.6.31- >>> 14-server #48-Ubuntu SMP). I could install jar, could create pljava >>> function >>> and execute through "psql".) One more additional information is, in UBUNTU testing i have used JDK pre-built release from Oracle jun Java website. Whereas in FreeBSD, i find diablo-jdk1.5 amd64 pre-built package did not work (in libjvm.so has reference to "pthread_create" function, but "ldd" showed no dependancy libpthread.so library). Due to this pljava install failed. So i have download jdk sources using FreeBSD ports and built JDK1.5. In this version, i could install pljava, but install_jar fails. I am blocked due to this bug. Any help on this issue is grealy appreciated! Thanks again! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3293612.html Sent from the PL/Java mailing list archive at Nabble.com. From chantanand at gmail.com Mon Dec 6 06:22:05 2010 From: chantanand at gmail.com (Chantralekha Anandh kumar) Date: Mon, 6 Dec 2010 11:52:05 +0530 Subject: [Pljava-dev] pljava 1.5 release Message-ID: Hi, We are looking for using pljava for writing backend function with JDK-1.6 and Postgresql 8.4.5. Can you please update on release status of pljava-1.5? Thanks in advance! Regards, Anandha kumar -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Gradwell at vocalink.com Mon Dec 6 09:59:58 2010 From: David.Gradwell at vocalink.com (David Gradwell) Date: Mon, 6 Dec 2010 09:59:58 +0000 Subject: [Pljava-dev] Status of pljava with postgresql 9.0 and offer to test Message-ID: Hi, Would it be possible to summarise the status of pljava with Postgresql 9.0 ? I have test rigs for Postgresql 9.0 on: a) Ubuntu 10.10 b) Windows 7 on 64 bit c) Windows 7 on 32 bit d) Windows 2003 Server I would be happy to test pljava on all of these and publish results. Could you point me to the latest build and I will have a go. All recent instructions welcome (I've looked at the wiki and http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pljava/org.postgresql.pljava/ ) Regards David JL Gradwell, M.A. (Cantab), F.B.C.S. Chartered IT Professional Head of Consulting VocaLink t: +44 (0)870 920 8516 m:+44 (0)7920 143 639 e: david.gradwell at vocalink.com w: http://www.vocalink.com ***************************************************** This email is issued by a VocaLink group company. It is confidential and intended for the exclusive use of the addressee only. You should not disclose its contents to any other person. If you are not the addressee (or responsible for delivery of the message to the addressee), please notify the originator immediately by return message and destroy the original message. The contents of this email will have no contractual effect unless it is otherwise agreed between a specific VocaLink group company and the recipient. The VocaLink group companies include, among others: VocaLink Limited (Company No 06119048, VAT No. 907 9619 87) which is registered in England and Wales at registered office Drake House, Homestead Road, Rickmansworth, WD3 1FX. United Kingdom, Voca Limited (Company no 1023742, VAT No. 907 9619 87) which is registered in England and Wales at registered office Drake House, Three Rivers Court, Homestead Road, Rickmansworth, Hertfordshire. WD3 1FX. United Kingdom, LINK Interchange Network Limited (Company No 3565766, VAT No. 907 9619 87) which is registered in England and Wales at registered office Arundel House, 1 Liverpool Gardens, Worthing, West Sussex, BN11 1SL and VocaLink Holdings Limited (Company No 06119036, VAT No. 907 9619 87) which is registered in England and Wales at registered office Drake House, Homestead Road, Rickmansworth, WD3 1FX. United Kingdom. The views and opinions expressed in this email may not reflect those of any member of the VocaLink group. This message and any attachments have been scanned for viruses prior to leaving the VocaLink group network; however, VocaLink does not guarantee the security of this message and will not be responsible for any damages arising as a result of any virus being passed on or arising from any alteration of this message by a third party. The VocaLink group may monitor emails sent to and from the VocaLink group network. This message has been checked for all email viruses by MessageLabs. ************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From johann at myrkraverk.com Tue Dec 7 10:16:25 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 7 Dec 2010 10:16:25 +0000 Subject: [Pljava-dev] Status of pljava with postgresql 9.0 and offer to test In-Reply-To: References: Message-ID: On Mon, Dec 6, 2010 at 9:59 AM, David Gradwell wrote: > Hi, > > > > Would it be possible to summarise the status of pljava with Postgresql 9.0 ? The summary is very simple: Current CVS head compiles and works with Postgres 9. I am currently testing/using it on Solaris amd64. Building it yourself is very simple. Point JAVA_HOME to some 1.4 or 1.5 JDK you can use to compile it and have pg_config in your path. Then run gnu make. Writing this in a hurry, Johann From johann at myrkraverk.com Tue Dec 7 10:18:49 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 7 Dec 2010 10:18:49 +0000 Subject: [Pljava-dev] pljava 1.5 release In-Reply-To: References: Message-ID: Hi, On Mon, Dec 6, 2010 at 6:22 AM, Chantralekha Anandh kumar wrote: > Hi, > > We are looking for using pljava for writing backend function with JDK-1.6 > and Postgresql 8.4.5. Can you please update on release status of pljava-1.5? > Thanks in advance! With luck, a pljava release with java 6 support will be available somewhere close to next weekend (before or after I can't say). Please note "with luck." I'll try to keep this list posted. Johann From johann at myrkraverk.com Tue Dec 7 10:20:47 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 7 Dec 2010 10:20:47 +0000 Subject: [Pljava-dev] Java VM stalls during In-Reply-To: <1291615093757-3293612.post@n5.nabble.com> References: <1291615093757-3293612.post@n5.nabble.com> Message-ID: Hi, On Mon, Dec 6, 2010 at 5:58 AM, Anantha wrote: > >>>> PS: > >>>> ? ? ?Before moving to FreeBSD OS, i have tested the same in UBUNTU OS >>>> (2.6.31- > >>>> ?14-server #48-Ubuntu SMP). I could install jar, could create pljava >>>> function > >>>> and execute through "psql".) > > One more additional information is, in UBUNTU testing i have used JDK > pre-built release from Oracle jun Java website. Whereas in FreeBSD, i find > diablo-jdk1.5 amd64 pre-built package did not ?work (in libjvm.so has > reference to "pthread_create" function, but "ldd" showed no dependancy > libpthread.so library). Due to this pljava install failed. So i have > download jdk sources using FreeBSD ports and built JDK1.5. In this version, > i could install pljava, but install_jar fails. > I am blocked due to this bug. Any help on this issue is grealy appreciated! Please provide all relevant errors from the log, if any. Does CREATE FUNCTION getsysprop(VARCHAR) RETURNS VARCHAR AS 'java.lang.System.getProperty' LANGUAGE java; SELECT getsysprop('user.home'); work? Johann From chantanand at gmail.com Wed Dec 8 04:52:22 2010 From: chantanand at gmail.com (Anantha) Date: Tue, 7 Dec 2010 20:52:22 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: References: <1291615093757-3293612.post@n5.nabble.com> Message-ID: <1291783942566-3296921.post@n5.nabble.com> >>> Please provide all relevant errors from the log, if any -------------------------------------------------- DEBUG: 00000: find_in_dynamic_libpath: trying "/usr/local/pljava/lib/pljava.so" LOCATION: find_in_dynamic_libpath, dfmgr.c:642 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Using integer_datetimes LOCATION: checkIntTimeType, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:543 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Added JVM option string "-XX:+UseAltSigs" LOCATION: JVMOptList_add, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Added JVM option string "-Djava.class.path=/usr/local/pljava/pljava.jar" LOCATION: JVMOptList_add, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Added JVM option string "-Dsqlj.defaultconnection=jdbc:default:connection" LOCATION: JVMOptList_add, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Added JVM option string "vfprintf" LOCATION: JVMOptList_add, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Added JVM option string "-Xrs" LOCATION: JVMOptList_add, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: Creating JavaVM LOCATION: initializeJavaVM, /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:675 STATEMENT: select sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; DEBUG: 00000: my backend id is 5 LOCATION: SharedInvalBackendInit, sinvaladt.c:316 DEBUG: 00000: StartTransaction -------------------------------------------------- >>> CREATE FUNCTION getsysprop(VARCHAR) >>> RETURNS VARCHAR >>> AS 'java.lang.System.getProperty' >>> LANGUAGE java; I could create function. >>> SELECT getsysprop('user.home'); >>> work? No it did not work. When i send SELECT query, "psql" hangs. Please refer below: ----------------------------------------- =# SELECT getsysprop('user.home'); ^CCancel request sent ^CCancel request sent -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3296921.html Sent from the PL/Java mailing list archive at Nabble.com. From johann at myrkraverk.com Wed Dec 8 17:04:53 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 8 Dec 2010 17:04:53 +0000 Subject: [Pljava-dev] New bugfixes, a time for a minor release? Message-ID: Hi, For those of you who have not noticed: I've recently committed bugfixes for 1010712 and 1010189. Mostly because of the former I believe it is time for a bugfix release. What else has changed in current CVS from 1.4.0 apart from building with 8.4 and 9.0? Johann From talha.rizwan at enterprisedb.com Thu Dec 9 09:01:16 2010 From: talha.rizwan at enterprisedb.com (Talha Rizwan) Date: Thu, 9 Dec 2010 14:01:16 +0500 Subject: [Pljava-dev] Building Pljava with PostgreSQL 9.0 Message-ID: I was able to build Pljava with PostgreSQL 9.0 after some modifications. Please find attached patch "pljava.patch" to fix Pljava build issue with PostgreSQL 9.0 -- regards talha bin rizwan -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pljava.patch Type: application/octet-stream Size: 3627 bytes Desc: not available URL: From johann at myrkraverk.com Thu Dec 9 13:01:54 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Thu, 9 Dec 2010 13:01:54 +0000 Subject: [Pljava-dev] Release 1.4.1: Bugfixes, no Java 6 support. Message-ID: Hi all, I've released 1.4.1. See the release notes for the bugs fixed. There is no Java 6 support just yet. Johann From chantanand at gmail.com Fri Dec 10 05:32:12 2010 From: chantanand at gmail.com (Anantha) Date: Thu, 9 Dec 2010 21:32:12 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: <1291783942566-3296921.post@n5.nabble.com> References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> Message-ID: <1291959132968-3299847.post@n5.nabble.com> I have tested with pljava-1.4.1 release too, but still same issue (please see the log below). -------------- >>> DEBUG: 00000: Added JVM option string "-Xrs" >>> LOCATION: JVMOptList_add, >>> /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:436 >>> STATEMENT: select >>> sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) ; >>> DEBUG: 00000: Creating JavaVM >>> LOCATION: initializeJavaVM, >>> /usr/local/src/PLJava/org.postgresql.pljava/src/C/pljava/Backend.c:675 >>> STATEMENT: select >>> sqlj.install_jar('file:///data1/home/bakumar/Work/Java/classes/Haribol.jar','test_jar',false) -------------- When i check the code with log, "initializeJavaVM" function makes the call to JNI_createVM which calls "JNI_CreateJavaVM" function and looks like control waits there in loop indefinitely. As "JNI_CreateJavaVM" function is in "libjvm.so", could it be JDK issue? I have followed build procedures stated by FreeBSD ports makefile, compiled and installed JDK-1.5 (64bit version). Would there be any issue in FreeBSD JDK source? We badly need your help on this issue. Thanks in advance! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3299847.html Sent from the PL/Java mailing list archive at Nabble.com. From johann at myrkraverk.com Sat Dec 11 10:50:11 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sat, 11 Dec 2010 10:50:11 +0000 Subject: [Pljava-dev] Blog: Debugging PL/Java Applications with Solaris Studio dbx Message-ID: Hi all, Here is a little blog entry that demonstrates how to use dbx to debug PL/Java applications. http://my.opera.com/myrkraverk/blog/2010/12/11/debugging-pl-java-with-dbx This can, of course, also be used to debug the PL/Java code as well. Comments welcome, Johann From johann at myrkraverk.com Sat Dec 11 13:24:08 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sat, 11 Dec 2010 13:24:08 +0000 Subject: [Pljava-dev] Release 1.4.2: More bugfixes, still no Java 6 Message-ID: Hi all, I've released 1.4.2 with the following bugfixes. 1010956 Function returning complex objects with POD arrays cause a segfault 1010953 Segfault when assigning an array to ResultSet column 1010482 Embedded array support in returned complex objects Mostly to get the long outstanding 1010482 out of the way. Johann From yazuna at gmail.com Sun Dec 12 14:51:18 2010 From: yazuna at gmail.com (Krzysztof) Date: Sun, 12 Dec 2010 15:51:18 +0100 Subject: [Pljava-dev] Pljava-dev Digest, Vol 78, Issue 8 In-Reply-To: References: Message-ID: Hello Johann, Big thanks for following this up! This will be great help for us. Do you know by any chance if it's possible to have nested objects (within object) returned from pl/Java? Or arrays of objects as fields in complex object? Best regards, Krzysztof On 12 December 2010 13:00, wrote: > 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. Release 1.4.2: More bugfixes, still no Java 6 > ? ? ?(Johann 'Myrkraverk' Oskarsson) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 11 Dec 2010 13:24:08 +0000 > From: "Johann 'Myrkraverk' Oskarsson" > Subject: [Pljava-dev] Release 1.4.2: More bugfixes, still no Java 6 > To: pljava-dev at pgfoundry.org > Message-ID: > ? ? ? ? > Content-Type: text/plain; charset=ISO-8859-1 > > Hi all, > > I've released 1.4.2 with the following bugfixes. > > 1010956 Function returning complex objects with POD arrays cause a segfault > 1010953 Segfault when assigning an array to ResultSet column > 1010482 Embedded array support in returned complex objects > > Mostly to get the long outstanding 1010482 out of the way. > > > Johann > > > ------------------------------ > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > > End of Pljava-dev Digest, Vol 78, Issue 8 > ***************************************** > From johann at myrkraverk.com Sun Dec 12 15:20:54 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Sun, 12 Dec 2010 15:20:54 +0000 Subject: [Pljava-dev] Returning complex complex objects Message-ID: Hi Krzysztof, On Sun, Dec 12, 2010 at 2:51 PM, Krzysztof wrote: > Big thanks for following this up! This will be great help for us. You're welcome. > Do you know by any chance if it's possible to have nested objects > (within object) returned from pl/Java? Or arrays of objects as fields > in complex object? It is best to have concrete examples when answering these types of questions. Could you provide CREATE TYPE examples of what you have in mind. Preferably even with demonstrative functions in SQL that return said types. Johann From fluca1978 at infinito.it Mon Dec 13 07:34:12 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 13 Dec 2010 08:34:12 +0100 Subject: [Pljava-dev] pljava @ itpug (italy) 2010 Message-ID: <201012130834.13591.fluca1978@infinito.it> Hi all, during the 2010 edition of the Italian PGDay (www.pgday.it) I gave a brief tutorial to PL/Java that reached a good success and interest. So, first of all, thank you all PL/Java developers for this great piece of code. Now a question that arise was if PL/Java is able to handle a distributed transaction, let say from an application server, and to "forward" back information about such transaction to the currently running backend. In my opinion this is not possible, or at least it is all on the developer's shoulder that have to deal with such details. However, I'd like to have comments from other users. Thanks, Luca From johann at myrkraverk.com Mon Dec 13 12:57:48 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Mon, 13 Dec 2010 12:57:48 +0000 Subject: [Pljava-dev] pljava @ itpug (italy) 2010 In-Reply-To: <201012130834.13591.fluca1978@infinito.it> References: <201012130834.13591.fluca1978@infinito.it> Message-ID: Hi Luca, On Mon, Dec 13, 2010 at 7:34 AM, Luca Ferrari wrote: > Hi all, > during the 2010 edition of the Italian PGDay (www.pgday.it) I gave a brief > tutorial to PL/Java that reached a good success and interest. So, first of all, > thank you all PL/Java developers for this great piece of code. You're welcome. > Now a question that arise was if PL/Java is able to handle a distributed > transaction, let say from an application server, and to "forward" back > information about such transaction to the currently running backend. In my > opinion this is not possible, or at least it is all on the developer's > shoulder that have to deal with such details. However, I'd like to have > comments from other users. Could you clarify a little, I'm not following. PL/Java runs in the backend already. Johann From fluca1978 at infinito.it Mon Dec 13 13:37:12 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 13 Dec 2010 14:37:12 +0100 Subject: [Pljava-dev] pljava @ itpug (italy) 2010 In-Reply-To: References: <201012130834.13591.fluca1978@infinito.it> Message-ID: <201012131437.12442.fluca1978@infinito.it> On Monday, December 13, 2010 01:57:48 pm Johann 'Myrkraverk' Oskarsson's cat walking on the keyboard wrote: > Could you clarify a little, I'm not following. PL/Java runs in the > backend already. > Let say pl7java is executing in a transaction scope on the postgresql server, and connects/starts a distributed transaction on another application server. Such transaction is totally managed by the pl/java process, but the backend does not see it at all, right? Is there a way to make the distributed transaction started from pl/java available on the backed? So if the former aborts the second does too. My quick answer is no, but I ask to be sure. Thanks, Luca From thomas at tada.se Mon Dec 13 14:26:42 2010 From: thomas at tada.se (Thomas Hallgren) Date: Mon, 13 Dec 2010 15:26:42 +0100 Subject: [Pljava-dev] pljava @ itpug (italy) 2010 In-Reply-To: <201012131437.12442.fluca1978@infinito.it> References: <201012130834.13591.fluca1978@infinito.it> <201012131437.12442.fluca1978@infinito.it> Message-ID: <4D062D22.8090409@tada.se> Hi Luca, Wouldn't it be better to manage distributed transactions in the middle tier on top of it all? After all, you are already *in* a transaction when you execute your PL/Java code and that's a transaction that you cannot connect other resources to. When writing PL/Java, I did not intend for distributed transactions to be orchestrated from within it for sure. That's not a recommended use-case. In fact, I would strongly advice against it. Regards, Thomas Hallgren On 2010-12-13 14:37, Luca Ferrari wrote: > On Monday, December 13, 2010 01:57:48 pm Johann 'Myrkraverk' Oskarsson's cat > walking on the keyboard wrote: > >> Could you clarify a little, I'm not following. PL/Java runs in the >> backend already. >> > > Let say pl7java is executing in a transaction scope on the postgresql server, > and connects/starts a distributed transaction on another application server. > Such transaction is totally managed by the pl/java process, but the backend > does not see it at all, right? Is there a way to make the distributed > transaction started from pl/java available on the backed? So if the former > aborts the second does too. My quick answer is no, but I ask to be sure. > > Thanks, > Luca > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev From fluca1978 at infinito.it Mon Dec 13 14:59:00 2010 From: fluca1978 at infinito.it (Luca Ferrari) Date: Mon, 13 Dec 2010 15:59:00 +0100 Subject: [Pljava-dev] pljava @ itpug (italy) 2010 In-Reply-To: <4D062D22.8090409@tada.se> References: <201012130834.13591.fluca1978@infinito.it> <201012131437.12442.fluca1978@infinito.it> <4D062D22.8090409@tada.se> Message-ID: <201012131559.00982.fluca1978@infinito.it> On Monday, December 13, 2010 03:26:42 pm Thomas Hallgren's cat walking on the keyboard wrote: > Hi Luca, > > Wouldn't it be better to manage distributed transactions in the middle tier > on top of it all? After all, you are already *in* a transaction when you > execute your PL/Java code and that's a transaction that you cannot connect > other resources to. > > When writing PL/Java, I did not intend for distributed transactions to be > orchestrated from within it for sure. That's not a recommended use-case. > In fact, I would strongly advice against it. So did I! And this is what I answered, but I was curious to know if it was correct at all. Thanks, Luca From yazuna at gmail.com Mon Dec 13 16:45:18 2010 From: yazuna at gmail.com (Krzysztof) Date: Mon, 13 Dec 2010 17:45:18 +0100 Subject: [Pljava-dev] Returning complex complex objects In-Reply-To: References: Message-ID: Hello Johann, Certainly, the example of functionality is listed below - I was away from any Postgres console at the time of writing and I rather meant passing complex object to plJava, not getting from: -- nested, complex types handling... create type B as ( b_val float8,b2_val int) create type C as (c1_val float8, c2_val float8); -- create complex, nested type create type complexA as ( b B, c C, a_val int) select ((0.1,1)::B,(0.1,0.2)::C,4)::complexA; -- test the type select array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA) from generate_series (1,10) i; -- is it possible to pass such complex object to java, return type is irrelevant here.. CREATE OR REPLACE FUNCTION public.getA(complexA[]) RETURNS int varying AS 'myNestedComplexObjFunciton1' LANGUAGE 'javau' VOLATILE; -- then to extract all ComlpexA,B,C fields in myNestedComplexObjFunciton at java side? -- or vice versa: from java to SQL: fn () returns setof complexA as ... ? -- would it be similar to _in/_out or _recv/_send functions behaviour? select getA(array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA)) from generate_series (1,10) i; -- or is it possible to pass an object that has arrays of objects inside? is it possible to refer to a ResultSet, with probably nested objects/resultsets?? drop type arrayb; create type ArrB as (barr B[], ab_val int, carr C[]); -- test the type select (array[(0.1,i)::B,(0.2,1+i)::B]::B[] ,i::int ,array[(0.1,10/i)::C,(10/i,i)::C]::c[] )::arrB from generate_series (1,10) i -- and then make even more complex argument... CREATE OR REPLACE FUNCTION public.getArrB(arrB) returns int AS 'myNestedComplexObjFunciton2' LANGUAGE 'javau' VOLATILE; -- so the call would liook like: select getArrB((array[(0.1,i)::B,(0.2,1+i)::B]::B[] ,i::int ,array[(0.1,10/i)::C,(10/i,i)::C]::c[] )::arrB) from generate_series (1,10) i ----- -- or even more convoluted example, -- with even more complex argument: -- test the type select array_agg((array[(0.1,i)::B,(0.2,1+i)::B]::B[] ,i::int ,array[(0.1,10/i)::C,(10/i,i)::C]::c[] )::arrB) from generate_series (1,10) i CREATE OR REPLACE FUNCTION public.getArrofArrB(arrayB[]) returns int AS 'myNestedComplexObjFunciton3' LANGUAGE 'javau' VOLATILE; -- so call would liook like: select getArrofArrB(array_agg((array[(0.1,i)::B,(0.2,1+i)::B]::B[] ,i::int ,array[(0.1,10/i)::C,(10/i,i)::C]::c[] )::arrB) ) from generate_series (1,10) i; Best regards, Krzysztof > >> Do you know by any chance if it's possible to have nested objects >> (within object) returned from pl/Java? Or arrays of objects as fields >> in complex object? > > It is best to have concrete examples when answering these types of > questions. ?Could you provide CREATE TYPE examples of what you have in > mind. ?Preferably even with demonstrative functions in SQL that return > said types. > > > Johann > From yazuna at gmail.com Mon Dec 13 16:55:10 2010 From: yazuna at gmail.com (Krzysztof) Date: Mon, 13 Dec 2010 17:55:10 +0100 Subject: [Pljava-dev] Pljava-dev Digest, Vol 78, Issue 9 In-Reply-To: References: Message-ID: Hello Luca, If you mean XA capability which has been available in the standard Postgres JDBC driver - then no, it is not available, i.e. there is no trace of javax.sql.XADataSource interface implementation in plJava. Plus, docs say: The transaction cannot be managed in any way. Thus, you cannot use methods on the connection like: commit() rollback() setAutoCommit() setTransactionIsolation() One would have to have full control over transaction, so also access to PG transactional layer, have a look at: http://jdbc.postgresql.org/development/privateapi/org/postgresql/xa/PGXAConnection.html for what's needed to partake in global transactions. Krzysztof > Date: Mon, 13 Dec 2010 08:34:12 +0100 > From: Luca Ferrari > Subject: [Pljava-dev] pljava @ itpug (italy) 2010 > To: pljava-dev at pgfoundry.org > Message-ID: <201012130834.13591.fluca1978 at infinito.it> > Content-Type: text/plain; ?charset="us-ascii" > > Hi all, > during the 2010 edition of the Italian PGDay (www.pgday.it) I gave a brief > tutorial to PL/Java that reached a good success and interest. So, first of all, > thank you all PL/Java developers for this great piece of code. > > Now a question that arise was if PL/Java is able to handle a distributed > transaction, let say from an application server, and to "forward" back > information about such transaction to the currently running backend. In my > opinion this is not possible, or at least it is all on the developer's > shoulder that have to deal with such details. However, I'd like to have > comments from other users. > > > Thanks, > Luca > > > ------------------------------ > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > > End of Pljava-dev Digest, Vol 78, Issue 9 > ***************************************** > From johann at myrkraverk.com Wed Dec 15 15:42:40 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 15 Dec 2010 15:42:40 +0000 Subject: [Pljava-dev] Returning complex complex objects In-Reply-To: References: Message-ID: Hi Krzysztof, On Mon, Dec 13, 2010 at 4:45 PM, Krzysztof wrote: > Hello Johann, > Certainly, the example of functionality is listed below - I was away > from any Postgres console at the time of writing and I rather meant > passing complex object to plJava, not getting from: > > -- nested, complex types handling... > > create type B as ( b_val float8,b2_val int) > create type C as (c1_val float8, c2_val float8); > > -- create complex, nested type > create type complexA as ( > ? ? ? ?b B, > ? ? ? ?c C, > ? ? ? ?a_val int) Given the types above, public static int complexParam( ResultSet receiver[] ) throws SQLException { for ( int i = 0; i < receiver.length; i++ ) { ResultSet b = (ResultSet)receiver[ i ].getObject( 1 ); double b_val = b.getDouble( 1 ); int b2_val = b.getInt( 2 ); ResultSet c = (ResultSet)receiver[ i ].getObject( 2 ); double c1_val = c.getDouble( 1 ); double c2_val = c.getDouble( 2 ); int a = receiver[ i ].getInt( 3 ); ; } return 0; } will handle the following select statement. > select complexParam(array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA)) ?from > generate_series (1,10) i; However, you'll get quite a few lines of WARNING: TupleDesc reference leak: TupleDesc 124e930 (139827,-1) still referenced Which I'll be working on soon. If you run into convoluted examples where the the template above doesn't get you started just ask again. Johann From johann at myrkraverk.com Wed Dec 15 16:09:01 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Wed, 15 Dec 2010 16:09:01 +0000 Subject: [Pljava-dev] Java VM stalls during In-Reply-To: <1291959132968-3299847.post@n5.nabble.com> References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> Message-ID: Hi, On Fri, Dec 10, 2010 at 5:32 AM, Anantha wrote: > When i check the code with log, ?"initializeJavaVM" function makes the call > to JNI_createVM which calls "JNI_CreateJavaVM" function and looks like > control waits there in loop indefinitely. ?As "JNI_CreateJavaVM" function is > in "libjvm.so", could it be JDK issue? I have followed build procedures > stated by FreeBSD ports makefile, compiled and installed JDK-1.5 (64bit > version). Would there be any issue in FreeBSD JDK source? Unfortunately, I can't run amd64 FreeBSD in VirtualBox since my CPU doesn't have VT-x (or whatever it's called) so I'm flying blind here. I can help further/faster with shell access to amd64 FreeBSD machine. I don't need root, only Postgres 9 sources (maybe not if it's installed) as well as PL/Java and what it takes to build it. Does the following JNI application work? You'll need to adjust the Makefile. And please excuse the cut&paste instead of attachments. Johann # File: Makefile # Adjust these for your system. STUDIO_HOME=/opt/myrkraverk/solstudio12.2 JAVA_HOME=/opt/myrkraverk/jdk1.5.0_22/ # Adjust these for your compiler. # -m64 is for amd64 binaries on Solaris, whether compiled with # Studio or GCC. CC=${STUDIO_HOME}/bin/cc CFLAGS=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -m64 # This may need to be adjusted for non-Solaris platforms. # For GCC you can try -rpath. # Another option is to pass it directly to the linker with -Wl for example. RPATH=-R${JAVA_HOME}/jre/lib/amd64/server # This should not need to be modified JAVAC=${JAVA_HOME}/bin/amd64/javac JAVA=${JAVA_HOME}/bin/amd64/java invoke: invoke.c Prog.class ${CC} -o invoke ${CFLAGS} invoke.c -L${JAVA_HOME}/jre/lib/amd64 \ -R${JAVA_HOME}/jre/lib/amd64 \ -L${JAVA_HOME}/jre/lib/amd64/server ${RPATH} \ -L${JAVA_HOME}/jre/lib/amd64/native_threads -R${JAVA_HOME}/jre/lib/amd64\native_threads \ -ljvm Prog.class: Prog.java ${JAVAC} -g Prog.java # End of File: Makefile // File: Prog.java public class Prog { public static void main(String[] args) { System.out.println("Hello World " + args[0]); } } // End of file: Prog.java /* File: invoke.c */ #include #define PATH_SEPARATOR ':' /* define it to be ';' on Windows */ #define USER_CLASSPATH "." /* where Prog.class is */ int main( int argc, char *argv[] ) { JNIEnv *env; JavaVM *jvm; jint res; jclass cls; jmethodID mid; jstring jstr; jclass stringClass; jobjectArray args; JavaVMInitArgs vm_args; JavaVMOption options[1]; options[0].optionString = "-Djava.class.path=" USER_CLASSPATH; vm_args.version = 0x00010002; vm_args.options = options; vm_args.nOptions = 1; vm_args.ignoreUnrecognized = JNI_TRUE; /* Create the Java VM */ res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); if (res < 0) { fprintf(stderr, "Can't create Java VM\n"); exit(1); } cls = (*env)->FindClass(env, "Prog"); if (cls == NULL) { goto destroy; } mid = (*env)->GetStaticMethodID(env, cls, "main", "([Ljava/lang/String;)V"); if (mid == NULL) { goto destroy; } jstr = (*env)->NewStringUTF(env, " from C!"); if (jstr == NULL) { goto destroy; } stringClass = (*env)->FindClass(env, "java/lang/String"); args = (*env)->NewObjectArray(env, 1, stringClass, jstr); if (args == NULL) { goto destroy; } (*env)->CallStaticVoidMethod(env, cls, mid, args); destroy: if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); } (*jvm)->DestroyJavaVM(jvm); } /* End of file: invoke.c */ From yazuna at gmail.com Thu Dec 16 13:52:40 2010 From: yazuna at gmail.com (Krzysztof) Date: Thu, 16 Dec 2010 14:52:40 +0100 Subject: [Pljava-dev] Returning complex complex objects Message-ID: Hello Johann, That's really good news, especially if this could be made robust! I will think of some ORM code (and maybe JPA plugin) that would create or re-use existing Java classes to be populated by such call. Thanks! Krzysztof Hi Krzysztof, > > On Mon, Dec 13, 2010 at 4:45 PM, Krzysztof wrote: > > Hello Johann, > > Certainly, the example of functionality is listed below - I was away > > from any Postgres console at the time of writing and I rather meant > > passing complex object to plJava, not getting from: > > > > -- nested, complex types handling... > > > > create type B as ( b_val float8,b2_val int) > > create type C as (c1_val float8, c2_val float8); > > > > -- create complex, nested type > > create type complexA as ( > > ? ? ? ?b B, > > ? ? ? ?c C, > > ? ? ? ?a_val int) > > Given the types above, > > public static int complexParam( ResultSet receiver[] ) > throws SQLException > { > for ( int i = 0; i < receiver.length; i++ ) > { > ResultSet b = (ResultSet)receiver[ i ].getObject( 1 ); > double b_val = b.getDouble( 1 ); > int b2_val = b.getInt( 2 ); > > ResultSet c = (ResultSet)receiver[ i ].getObject( 2 ); > double c1_val = c.getDouble( 1 ); > double c2_val = c.getDouble( 2 ); > > int a = receiver[ i ].getInt( 3 ); > ; > } > > return 0; > } > > will handle the following select statement. > > select complexParam(array_agg(((0.1,i)::B,(0.1,10/i)::C,i)::complexA)) > ?from > > generate_series (1,10) i; > > However, you'll get quite a few lines of > WARNING: TupleDesc reference leak: TupleDesc 124e930 (139827,-1) > still referenced > > Which I'll be working on soon. > > If you run into convoluted examples where the the template above > doesn't get you started just ask again. > > > Johann > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chantanand at gmail.com Thu Dec 16 17:05:52 2010 From: chantanand at gmail.com (Anantha) Date: Thu, 16 Dec 2010 09:05:52 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> Message-ID: <1292519152847-3308239.post@n5.nabble.com> >> Does the following JNI application work? You'll need to adjust the >> Makefile. And please excuse the cut&paste instead of attachments. This worked for me. Now, please guide what should i do? Thanks in advance! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3308239.html Sent from the PL/Java mailing list archive at Nabble.com. From johann at myrkraverk.com Fri Dec 17 09:52:06 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 17 Dec 2010 09:52:06 +0000 Subject: [Pljava-dev] Java VM stalls during In-Reply-To: <1292519152847-3308239.post@n5.nabble.com> References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> <1292519152847-3308239.post@n5.nabble.com> Message-ID: Hi Anantha, I've just started to work for 2ndquadrant.com and if you need prompt support you may be able to work out a contract through them. Otherwise/until then I'll help you out as much as I can through email. On Thu, Dec 16, 2010 at 5:05 PM, Anantha wrote: >>> Does the following JNI application work? ?You'll need to adjust the >>> Makefile. ?And please excuse the cut&paste instead of attachments. > This worked for me. Now, please guide what should i do? Thanks in advance! Ok, we then know that 64 bit applications can create virtual machines. You can of course double check that with something like asuka% file invoke invoke: ELF 64-bit LSB executable AMD64 Version 1 [SSE FXSR FPU], dynamically linked, not stripped asuka% ./invoke Hello World from C! When the JNI_CreateJavaVM() stalls/hangs, what does pldd say? You can johann=# SELECT PG_BACKEND_PID(); pg_backend_pid ---------------- 2980 (1 row) and get the pid before you try to run any Java code to feed it to pldd (or BSD equivalent). You may have to do this as the user (id) that runs the server. postgres9 at asuka:~$ pldd 2980 2980: /opt/myrkraverk/postgresql-9.0.1/bin/amd64/postgres /export/home/johann/src/external/pljava-head/build/objs/pljava.so /opt/myrkraverk/jdk1.5.0_22/jre/lib/amd64/server/libjvm.so /opt/myrkraverk/jdk1.5.0_22/jre/lib/amd64/native_threads/libhpi.so /opt/myrkraverk/solstudio12.2/lib/dbx/amd64/runtime/libdbx_agent.so /opt/myrkraverk/jdk1.5.0_22/jre/lib/amd64/libverify.so /opt/myrkraverk/jdk1.5.0_22/jre/lib/amd64/libjava.so /opt/myrkraverk/jdk1.5.0_22/jre/lib/amd64/libzip.so That is, are you linking agains the libjvm you expect to? Note that although in my example above it links to JRE 1.5 it also works to link at run time with JRE 1.6. It is only at compile time you have to use 1.4 or 1.5. Johann From chantanand at gmail.com Fri Dec 17 12:45:40 2010 From: chantanand at gmail.com (Anantha) Date: Fri, 17 Dec 2010 04:45:40 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> <1292519152847-3308239.post@n5.nabble.com> Message-ID: <1292589940842-3309361.post@n5.nabble.com> >>> and get the pid before you try to run any Java code to feed it to pldd (or BSD equivalent). You may have to do this as the user (id) that runs the server. I tried the above, but it didn't work for me (tried as same user of postgres server). Please see log below: postgres=# SELECT PG_BACKEND_PID(); pg_backend_pid ---------------- 74638 (1 row) $ ldd 74638 ldd: 74638: No such file or directory do you see any mistake in the above commands? Do you have any other method to find back end process environment? Please give reply. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3309361.html Sent from the PL/Java mailing list archive at Nabble.com. From johann at myrkraverk.com Fri Dec 17 15:03:45 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Fri, 17 Dec 2010 15:03:45 +0000 Subject: [Pljava-dev] Java VM stalls during In-Reply-To: <1292589940842-3309361.post@n5.nabble.com> References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> <1292519152847-3308239.post@n5.nabble.com> <1292589940842-3309361.post@n5.nabble.com> Message-ID: Hi, On Fri, Dec 17, 2010 at 12:45 PM, Anantha wrote: > > $ ldd 74638 > ldd: 74638: No such file or directory The command is pldd, process ldd. On FreeBSD you may need to do something like lsof -p . And there are possibly other methods. Using lsof you may want to pipe it through grep lib: lsof -p | grep lib Johann From johann at myrkraverk.com Tue Dec 21 00:27:39 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 21 Dec 2010 00:27:39 +0000 Subject: [Pljava-dev] Returning complex complex objects In-Reply-To: References: Message-ID: Hi Krzysztof, >> However, you'll get quite a few lines of >> WARNING: ?TupleDesc reference leak: TupleDesc 124e930 (139827,-1) >> still referenced This is not really anything to worry about. The TupleDescs are freed in a finalizer which will be run "sometime in the future." There is a chance it's using the wrong free function and if so I expect to have that patched before X-mas. I do feel it's a bit "unprofessional" to have such warnings as it gives the impression there may be a bug somewhere. It is possible to keep track of the TupleDesc objecs in a separate data structure and dispose of them when the Java function returns. I can provide a patch for this in the near future if there is any wish for it. Let me know. Johann From jcllario at hotmail.com Tue Dec 21 12:30:37 2010 From: jcllario at hotmail.com (JOSE CARLOS MARTINEZ LLARIO) Date: Tue, 21 Dec 2010 13:30:37 +0100 Subject: [Pljava-dev] Pljava builts In-Reply-To: References: Message-ID: Hi, I think many people are working with pljava and postgres 8.4/9, so they have already built pljava according to their OS and PostgreSQL version. I did that with ubuntu 10.10 and postgres 8.4.5 and opensuse 11.3 and postgres 8.4.4 but I would like to check pljava with 64 bits configurations and Windows too. To built all of them is kind of troublesome and I think its a work which other people have already done. I was wondering if it is possible to upload all these pljava compilations (the ones pljava users already made)? If so, the pljava website would be the right place?...How we can upload the compilations? Or it is better to wait the official builds?..they are comming soon or its not planned? Thanks in advance, Jose From yazuna at gmail.com Tue Dec 21 13:09:25 2010 From: yazuna at gmail.com (Krzysztof) Date: Tue, 21 Dec 2010 14:09:25 +0100 Subject: [Pljava-dev] Returning complex complex objects Message-ID: Hello Johann, True - this could be confusing, especially if there are other, not-related problems popping out, so fixing this would be welcome. When finalizer would be called normally? I do not know Postgres internals well enough but this is related to ResourceOwner existence, which should have similar behaviour to palloc/pfree, correct? Does it mean the tuple is destroyed when the query or transaction ends? or is it GC driven? Krzysztof > Hi Krzysztof, > > >> However, you'll get quite a few lines of > >> WARNING: ?TupleDesc reference leak: TupleDesc 124e930 (139827,-1) > >> still referenced > > This is not really anything to worry about. ?The TupleDescs are freed > in a finalizer which will be run "sometime in the future." ?There is a > chance it's using the wrong free function and if so I expect to have > that patched before X-mas. > > I do feel it's a bit "unprofessional" to have such warnings as it > gives the impression there may be a bug somewhere. ?It is possible to > keep track of the TupleDesc objecs in a separate data structure and > dispose of them when the Java function returns. ?I can provide a patch > for this in the near future if there is any wish for it. ?Let me know. > > > Johann > > > ------------------------------ > > _______________________________________________ > Pljava-dev mailing list > Pljava-dev at pgfoundry.org > http://pgfoundry.org/mailman/listinfo/pljava-dev > > End of Pljava-dev Digest, Vol 78, Issue 14 > ****************************************** From johann at myrkraverk.com Tue Dec 21 15:20:35 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 21 Dec 2010 15:20:35 +0000 Subject: [Pljava-dev] Pljava builts In-Reply-To: References: Message-ID: Hi, On Tue, Dec 21, 2010 at 12:30 PM, JOSE CARLOS MARTINEZ LLARIO wrote: > > I was wondering if it is possible to upload all these pljava compilations (the ones pljava users already made)? If so, the pljava website would be the right place?...How we can upload the compilations? > > Or it is better to wait the official builds?..they are comming soon or its not planned? I'd rather not accept binaries from "strangers" for reasons of security. I do hope to provide them "soon" but cannot at this time say "when." Don't expect anything this year though, I'll review the situation in January. Johann From johann at myrkraverk.com Tue Dec 21 20:17:42 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 21 Dec 2010 20:17:42 +0000 Subject: [Pljava-dev] Returning complex complex objects In-Reply-To: References: Message-ID: Hi Krzysztof, On Tue, Dec 21, 2010 at 1:09 PM, Krzysztof wrote: > Hello Johann, > When finalizer would be called normally? That answer can be a bit complex and I won't go into it here. > I do not know Postgres internals well enough but this is related to > ResourceOwner existence, which should have similar behaviour to > palloc/pfree, correct? If I understand you correctly, yes. > Does it mean the tuple is destroyed when the > query or transaction ends? or is it GC driven? It is supposed to be called by the Java garbage collector. So far I have not found a way to test case it. Johann From trkess at gmail.com Fri Dec 24 00:09:07 2010 From: trkess at gmail.com (Tom Kessler) Date: Thu, 23 Dec 2010 18:09:07 -0600 Subject: [Pljava-dev] NoClassDefFoundError - Postgres Trigger invoking RMI Message-ID: I need help resolving a classloader problem, I've a postgres trigger invoking a PL/Java method making a RMI client call to a server running on the same machine. The method invokes fine from postgres, but crashes: LocateRegistry.getRegistry("127.0.0.1", 1140); java.lang.NoClassDefFoundError: Could not initialize class java.rmi.server.ObjID - Am running Postgresql 8.2.17 on Debian Lenny - postgres built from source at pgconfig= /usr/local/pgsql. - Java version 1.6.0.20 - I have added {jdk-path}/jre/lib:{jdk-path}/jre/lib/i386/client to LB_LIBRARY_PATH, CLASSPATH, PATH system environment vars - JAVA_HOME is defined. - Only one jdk is used. - The RMI server runs fine PL/Java examples run fine. A standalone RMI client class that calls the server runs fine. - Both client and server run fine on Windows SP2 machine. The problem seems exclusively in the RMI client initialization from PL/Java. Any help much appreciated. Tom I created method which should invoke server through RMI. method is invoked fine from postgres, but crashed at LocateRegistry.getRegistry("127.0.0.1", 1140); java.lang.NoClassDefFoundError: Could not initialize class java.rmi.server.ObjID it happened on Debian GNU\Linux 5.0 Standalone RMI test application works fine on this machine with this server. I have added {jdk-path}/jre/lib:{jdk-path}/jre/lib/i386/client to LB_LIBRARY_PATH, CLASSPATH, PATH system environment vars, JAVA_HOME is defined. Only one jdk is used. pl/java tests work fine, so problem is with RMI only. It is interesting, but ObjID.class.getDeclaredMethods()[0].toString() returns right method definition string sucessfully. On Windows XP sp2, all work fine. So code is valid. From chantanand at gmail.com Mon Dec 27 11:58:17 2010 From: chantanand at gmail.com (Anantha) Date: Mon, 27 Dec 2010 03:58:17 -0800 (PST) Subject: [Pljava-dev] Java VM stalls during In-Reply-To: References: <1291615093757-3293612.post@n5.nabble.com> <1291783942566-3296921.post@n5.nabble.com> <1291959132968-3299847.post@n5.nabble.com> <1292519152847-3308239.post@n5.nabble.com> <1292589940842-3309361.post@n5.nabble.com> Message-ID: <1293451097482-3319259.post@n5.nabble.com> >>> On FreeBSD you may need to do >>> something like lsof -p . And there are possibly other methods. >>> Using lsof you may want to pipe it through grep lib: lsof -p | >>> grep lib i don't have "lsof" in system and could not install because of build issue. But, "ldd" shows "pljava.so" uses "/usr/local/lib/libjvm.so" (which is symbolic link to "libjvm.so" of jdk1.5.0). ldd /usr/local/pljava/pljava.so: libjvm.so => /usr/local/lib/libjvm.so (0x800c00000) file /usr/local/lib/libjvm.so /usr/local/lib/libjvm.so: symbolic link to `/usr/local/jdk1.5.0/jre/lib/amd64/server/libjvm.so' I have tested "invoke" binary (simple JNI test given by you already) by linking the same "libjvm.so" and it works. I am not sure why JNI call fail during "install_jar" from "postgres db" client. Please give your guidance. Thanks Ananth -- View this message in context: http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-install-jar-tp3290754p3319259.html Sent from the PL/Java mailing list archive at Nabble.com. From johann at myrkraverk.com Tue Dec 28 15:09:12 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 28 Dec 2010 15:09:12 +0000 Subject: [Pljava-dev] Java 6 update Message-ID: Hi all, For your information the java6 branch now builds. I'll emphasize *builds* since I've not tested it. In particular, not all bugfixes in 1.4.2 have been merged in yet. Be aware that each commit may break compatibility with older code. To play with it you can follow the directions in http://pgfoundry.org/tracker/index.php?func=detail&aid=1010968&group_id=1000038&atid=334 Recapped here: cvs -d :pserver:anonymous at cvs.pgfoundry.org:/cvsroot/pljava login cvs -d :pserver:anonymous at cvs.pgfoundry.org:/cvsroot/pljava checkout -Prjava6 org.postgresql.pljava Enjoy and happy new year, Johann From johann at myrkraverk.com Tue Dec 28 17:06:36 2010 From: johann at myrkraverk.com (Johann 'Myrkraverk' Oskarsson) Date: Tue, 28 Dec 2010 17:06:36 +0000 Subject: [Pljava-dev] Building PL/Java wiki page Message-ID: Hi all, Here is a draft for a document on building PL/Java. http://wiki.tada.se/index.php?title=Building_PL/Java It's quite incomplete and I'll welcome any and all comments. Johann