Postgres datasource problems with J2EE

Hello All

I'm having problems trying to connect to a postgres database through a datasource. I'm a little new to this all so i'll try to be as detailed as possible.

This is a simple two step client app, 1 client publishes to a topic, another client app consumers off of it. The publisher runs fine, but the consumer (whichis suppose to consume messages off the topic and submit it to a database), keeps throwing this exception:

SEVERE: RAR5099 : Wrong class name or classpath for Datasource Object : {0}

java.lang.ClassNotFoundException: org.postgresql.jdbc3.Jdbc3PoolingDataSource

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:164)

at etc

\

In the admin console, I've set up the postgres db as a connection pool using org.postgresql.jdbc3.Jdbc3PoolingDataSource as the datasource class and javax.sql.ConnectionPoolDataSource as it's resource type. It pings fine.

I've also (as was recommended in the forums) added my postgresql-8.1-404.jdbc3.jar to my classpath suffix of my JVM and added -Djdbc.drivers=org.postgresql.Driver to my JVM options.

Any ideas on what this exception might be from?

[1677 byte] By [sitkilla] at [2007-10-2 11:34:37]
# 1
try data source classorg.postgresql.jdbc3.Jdbc3SimpleDataSource
dxga at 2007-7-13 5:02:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
It's really....... The SUN AP default class loader can not load the classes and jar files from the /WEB-INF/classes/ and /WEB-INF/lib/. You should add these jar files individually in the classpath.
SteveGY_CNa at 2007-7-13 5:02:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Postgres is not (yet) supported by SJSAS 8.x CMP.

I. In order to connect to Postgres, please do the following steps, assuming you defined domain <domain1>:

$ cp postgresql-8.0-314.jdbc3.jar $AS_ROOT/domains/domain1/lib/ext

$ $AS_ROOT/bin/asadmin stop-domain

$ $AS_ROOT/bin/asadmin start-domain

$ $AS_ROOT/bin/asadmin create-jdbc-connection-pool $AS_COMMON_ARGS --datasourceclassname org.postgresql.ds.PGSimpleDataSource --property user=dbuser:password=dbpassword:driverType=4:portNumber=5432:databaseName=test:serverName=localhost jdbc-postgres-pool

$ $AS_ROOT/bin/asadmin create-jdbc-resource $AS_COMMON_ARGS --connectionpoolid jdbc-postgres-pool jdbc/postgres

$ $AS_ROOT/bin/asadmin create-persistence-resource $AS_COMMON_ARGS --jdbcjndiname jdbc/postgres --property "optimistic=false:nontransactionalRead=false:retainValues=false" <your resource name>

II. For CMP, define a file $AS_ROOT/domains/domain1/config/.tpersistence.properties, having the following contents:

database.postgresql.FOR_UPDATE=for update

database.postgresql.SUPPORTS_UPDATE_LOCK=true

database.postgresql.QUOTE_CHAR_START=

database.postgresql.QUOTE_CHAR_END=

database.postgresql.SQRT=SQRT

database.postgresql.ABS=ABS

database.postgresql.MOD_FUNCTION_NAME=MOD

database.postgresql.ANSI_TRIM=false

database.postgresql.RTRIM=rtrim

-- markus.

m_fuchsa at 2007-7-13 5:02:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...