You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Goodenough <da...@btconnect.com> on 2006/03/08 16:50:19 UTC

Odd problem with Tomcat 5.5.9 and PhantomReferences

I have a servlet which I am trying to run under Tomcat 5.5.9 which has a 
background thread in it.  This thread uses JDBC, and in particular the 
Postgresql JDBC driver.  This driver uses PhantomReferences in order to
tidy up the underlying C objects.

But when it comes to use the PhantomReference it gets:-

        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1221)
        at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at 
org.postgresql.core.v3.QueryExecutorImpl.registerParsedQuery(QueryExecutorImpl.java:1092)
        at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1177)
        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:346)
        at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:250)
  
The line in registerParsedQuery that is failing is:-

        PhantomReference cleanupRef = new PhantomReference(query, 
parsedQueryCleanupQueue);

This should work on any JDK since Java 1.2.  I am running this with the Sun 
1.5 SDK.

Is this a sandbox problem?  If so what do I need to set in order to allow 
this to work?

Anyone got any idea why this might be failing?

David 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org