开发者社区> 问答> 正文

druid配置wall的问题:报错

@wenshao ,使用druid连接池,一配置wall就报错:

<bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter"> <property name="dbType" value="mysql" /> </bean>

<property name="proxyFilters"> <list> <ref bean="wall-filter"/> </list> </property>

[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Unable to translate SQLException with Error code '0', will now try the fallback translator

去掉上面的wall配置,则一切正常。

求解

展开
收起
kun坤 2020-06-14 08:05:20 731 0
1 条回答
写回答
取消 提交回答
  • 补充下,用的是 1.0.16版本######详细错误提供一下,看是什么SQL无法解释######

    引用来自“wenshao”的评论

    详细错误提供一下,看是什么SQL无法解释

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'transactionManager'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'transactionManager'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'transactionManager' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'dataSource'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking afterPropertiesSet() on bean with name 'transactionManager'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'transactionManager'

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Creating new transaction with name [com.asgab.service.account.AccountService.findUserByLoginName]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Acquired Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@7c3c000f] for JDBC transaction

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Switching JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@7c3c000f] to manual commit

    [org.mybatis.spring.SqlSessionUtils] - Creating a new SqlSession

    [org.mybatis.spring.SqlSessionUtils] - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66be17e3]

    [org.mybatis.spring.transaction.SpringManagedTransaction] - JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@7c3c000f] will be managed by Spring

    [com.asgab.repository.UserMapper.search] - ==>  Preparing: select id, name,login_name as loginName, password,salt,roles,emailaudit,register_date as registerDate, email, financeEmail,company, department, function from ss_user where deleted = 1 and login_name=? 

    [org.mybatis.spring.SqlSessionUtils] - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66be17e3]

    [org.springframework.core.env.StandardEnvironment] - Adding [systemProperties] PropertySource with lowest search precedence

    [org.springframework.core.env.StandardEnvironment] - Adding [systemEnvironment] PropertySource with lowest search precedence

    [org.springframework.core.env.StandardEnvironment] - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]

    [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]

    [org.springframework.beans.factory.xml.DefaultDocumentLoader] - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]

    [org.springframework.beans.factory.xml.BeansDtdResolver] - Found beans DTD [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath: spring-beans-2.0.dtd

    [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] - Loading bean definitions

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'DB2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'DB2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'DB2' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'DB2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Derby'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Derby'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Derby' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Derby'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'H2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'H2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'H2' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'H2'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'HSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'HSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'HSQL' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'HSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Informix'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Informix'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Informix' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Informix'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'MS-SQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'MS-SQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'MS-SQL' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'MS-SQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'MySQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'MySQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'MySQL' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'MySQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Oracle'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Oracle'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Oracle' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Oracle'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'PostgreSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'PostgreSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'PostgreSQL' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'PostgreSQL'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Sybase'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Sybase'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Sybase' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Sybase'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating shared instance of singleton bean 'Hana'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Creating instance of bean 'Hana'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'Hana' to allow for resolving potential circular references

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'Hana'

    [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]

    [org.springframework.jdbc.support.SQLErrorCodesFactory] - Looking up default SQLErrorCodes for DataSource [{

    CreateTime:"2015-12-17 11:41:02",

    ActiveCount:1,

    PoolingCount:4,

    CreateCount:5,

    DestroyCount:0,

    CloseCount:0,

    ConnectCount:1,

    Connections:[

    {ID:598880624, ConnectTime:"2015-12-17 11:41:02", UseCount:0, LastActiveTime:"2015-12-17 11:41:02"},

    {ID:1939972978, ConnectTime:"2015-12-17 11:41:02", UseCount:0, LastActiveTime:"2015-12-17 11:41:02"},

    {ID:1352040302, ConnectTime:"2015-12-17 11:41:02", UseCount:0, LastActiveTime:"2015-12-17 11:41:02"},

    {ID:1805162361, ConnectTime:"2015-12-17 11:41:02", UseCount:0, LastActiveTime:"2015-12-17 11:41:02"}

    ]

    }]

    [org.springframework.jdbc.support.SQLErrorCodesFactory] - Database product name cached for DataSource [com.alibaba.druid.pool.DruidDataSource@27a6b5de]: name is 'MySQL'

    [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQL error codes for 'MySQL' found

    [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Unable to translate SQLException with Error code '0', will now try the fallback translator

    [org.mybatis.spring.SqlSessionUtils] - Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66be17e3]

    [org.mybatis.spring.SqlSessionUtils] - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@66be17e3]

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Initiating transaction rollback

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Rolling back JDBC transaction on Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@7c3c000f]

    [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Releasing JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@7c3c000f] after transaction

    [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource

    [org.apache.shiro.web.servlet.SimpleCookie] - Added HttpServletResponse Cookie [rememberMe=deleteMe; Path=/csa; Max-Age=0; Expires=Wed, 16-Dec-2015 03:41:31 GMT]

    [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'springServlet' processing POST request for [/csa/login]

    [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Looking up handler method for path /login

    [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] - Returning handler method [public java.lang.String com.asgab.web.account.LoginController.fail(java.lang.String,org.springframework.ui.Model)]

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'loginController'

    [org.springframework.web.servlet.DispatcherServlet] - Rendering view [org.springframework.web.servlet.view.JstlView: name 'account/login'; URL [/WEB-INF/views/account/login.jsp]] in DispatcherServlet with name 'springServlet'

    [org.springframework.web.servlet.view.JstlView] - Added model object 'username' of type [java.lang.String] to request in view with name 'account/login'

    [org.springframework.web.servlet.view.JstlView] - Forwarding to resource [/WEB-INF/views/account/login.jsp] in InternalResourceView 'account/login'

    [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'sqlSessionFactory'

    [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'sqlSessionFactory-xmo'

    ######就是执行了这一句:

    select id, name,login_name as loginName, password,salt,roles,emailaudit,register_date as registerDate, email, financeEmail,company, department, function from ss_user where deleted = 1 and login_name=? 


    2020-06-14 08:06:23
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载