在ORACLE11g部署时容器报如下错误:
22:07:27,226 INFO [STDOUT] ERROR 2016-09-03 22:07:27,224 (com.alibaba.druid.poo
l.DruidDataSource:840)- invalid oracle validationQuery. SELECT 'x', may should be : SELECT 'x' FROM DUALCaused by:
-------------------------------
java.lang.NullPointerException
at com.thams.dao.base.DataBaseDao.existTable(DataBaseDao.java:108)
at com.thams.service.impl.DataBaseService.existTable(DataBaseService.java:143)
at com.thams.service.impl.DBinfoServiceImpl.initData(DBinfoServiceImpl.java:647)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
--------------------------------------------
此错误需要到jdbc.properties 里面找到 druid.datasource.validationQuery=SELECT 'x' 把其改为:druid.datasource.validationQuery=SELECT 'x' FROM DUAL
保存后拉到部署包内,重启容器即可