From: Ja k. <jja...@gm...> - 2014-01-28 16:00:46
|
I get No registered driver will accept url java:comp/env/jdbc/petclinic1 with config: <ha-jdbc xmlns="urn:ha-jdbc:cluster:3.0"> <sync id="passive" ></sync> <cluster balancer="round-robin" dialect="mysql" default-sync="passive" > <database id="database1" location="java:comp/env/jdbc/petclinic1" weight="1"> </database> <database id="database2" location="java:comp/env/jdbc/petclinic2" weight="1"> </database> </cluster> </ha-jdbc> datasource tag is no longer valid <datasource id="database1"> <name>java:comp/env/jdbc/petclinic1</name> </datasource> do I do sth wrong ? here is full stack trace: ERROR ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jdbc.datasource.init.DataSourceInitializer#0': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to execute database script; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (No registered driver will accept url java:comp/env/jdbc/petclinic1) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) ~[spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381) ~[spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293) ~[spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4961) [catalina.jar:7.0.50] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5455) [catalina.jar:7.0.50] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.50] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.50] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.50] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:634) [catalina.jar:7.0.50] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1074) [catalina.jar:7.0.50] at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) [catalina.jar:7.0.50] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_21] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_21] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_21] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_21] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_21] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21] Caused by: org.springframework.dao.DataAccessResourceFailureException: Failed to execute database script; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (No registered driver will accept url java:comp/env/jdbc/petclinic1) at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:56) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.jdbc.datasource.init.DataSourceInitializer.afterPropertiesSet(DataSourceInitializer.java:84) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 26 common frames omitted Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (No registered driver will accept url java:comp/env/jdbc/petclinic1) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:45) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 29 common frames omitted Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (No registered driver will accept url java:comp/env/jdbc/petclinic1) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) ~[tomcat-dbcp.jar:7.0.50] at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) ~[tomcat-dbcp.jar:7.0.50] at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) ~[tomcat-dbcp.jar:7.0.50] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 30 common frames omitted Caused by: java.sql.SQLException: No registered driver will accept url java:comp/env/jdbc/petclinic1 at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:51) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.SQLExceptionFactory.createException(SQLExceptionFactory.java:35) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.AbstractExceptionFactory.createException(AbstractExceptionFactory.java:62) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:95) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:34) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.Driver.connect(Driver.java:139) ~[ha-jdbc-3.0.0.jar:3.0.0] at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) ~[tomcat-dbcp.jar:7.0.50] at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) ~[tomcat-dbcp.jar:7.0.50] at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) ~[tomcat-dbcp.jar:7.0.50] at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) ~[tomcat-dbcp.jar:7.0.50] ... 34 common frames omitted Caused by: java.lang.IllegalArgumentException: No registered driver will accept url java:comp/env/jdbc/petclinic1 at net.sf.hajdbc.sql.DriverDatabase.getDriver(DriverDatabase.java:110) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.DriverDatabase.createConnectionSource(DriverDatabase.java:93) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.DriverDatabase.createConnectionSource(DriverDatabase.java:39) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.DatabaseClusterImpl.isAlive(DatabaseClusterImpl.java:834) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.sql.DatabaseClusterImpl.start(DatabaseClusterImpl.java:708) ~[ha-jdbc-3.0.0.jar:3.0.0] at net.sf.hajdbc.util.concurrent.LifecycleRegistry.get(LifecycleRegistry.java:76) ~[ha-jdbc-3.0.0.jar:3.0.0] ... 40 common frames omitted Caused by: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:289) ~[na:1.7.0_21] at net.sf.hajdbc.sql.DriverDatabase.getDriver(DriverDatabase.java:106) ~[ha-jdbc-3.0.0.jar:3.0.0] ... 45 common frames omitted Jan 28, 2014 4:54:16 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart BR J. |