Re: PostgreSQL (XADataSource) as Tomcat Resource

Lists: pgsql-jdbc
From: "Guy Rouillier" <guyr(at)masergy(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PostgreSQL (XADataSource) as Tomcat Resource
Date: 2006-04-06 18:39:58
Message-ID: CC1CF380F4D70844B01D45982E671B230137A848@mtxexch01.add0.masergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

markds75 wrote:
> The only error is the exception (the Tomcat thrown exception is at the
> bottom):
>
> Caused by: <1|true|4.0.0EA4> kodo.util.InternalException: There was
> an error when invoking the static getInstance method on the
> named factory class "class
> kodo.jdbc.kernel.JDBCBrokerFactory". See the nested exception for
> details. at kodo.kernel.Bootstrap.getBrokerFactory(Bootstrap.java:96)
> at
>
kodo.jdo.PersistenceManagerFactoryImpl.getPersistenceManagerFactory(Pers
istenceManagerFactoryImpl.java:43)
> ... 61 more
> Caused by:
>
com.solarmetric.apache.commons.lang.exception.NestableRuntimeException:
> There was an error duing JNDI lookup of the name
> "java:comp/env/jdbc/whisper_db". At

What is "kodo"? That is not part of the standard Tomcat installation.
At any rate, have you read the Tomcat documentation on configuring
datasources
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml? I did some quick googling on "tomcat XADataSource" and while I got
a lot of hits, none of the top 10 seemed to have achieved much success.
There are some examples of configuring the factory, so that might come
in helpful. I looked in the latest PG JDBC driver jar and I see no
support for XA there. Are you certain this is even a supported
configuration?

--
Guy Rouillier


From: "markds75" <markds75(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PostgreSQL (XADataSource) as Tomcat Resource
Date: 2006-04-06 20:10:02
Message-ID: 1144354202.037433.241140@v46g2000cwv.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Kodo is my JDO implementation. It's trying to access the database via
JNDI, which succeeds if I use the standard javax.sql.DataSource, but as
soon as I make it an XADataSource, I get the error. I used the tomcat
page you provided the link for to get things set up to begin with. But
since Tomcat itself doesn't have a transaction manager (hence my need
to use the Jencks library to get distributed transactions), they don't
talk about XADataSource at all, nor do they talk about using a
connection factory.

I'm using postgresql-8.1-405.jdbc3.jar as my driver. According to the
PostgreSQL JDBC FAQ:
http://jdbc.postgresql.org/documentation/faq.html
XA support started in 8.1dev-403. I checked the classes in the Jar
itself, and it includes the org.postgresql.xa package (see
http://jdbc.postgresql.org/development/privateapi/index.html for the
JavaDocs).

The question may be: does the configuration change between using a
standard DataSource and an XADataSource? I would think that, at least
as far as setting up a JNDI resource, Tomcat wouldn't care if the
resource implements DataSource or XADataSource.

Most of the search results I found were from before (and mostly years
before) XA support was added to the JDBC driver. I was hoping to find
someone on this newsgroup with some experience using it... as I
understand, its only been 4-6 months since the support was added.

Mark