[Pljava-dev] RE: Loading of native libraries in PLJAVA

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] RE: Loading of native libraries in PLJAVA
Date: 2005-03-11 10:14:04
Message-ID: 42316F6C.9040609@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Mohammed

>We have written a insert trigger on network table, when ever
>there is insertion in the table, we are reading a property file and modify
>the values with the inserted data and insert the modified values in another
>table.
>We are unable to read the properties file (which is present in the installed
>jar file at the root as well as at the class file level)
>
>Here is the hierarchy structure, where i have placed properties files
> gis.jar
> gis.properties
> com
> me
> mis
> pgtrigger
>
>PropertiesTrigger
>
>gis.properties
>
>.
>
>Here is the code to access gis.properties file
>
> PropertiesTrigger.java
>
> Properties properties = new Properties
> InputStream is =
>this.getClass().getResourceAsStream("gis.properties");
> SOP ("INPUTSTREAM "+is);
> properties.load(is);
> is.close();
>
> null at SOP for the inputstream.
>
>
Your code looks correct aside from some missing parenthesis :-).

Just to rule out a couple of possibilities, can you load the
"examples.jar" that is bundled with the PL/Java using sqlj.install_jar
and set the classpath for schema 'javatest' to 'samples' and then run:

SELECT * FROM javatest.propertyExample();

You should get 3 rows. If that works then properties and resources work
OK (it does on my installations). If it doesn't, then something is
majorly wrong.

Is it possible that you have an external CLASSPATH setting that in fact
results in another jar then the one being loaded is used? The external
classpath should _only_ appoint pljava.jar.

What versions of PostgreSQL, PL/Java, and JRE are you using?

Regards,
Thomas Hallgren

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Nageshwar Rao 2005-03-11 10:27:57 [Pljava-dev] Subject: Re: Loading of native libraries in PLJAVA
Previous Message Mohammed Mudassir 2005-03-11 07:37:57 [Pljava-dev] RE: Loading of native libraries in PLJAVA