Ola, tenho uma aplicação web utilizando datapool, mas na hora de criar a conexão com o postgres (9.1) recebo uma exception.
driver: postgresql-9.1-903.jdbc4.jar
java: 1.7
Tomcat 7
o driver está entro da pasta WEB-INF, mas não está dentro da pasta lib do Tomcat.
context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/1">
<Resource
auth="Container"
driverClassName="org.postgresql.Driver"
maxActive="100"
maxIdle="30"
maxWait="10000"
name="jdbc/tecWebSoft-DS"
url="jdbc:postgresql://pgsql.tecwebsoft.com:5432/tecwebsoft1"
username="tecwebsoft1"
password="32665701"
type="javax.sql.DataSource"
/>
</Context>
web.xml
<resource-ref>
<description>Orion Datasource</description>
<res-ref-name>jdbc/tecWebSoft-DS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
exception:
java.lang.AbstractMethodError: org.postgresql.jdbc2.Jdbc2DatabaseMetaData.getDatabaseMajorVersion()I
at org.apache.tomcat.dbcp.dbcp.DelegatingDatabaseMetaData.getDatabaseMajorVersion(DelegatingDatabaseMetaData.java:249)
at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:130)
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:96)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:117)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)