Re: Tomcat 6 / Mysql / connection Pool isValid Method Error

2010-11-29 Thread EmCpam

After applying modifications for using good libraries, it works very well.
Thanks a lot for your explanation and solution.

Emmanuel.


Connection.isValid() is a JDBC4 method and hence is only available in
Java 6.

Tomcat 6 has to work with Java 5 and therefore ships with a database
connection pooling implementation for Java 5 that implements JBDC 3, not
JDBC 4.

To use JDBC 4 methods, you'll need to do the following:
- Add commons-dbcp 1.4 to $CATALINA_HOME/lib
- Add commons-pool 1.5.5 to $CATALINA_HOME/lib
- Change your resource definition to include the following attribute:
  factory=org.apache.commons.dbcp.BasicDataSourceFactory

Mark

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




-- 
View this message in context: 
http://old.nabble.com/Tomcat-6---Mysql---connection-Pool-isValid-Method-Error-tp30308901p30329924.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Tomcat 6 / Mysql / connection Pool isValid Method Error

2010-11-26 Thread Mark Thomas
On 26/11/2010 06:21, EmCpam wrote:
 
 Hi,
 
 I've a problem to use the 'isValid' method of Connection class with a
 connection pool.

snip/

 I'm using tomcat 6.0.29 with java jdk 1.6 and netbeans 6.9.

Connection.isValid() is a JDBC4 method and hence is only available in
Java 6.

Tomcat 6 has to work with Java 5 and therefore ships with a database
connection pooling implementation for Java 5 that implements JBDC 3, not
JDBC 4.

To use JDBC 4 methods, you'll need to do the following:
- Add commons-dbcp 1.4 to $CATALINA_HOME/lib
- Add commons-pool 1.5.5 to $CATALINA_HOME/lib
- Change your resource definition to include the following attribute:
  factory=org.apache.commons.dbcp.BasicDataSourceFactory

Mark

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



Tomcat 6 / Mysql / connection Pool isValid Method Error

2010-11-25 Thread EmCpam

Hi,

I've a problem to use the 'isValid' method of Connection class with a
connection pool.
The java exception is:

javax.servlet.ServletException:
com.sun.jersey.api.container.ContainerException:
java.lang.AbstractMethodError:
org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.isValid(I)Z
   
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:346)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   
org.cnamts.securite.filtres.FiltreSecurite.doFilter(FiltreSecurite.java:133)
   
org.cnamts.securite.filtres.FiltreCommun.doFilter(FiltreCommun.java:128)


I'm using tomcat 6.0.29 with java jdk 1.6 and netbeans 6.9. My jdbc
connector jar is mysql-connector-java-5.1.13-bin.jar, placed in tomcat lib
path.

The declaration of my ressource in web.xml is:
resource-ref
descriptionDB Connection/description
res-ref-namejdbc/connData/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
in my context.xml file:
Context path=/QualifluxWeb antiJARLocking=true
Resource name=jdbc/connData auth=Container 
type=javax.sql.DataSource
   maxActive=10 maxIdle=3 maxWait=1
   username=root password=
driverClassName=com.mysql.jdbc.Driver
   url=jdbc:mysql://localhost:3306/test
   validationQuery=select 1 /
/Context

Others methods for conect, retrieve or update data works well. I've only a
problem with isValid.
What is wrong ? Or is there any other solution for checking my connection ?

Thanks a lot for your help.

Emmanuel
-- 
View this message in context: 
http://old.nabble.com/Tomcat-6---Mysql---connection-Pool-isValid-Method-Error-tp30308901p30308901.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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