Postgresql - Could not locate datasource
mhansen Sep 6, 2002 7:37 AMHi,
I'm working with an little BMP bean example (Account example from book "Mastering EJB 2"). I can not get it to work with JBoss 3.0.2 and PostgreSQL 7.2.1
The following exception is thrown when I try to run the client:
14:17:58,657 ERROR [STDERR] Could not locate datasource! Reason:
14:17:58,659 ERROR [STDERR] org.jboss.util.NestedSQLException: Failed to register driver for: org.postgresql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.postgresql.Driver); - nested throwable: (org.jboss.resource.ResourceException: Failed to register driver for: org.postgresql.Driver; - nested throwable: (java.lang.ClassNotFoundException: org.postgresql.Driver))
14:17:58,661 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:106)
When I start JBoss the following is logged about postgreSQL:
14:35:28,812 INFO [MainDeployer] Starting deployment of package: file:/opt/jbos
s-3.0.2/server/default/deploy/postgres-service.xml
14:35:28,867 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=Postgres
DS does not implement any Service methods
14:35:28,868 INFO [JBossManagedConnectionPool] Creating
14:35:28,868 INFO [JBossManagedConnectionPool] Created
14:35:28,870 INFO [JBossManagedConnectionPool] Starting
14:35:28,871 INFO [JBossManagedConnectionPool] Started
14:35:28,871 INFO [MainDeployer] Deployed package: file:/opt/jboss-3.0.2/server
/default/deploy/postgres-service.xml
So far what I have done is the following (item 2 and 3 from http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ put postgresql jdbc jar file in $(JONAS_HOME)/lib
2) add postgres-service.xml to $(JONAS_HOME)/server/default/deploy
3) edit login-config.xml in $(JONAS_HOME)/server/default/conf
4) change the default DB to PostgreSQL 7.2 in
standardjbosscmp-jdbc.xml
5) add jonas.xml deployment descriptor to my bean jar file.
<enterprise-beans>
<ejb-name>Account</ejb-name>
<jndi-name>AccountHome</jndi-name>
<resource-ref>
<res-ref-name>jdbc/ejbPool</res-ref-name>
<jndi-name>java:/PostgresDS</jndi-name>
</resource-ref>
</enterprise-beans>
I'm I missing something?