[Pljava-dev] java.lang.SecurityException

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] java.lang.SecurityException
Date: 2005-03-28 19:09:59
Message-ID: 42485687.4060103@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Joves Luo wrote:

>Thomas Hallgren wrote:
>
>
>
>>
>
>>Ok, that looks good. Still, according to your stacktrace, an attempt is
>
>>made to load the PGtoXML.jar using the system classloader which in turn
>
>>tells me that either your CLASSPATH environment variable or the
>
>>pljava.classpath in the postgresql.conf contains this jar. You should
>
>>remove that setting.
>
>>
>
>>Regards,
>
>>Thomas Hallgren
>
>>
>
>
>
> Thank you, that seemed to do the trick on the securityexception. But
> now I am getting another exception:
>
>
>
> ***Exception:
>
> java.lang.ClassNotFoundException: org.postgresql.Driver
>
Something in your code is asking explicitly for the
org.postgresql.Driver. That driver is the client JDBC driver and should
not be used within PL/Java. If it indeed was found, using it would
result in a remote connection to another backend process that runs in a
separate transaction, most likely in combination with a significant
performance hit.

In order to obtain a connection in PL/Java, you must use:

Connection conn = DriverManager.getConnection("jdbc:default:connection");

The Driver in use here will be the org.postgresql.pljava.jdbc.SPIDriver
but you shouldn't normally need to be concerned with choice of driver.

Regards,
Thomas Hallgren

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Joves Luo 2005-03-28 19:34:04 [Pljava-dev] java.lang.SecurityException
Previous Message Joves Luo 2005-03-28 19:02:23 [Pljava-dev] java.lang.SecurityException