My environment: Tomcat 6.0.18 Hibernate 3.0.5 MySql standard-4.1.14
I presently have the Datasource configured in tomcat/conf/server.xml thusly:
<GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/CSRapp" description="DB Connection" type="javax.sql.DataSource" scope="shareable"
driverClassName="com.mysql.jdbc.Driver" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" url="jdbc:mysql://localhost:3306/CSRapp" username="CSRapp" password="CSRapp" auth="Container"
maxActive="100" maxWait="5000" maxIdle="10" />
</GlobalNamingResources>
I need guidance how to diagnose this problem and identify why my setup cannot open a connection to the database. Thanks.
Here is a log report of the problem, long but ...
19:13:23,540 INFO Environment:464 - Hibernate 3.0.5 19:13:23,554 INFO Environment:477 - hibernate.properties not found 19:13:23,569 INFO Environment:510 - using CGLIB reflection optimizer 19:13:23,571 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling 19:13:23,918 INFO Configuration:1110 - configuring from resource: /hibernate.cfg.xml 19:13:23,920 INFO Configuration:1081 - Configuration resource: /hibernate.cfg.xml 19:13:24,249 INFO Configuration:444 - Mapping resource: org/bcs/server/utils/ServiceProvider.hbm.xml 19:13:24,611 INFO HbmBinder:260 - Mapping class: org.bcs.server.utils.ServiceProvider -> ServiceProvider 19:13:24,748 WARN HbmBinder:422 - Could not perform validation checks for component as the class org.bcs.server.utils.ServiceProvider was not found 19:13:24,765 INFO Configuration:1222 - Configured SessionFactory: null 19:13:24,767 INFO Configuration:875 - processing extends queue 19:13:24,769 INFO Configuration:879 - processing collection mappings 19:13:24,772 INFO Configuration:888 - processing association property references 19:13:24,773 INFO Configuration:917 - processing foreign key constraints 19:13:25,943 INFO NamingHelper:26 - JNDI InitialContext properties:{} 19:13:25,953 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/CSRapp 19:13:25,971 WARN SettingsFactory:103 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004) at org.bcs.server.db.HibernateUtil.<clinit>(Unknown Source) at org.bcs.server.db.ModelFacade.findAllLikeThis(Unknown Source) at org.bcs.server.SelectionSearchServiceImpl.findAllLikeThis(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:163) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) ... 29 more 19:13:26,055 INFO Dialect:92 - Using dialect: org.hibernate.dialect.MySQLDialect 19:13:26,080 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions) 19:13:26,106 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 19:13:26,108 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled 19:13:26,110 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled 19:13:26,115 INFO SettingsFactory:144 - Scrollable result sets: disabled 19:13:26,117 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): disabled 19:13:26,118 INFO SettingsFactory:160 - Connection release mode: null 19:13:26,123 INFO SettingsFactory:184 - Maximum outer join fetch depth: 2 19:13:26,124 INFO SettingsFactory:187 - Default batch fetch size: 1 19:13:26,126 INFO SettingsFactory:191 - Generate SQL with comments: disabled 19:13:26,127 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled 19:13:26,129 INFO SettingsFactory:334 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 19:13:26,144 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory 19:13:26,145 INFO SettingsFactory:203 - Query language substitutions: {} 19:13:26,147 INFO SettingsFactory:209 - Second-level cache: enabled 19:13:26,154 INFO SettingsFactory:213 - Query cache: disabled 19:13:26,156 INFO SettingsFactory:321 - Cache provider: org.hibernate.cache.EhCacheProvider 19:13:26,175 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled 19:13:26,177 INFO SettingsFactory:237 - Structured second-level cache entries: disabled 19:13:26,217 INFO SettingsFactory:261 - Statistics: disabled 19:13:26,218 INFO SettingsFactory:265 - Deleted entity synthetic identifier rollback: disabled 19:13:26,224 INFO SettingsFactory:279 - Default entity-mode: pojo 19:13:26,609 INFO SessionFactoryImpl:152 - building session factory 19:13:26,650 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/usr/local/Apache.org/Tomcat/6.0.18/webapps/CSRapp/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml 19:13:27,616 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured 19:13:27,618 INFO SessionFactoryImpl:379 - Checking 0 named queries 19:13:27,848 DEBUG ConnectionManager:296 - opening JDBC connection 19:13:27,864 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: null 19:13:27,866 ERROR JDBCExceptionReporter:72 - Cannot create JDBC driver of class '' for connect URL 'null' org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92) at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110) at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:137) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49) at org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24) at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079) at org.bcs.server.db.ModelFacade.findAllLikeThis(Unknown Source) at org.bcs.server.SelectionSearchServiceImpl.findAllLikeThis(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:163) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298) ... 29 more Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) ... 32 more org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Thank you for any suggestions.
|