agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feed[Pljava-dev] Cannot find dynamic class
5+ messages / 0 participants
[nested] [flat]
* [Pljava-dev] Cannot find dynamic class
@ 2006-03-25 04:23
2006-03-25 07:51 ` [Pljava-dev] Cannot find dynamic class
0 siblings, 1 reply; 5+ messages in thread
From: @ 2006-03-25 04:23 UTC (permalink / raw)
Hi,
Running pljava 1.1 with postgres 8.0.3.
I have a single jar that contains all my classes. One class
'SocketImpl', is dynamically loaded, however
pljava throws a class not found exception when I try to execute a
function on a class that statically initializes
with 'SocketImpl'. Any tips very appreciated!
Cheers,
Darren
^ permalink raw reply [nested|flat] 5+ messages in thread
* [Pljava-dev] Cannot find dynamic class
2006-03-25 04:23 [Pljava-dev] Cannot find dynamic class
@ 2006-03-25 07:51 `
2006-03-25 17:22 ` [Pljava-dev] Cannot find dynamic class
0 siblings, 1 reply; 5+ messages in thread
From: @ 2006-03-25 07:51 UTC (permalink / raw)
Hi Darren,
What do you mean when you say 'dynamically loaded'? Do you load it using
an explicit ClassLoader.loadClass() call? And that succeeds? Also, when
you say 'statically initializes', you you mean that the class in
question has a static attribute of class SocketImpl, does it extend that
class, or does it use an explicit ClassLoader inside of a static
initializer?
Is it a ClassNotFoundException or a NoClassDefFoundError that you are
experiencing? Can you provide a stack trace?
Regards,
Thomas Hallgren
Darren Govoni wrote:
> Hi,
>
> Running pljava 1.1 with postgres 8.0.3.
>
> I have a single jar that contains all my classes. One class
> 'SocketImpl', is dynamically loaded, however
> pljava throws a class not found exception when I try to execute a
> function on a class that statically initializes
> with 'SocketImpl'. Any tips very appreciated!
>
> Cheers,
> Darren
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* [Pljava-dev] Cannot find dynamic class
2006-03-25 04:23 [Pljava-dev] Cannot find dynamic class
2006-03-25 07:51 ` [Pljava-dev] Cannot find dynamic class
@ 2006-03-25 17:22 `
2006-03-25 20:15 ` [Pljava-dev] Cannot find dynamic class
2006-03-25 20:17 ` [Pljava-dev] Cannot find dynamic class
0 siblings, 2 replies; 5+ messages in thread
From: @ 2006-03-25 17:22 UTC (permalink / raw)
Hi Thomas,
Thanks for responding. :) Here is my stack trace.
INFO: 24 Mar 06 23:06:59 org.postgresql.pljava.sqlj.Loader Failed to
load class
org.postgresql.pljava.internal.ServerException: stack depth
limit exceeded
at
org.postgresql.pljava.internal.ExecutionPlan._cursorOpen(Native Method)
at
org.postgresql.pljava.internal.ExecutionPlan.cursorOpen(ExecutionPlan.java:136)
at
org.postgresql.pljava.jdbc.SPIStatement.executePlan(SPIStatement.java:114)
at
org.postgresql.pljava.jdbc.SPIPreparedStatement.execute(SPIPreparedStatement.java:263)
at
org.postgresql.pljava.jdbc.SPIPreparedStatement.executeQuery(SPIPreparedStatement.java:72)
at
org.postgresql.pljava.sqlj.Loader.findClass(Loader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at
com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
at java.lang.Thread.run(Thread.java:534)
java.lang.NoClassDefFoundError: alt/java/net/SocketImpl
at com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
at java.lang.Thread.run(Thread.java:534)
----------
Here is the code generating it.
Class: SocketConnector.java
....
import alt.java.net.SocketImpl;
.....
public void aconnect(final SocketHandler socketHandler, final
ConnectionModel connectionModel) {
Thread thread = new Thread(new Runnable() {
public void run() {
alt.java.net.Socket socket = null;
try {
ConnectionEvent event = new
ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_STARTING
);
ConnectionEvent vetoEvent = new
ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_VETO
ED);
fireConnectionStarting(event, vetoEvent);
socketHandler.start();
if (connectionModel.isSSL()) {
socket = new
SocketImpl(negotiateSSLConnection(connectionModel));
} else {
--->>> socket = new SocketImpl(new
Socket(connectionModel.getHost(), connectionModel.getPort()));
}
It appears the class in question is indeed in the jar I load.
Thank you!!!
Darren
Thomas Hallgren wrote:
> Hi Darren,
> What do you mean when you say 'dynamically loaded'? Do you load it
> using an explicit ClassLoader.loadClass() call? And that succeeds?
> Also, when you say 'statically initializes', you you mean that the
> class in question has a static attribute of class SocketImpl, does it
> extend that class, or does it use an explicit ClassLoader inside of a
> static initializer?
>
> Is it a ClassNotFoundException or a NoClassDefFoundError that you are
> experiencing? Can you provide a stack trace?
>
> Regards,
> Thomas Hallgren
>
>
> Darren Govoni wrote:
>> Hi,
>>
>> Running pljava 1.1 with postgres 8.0.3.
>>
>> I have a single jar that contains all my classes. One class
>> 'SocketImpl', is dynamically loaded, however
>> pljava throws a class not found exception when I try to execute a
>> function on a class that statically initializes
>> with 'SocketImpl'. Any tips very appreciated!
>>
>> Cheers,
>> Darren
>> _______________________________________________
>> Pljava-dev mailing list
>> Pljava-dev at gborg.postgresql.org
>> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* [Pljava-dev] Cannot find dynamic class
2006-03-25 04:23 [Pljava-dev] Cannot find dynamic class
2006-03-25 07:51 ` [Pljava-dev] Cannot find dynamic class
2006-03-25 17:22 ` [Pljava-dev] Cannot find dynamic class
@ 2006-03-25 20:15 `
1 sibling, 0 replies; 5+ messages in thread
From: @ 2006-03-25 20:15 UTC (permalink / raw)
Hi Darren,
Now I see what's going on. You're using an old version of PL/Java that
had issues when classes where loaded using threads different from the
main thread. The backend doesn't understand the concept of threads at
all so it assumes that a stack overflow has occurred when the thread
(and thus the stack) has changed.
Please upgrade to PL/Java 1.2.0.
Regards,
Thomas Hallgren
Darren Govoni wrote:
> Hi Thomas,
> Thanks for responding. :) Here is my stack trace.
>
> INFO: 24 Mar 06 23:06:59 org.postgresql.pljava.sqlj.Loader Failed to
> load class
> org.postgresql.pljava.internal.ServerException: stack depth
> limit exceeded
> at
> org.postgresql.pljava.internal.ExecutionPlan._cursorOpen(Native Method)
> at
> org.postgresql.pljava.internal.ExecutionPlan.cursorOpen(ExecutionPlan.java:136)
>
> at
> org.postgresql.pljava.jdbc.SPIStatement.executePlan(SPIStatement.java:114)
>
> at
> org.postgresql.pljava.jdbc.SPIPreparedStatement.execute(SPIPreparedStatement.java:263)
>
> at
> org.postgresql.pljava.jdbc.SPIPreparedStatement.executeQuery(SPIPreparedStatement.java:72)
>
> at
> org.postgresql.pljava.sqlj.Loader.findClass(Loader.java:171)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> at
> com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
> at java.lang.Thread.run(Thread.java:534)
>
> java.lang.NoClassDefFoundError: alt/java/net/SocketImpl
> at
> com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
> at java.lang.Thread.run(Thread.java:534)
>
> ----------
>
>
> Here is the code generating it.
>
> Class: SocketConnector.java
>
> ....
> import alt.java.net.SocketImpl;
> .....
>
> public void aconnect(final SocketHandler socketHandler, final
> ConnectionModel connectionModel) {
> Thread thread = new Thread(new Runnable() {
> public void run() {
> alt.java.net.Socket socket = null;
> try {
> ConnectionEvent event = new
> ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_STARTING
> );
> ConnectionEvent vetoEvent = new
> ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_VETO
> ED);
> fireConnectionStarting(event, vetoEvent);
> socketHandler.start();
> if (connectionModel.isSSL()) {
> socket = new
> SocketImpl(negotiateSSLConnection(connectionModel));
> } else {
> --->>> socket = new SocketImpl(new
> Socket(connectionModel.getHost(), connectionModel.getPort()));
> }
>
>
> It appears the class in question is indeed in the jar I load.
>
> Thank you!!!
>
> Darren
>
>
> Thomas Hallgren wrote:
>> Hi Darren,
>> What do you mean when you say 'dynamically loaded'? Do you load it
>> using an explicit ClassLoader.loadClass() call? And that succeeds?
>> Also, when you say 'statically initializes', you you mean that the
>> class in question has a static attribute of class SocketImpl, does it
>> extend that class, or does it use an explicit ClassLoader inside of a
>> static initializer?
>>
>> Is it a ClassNotFoundException or a NoClassDefFoundError that you are
>> experiencing? Can you provide a stack trace?
>>
>> Regards,
>> Thomas Hallgren
>>
>>
>> Darren Govoni wrote:
>>> Hi,
>>>
>>> Running pljava 1.1 with postgres 8.0.3.
>>>
>>> I have a single jar that contains all my classes. One class
>>> 'SocketImpl', is dynamically loaded, however
>>> pljava throws a class not found exception when I try to execute a
>>> function on a class that statically initializes
>>> with 'SocketImpl'. Any tips very appreciated!
>>>
>>> Cheers,
>>> Darren
>>> _______________________________________________
>>> Pljava-dev mailing list
>>> Pljava-dev at gborg.postgresql.org
>>> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>>>
>>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* [Pljava-dev] Cannot find dynamic class
2006-03-25 04:23 [Pljava-dev] Cannot find dynamic class
2006-03-25 07:51 ` [Pljava-dev] Cannot find dynamic class
2006-03-25 17:22 ` [Pljava-dev] Cannot find dynamic class
@ 2006-03-25 20:17 `
1 sibling, 0 replies; 5+ messages in thread
From: @ 2006-03-25 20:17 UTC (permalink / raw)
I forgot. You'll need to use PostgreSQL 8.1 also.
- thomas
Darren Govoni wrote:
> Hi Thomas,
> Thanks for responding. :) Here is my stack trace.
>
> INFO: 24 Mar 06 23:06:59 org.postgresql.pljava.sqlj.Loader Failed to
> load class
> org.postgresql.pljava.internal.ServerException: stack depth
> limit exceeded
> at
> org.postgresql.pljava.internal.ExecutionPlan._cursorOpen(Native Method)
> at
> org.postgresql.pljava.internal.ExecutionPlan.cursorOpen(ExecutionPlan.java:136)
>
> at
> org.postgresql.pljava.jdbc.SPIStatement.executePlan(SPIStatement.java:114)
>
> at
> org.postgresql.pljava.jdbc.SPIPreparedStatement.execute(SPIPreparedStatement.java:263)
>
> at
> org.postgresql.pljava.jdbc.SPIPreparedStatement.executeQuery(SPIPreparedStatement.java:72)
>
> at
> org.postgresql.pljava.sqlj.Loader.findClass(Loader.java:171)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> at
> com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
> at java.lang.Thread.run(Thread.java:534)
>
> java.lang.NoClassDefFoundError: alt/java/net/SocketImpl
> at
> com.echomine.net.SocketConnector$1.run(SocketConnector.java:285)
> at java.lang.Thread.run(Thread.java:534)
>
> ----------
>
>
> Here is the code generating it.
>
> Class: SocketConnector.java
>
> ....
> import alt.java.net.SocketImpl;
> .....
>
> public void aconnect(final SocketHandler socketHandler, final
> ConnectionModel connectionModel) {
> Thread thread = new Thread(new Runnable() {
> public void run() {
> alt.java.net.Socket socket = null;
> try {
> ConnectionEvent event = new
> ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_STARTING
> );
> ConnectionEvent vetoEvent = new
> ConnectionEvent(connectionModel, ConnectionEvent.CONNECTION_VETO
> ED);
> fireConnectionStarting(event, vetoEvent);
> socketHandler.start();
> if (connectionModel.isSSL()) {
> socket = new
> SocketImpl(negotiateSSLConnection(connectionModel));
> } else {
> --->>> socket = new SocketImpl(new
> Socket(connectionModel.getHost(), connectionModel.getPort()));
> }
>
>
> It appears the class in question is indeed in the jar I load.
>
> Thank you!!!
>
> Darren
>
>
> Thomas Hallgren wrote:
>> Hi Darren,
>> What do you mean when you say 'dynamically loaded'? Do you load it
>> using an explicit ClassLoader.loadClass() call? And that succeeds?
>> Also, when you say 'statically initializes', you you mean that the
>> class in question has a static attribute of class SocketImpl, does it
>> extend that class, or does it use an explicit ClassLoader inside of a
>> static initializer?
>>
>> Is it a ClassNotFoundException or a NoClassDefFoundError that you are
>> experiencing? Can you provide a stack trace?
>>
>> Regards,
>> Thomas Hallgren
>>
>>
>> Darren Govoni wrote:
>>> Hi,
>>>
>>> Running pljava 1.1 with postgres 8.0.3.
>>>
>>> I have a single jar that contains all my classes. One class
>>> 'SocketImpl', is dynamically loaded, however
>>> pljava throws a class not found exception when I try to execute a
>>> function on a class that statically initializes
>>> with 'SocketImpl'. Any tips very appreciated!
>>>
>>> Cheers,
>>> Darren
>>> _______________________________________________
>>> Pljava-dev mailing list
>>> Pljava-dev at gborg.postgresql.org
>>> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>>>
>>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-03-25 20:17 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-25 04:23 [Pljava-dev] Cannot find dynamic class
2006-03-25 07:51 `
2006-03-25 17:22 `
2006-03-25 20:15 `
2006-03-25 20:17 `
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox