在tomcat的server.xml中的<Resource>里配置数据库连接,分了三行,但是启动总是报下面的错误,很是郁闷,后来将这三行整理成一行,启动tomcat居然成功了,整理一下,如果有遇到类似情况的伙伴,可以使用这种方式试一下。
报错代码:
Cannot create PoolableConnectionFactory (The connection property 'zeroDateTimeBehavior' only accepts values of the form: 'exception', 'round' or 'convertToNull'. The value 'conv ertToNull' is not in this set.) java.lang.Exception at org.dmomy.util.Debug.error(Debug.java:59) at org.dmomy.persistence.PersistenceJDBC.makeConnection(PersistenceJDBC.java:779) at org.dmomy.persistence.PersistenceJDBC.beginTransaction(PersistenceJDBC.java:1065) at org.dmomy.data.Entity.sync(Entity.java:568) at com.dmomy_authority.entity.Action.<init>(Action.java:25) at com.dmomy_authority.entityBean.ActionBean.countAll(ActionBean.java:384) at com.dmomy_authority.controller.Init.syncdb(Init.java:40) at com.dmomy_authority.controller.Init.<init>(Init.java:23) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:983) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:936) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:488) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:632) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:589) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:646) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:509) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:450) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4923) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5215) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)