Tomcat error when add the JNDI datasource

Hi: Gurus I am having the following errors where I add the JNDI datasource in the Tomcat.

Does any one has any idea why it is happening, here is my configuration in the context and web.xml file

Oracle Datasource example jdbc/xxx oracle.jdbc.pool.OracleDataSource Container

Thanks in advance

Jun 25, 2010 10:27:13 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session 946698F01E20F6A26D2A2097797B63EC
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Jun 25, 2010 10:27:24 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet VaadinApplication as unavailable
Jun 25, 2010 10:27:24 AM org.apache.catalina.core.ApplicationContext log
SEVERE: Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@179c285
com.vaadin.terminal.gwt.server.ApplicationServlet
java.lang.ClassNotFoundException: com.vaadin.terminal.gwt.server.ApplicationServlet

Jun 25, 2010 10:27:24 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet VaadinApplication
java.lang.ClassNotFoundException: com.vaadin.terminal.gwt.server.ApplicationServlet

Jun 25, 2010 10:27:24 AM org.apache.catalina.core.StandardWrapperValve invoke
INFO: Servlet VaadinApplication is currently unavailable
Jun 25, 2010 10:30:29 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session 829C3BA86ABC181C7F023F509F8313D1
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Jun 25, 2010 10:31:54 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session 43B6AF18480DC851FD7B6C26C8F66E85
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Jun 25, 2010 10:33:57 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session 3ABDCCDB7A8C9F55B6EB027BC69DFB46
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

    at java.lang.Thread.run(Thread.java:619)

Jun 25, 2010 10:37:37 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet VaadinApplication threw exception
java.lang.NullPointerException

Jun 25, 2010 10:39:43 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet VaadinApplication threw exception
java.lang.NullPointerException

    at java.lang.Thread.run(Thread.java:619)

Jun 25, 2010 10:45:34 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet VaadinApplication threw exception
java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to oracle.jdbc.pool.OracleDataSource

    at java.lang.Thread.run(Thread.java:619)

Jun 25, 2010 10:55:49 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet VaadinApplication threw exception
java.lang.NullPointerException

Jun 25, 2010 10:56:41 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet VaadinApplication threw exception
java.lang.NullPointerException

Jun 25, 2010 10:58:36 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session C3335C4E59038CCEED2B390385215462
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

Jun 25, 2010 11:09:35 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session AE680ABDA443C226A8E3659928096B75
java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

    at java.lang.Thread.run(Thread.java:619)

Jun 25, 2010 11:18:09 AM org.apache.catalina.session.StandardSession writeObject
WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session AB42DED5C2A3DAA044D03115C60FFECE
java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection

An old thread, but one point that might be of relevance: usually database connection classes are not serializable, so if your sessions are serialized by the server or e.g. by some clustering solution, you should mark those fields as transient and access them through a getter that re-obtains them from the server when the value is null.

In this particular case, there might also be some classloader issues, e.g. two versions of the same classes seen by the server, loaded by different classloaders in some situations.