Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HikariCP Can not get username config in jdbc.properties #133

Closed
ghost opened this issue Aug 15, 2014 · 4 comments
Closed

HikariCP Can not get username config in jdbc.properties #133

ghost opened this issue Aug 15, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 15, 2014

I meet a strange question!
My work OS : win7
server centos 6.4
jdk: 1.7
db: mysql

my project build by Spring 3.2.3.RELEASE+ mybatis 3.2.5 maven .

pom.xml

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.26</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
                    <groupId>com.zaxxer</groupId>
                    <artifactId>HikariCP-java6</artifactId>
                    <version>2.0.1</version>
        </dependency>

applicationContext.xml

    <bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
        <property name="poolName" value="springHikariCP"/>
        <property name="connectionTestQuery" value="SELECT 1"/>
        <property name="dataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
        <property name="dataSourceProperties">
            <props>
                <prop key="url">jdbc:mysql://192.168.203.130:3306/orders</prop>
                <prop key="user">root</prop>
                <prop key="password">root</prop>
                <prop key="cachePrepStmts">true</prop>
                <prop key="prepStmtCacheSize">250</prop>
                <prop key="prepStmtCacheSqlLimit">2048</prop>
                <prop key="useServerPrepStmts">true</prop>
            </props>
        </property>
    </bean>

    <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"
          destroy-method="shutdown">
        <constructor-arg ref="hikariConfig"/>
    </bean>

when i run project at win7 OS. this is error

Caused by: java.sql.SQLException: Access denied for user 'yanliang'@'192.168.203.1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4689)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1304)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2486)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2519)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2304)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141)
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:111)
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:399)
at com.zaxxer.hikari.pool.HikariPool.access$400(HikariPool.java:64)
at com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:316)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

while ,yanliang is my win7 user, 192.168.203.1 is win7 ip .

but run code at server, no error .

why HikariCP get my system login user to connect Remote db?

@brettwooldridge
Copy link
Owner

That is truly strange. HikariCP has no code to access a user name other than what is specified in properties. Can you enable debug logging? When debug logging is turned on, HikariCP should log all of the pool parameters when the pool starts.

@ghost
Copy link
Author

ghost commented Aug 15, 2014

this is debug log
13:31:38,344 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
13:31:38,344 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
13:31:38,345 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/E:/Repositories/workspace/idea/spring-demo/target/classes/logback.xml]
13:31:38,412 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
13:31:38,422 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 30 seconds
13:31:38,422 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[E:\Repositories\workspace\idea\spring-demo\target\classes\logback.xml]] every 30 seconds.
13:31:38,422 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
13:31:38,430 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
13:31:38,461 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@2e413336 - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
13:31:38,461 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Starting LoggerContextListener
13:31:38,461 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:31:38,466 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console]
13:31:38,480 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:31:38,548 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
13:31:38,553 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [RollingFile]
13:31:38,581 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
13:31:38,584 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern log/cinema2ebs-%d{yyyy-MM-dd}.log for the active file
13:31:38,589 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'log/cinema2ebs-%d{yyyy-MM-dd}.log'.
13:31:38,589 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
13:31:38,592 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Fri Aug 15 13:31:38 CST 2014
13:31:38,595 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[RollingFile] - File property must be set before any triggeringPolicy or rollingPolicy properties
13:31:38,595 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[RollingFile] - Visit http://logback.qos.ch/codes.html#rfa_file_after for more information
13:31:38,600 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3a8935f3 - Will use zip compression
13:31:38,610 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:31:38,611 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[RollingFile] - Active log file name: log/cinema2ebs.log
13:31:38,611 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[RollingFile] - File property is set to [log/cinema2ebs.log]
13:31:38,613 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
13:31:38,613 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [datasourceFile]
13:31:38,616 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
13:31:38,616 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern log/druid-%d{yyyy-MM-dd}.log for the active file
13:31:38,616 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'log/druid-%d{yyyy-MM-dd}.log'.
13:31:38,616 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
13:31:38,616 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Fri Aug 15 13:31:38 CST 2014
13:31:38,617 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[datasourceFile] - File property must be set before any triggeringPolicy or rollingPolicy properties
13:31:38,617 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[datasourceFile] - Visit http://logback.qos.ch/codes.html#rfa_file_after for more information
13:31:38,618 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@635028b - Will use zip compression
13:31:38,619 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:31:38,620 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[datasourceFile] - Active log file name: log/druid.log
13:31:38,620 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[datasourceFile] - File property is set to [log/druid.log]
13:31:38,620 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
13:31:38,620 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [console] to Logger[ROOT]
13:31:38,622 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to ERROR
13:31:38,622 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@2e413336 - Propagating ERROR level on Logger[org.springframework] onto the JUL framework
13:31:38,623 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.zaxxer.hikari] to DEBUG
13:31:38,623 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@2e413336 - Propagating DEBUG level on Logger[com.zaxxer.hikari] onto the JUL framework
13:31:38,623 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:31:38,624 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@239f6dc - Registering current configuration as safe fallback point

2014-08-15 13:31:39.296 [main] DEBUG org.mybatis.spring.mapper.ClassPathMapperScanner - Ignored because not a concrete top-level class: file [E:\Repositories\workspace\idea\spring-demo\target\test-classes\yl\codecraft\spring\demo\mapper\OrderMapperTest.class]
2014-08-15 13:31:39.299 [main] DEBUG org.mybatis.spring.mapper.ClassPathMapperScanner - Identified candidate component class: file [E:\Repositories\workspace\idea\spring-demo\target\classes\yl\codecraft\spring\demo\mapper\OrdersMapper.class]
2014-08-15 13:31:39.299 [main] DEBUG org.mybatis.spring.mapper.ClassPathMapperScanner - Creating MapperFactoryBean with name 'ordersMapper' and 'yl.codecraft.spring.demo.mapper.OrdersMapper' mapperInterface
2014-08-15 13:31:39.301 [main] DEBUG org.mybatis.spring.mapper.ClassPathMapperScanner - Enabling autowire by type for MapperFactoryBean with name 'ordersMapper'.
2014-08-15 13:31:39.352 [main] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
2014-08-15 13:31:40.034 [main] DEBUG com.zaxxer.hikari.HikariConfig - HikariCP pool springHikariCP configuration:
2014-08-15 13:31:40.039 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true
2014-08-15 13:31:40.039 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................
2014-08-15 13:31:40.039 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@5c30a4a7
2014-08-15 13:31:40.039 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionCustomizerClassName...
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............SELECT 1
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............com.mysql.jdbc.jdbc2.optional.MysqlDataSource
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{user=yanliang, url=jdbc:mysql://192.168.203.130:3306/orders?zeroDateTimeBehavior=round&useUnicode=true&characterEncoding=UTF-8, password=, prepStmtCacheSqlLimit=2048, useServerPrepStmts=true, cachePrepStmts=true, prepStmtCacheSize=250}
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName.................
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailFast..........false
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............false
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
2014-08-15 13:31:40.040 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................10
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................springHikariCP
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - recordMetrics...................false
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............-1
2014-08-15 13:31:40.041 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................
2014-08-15 13:31:40.042 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariCP pool springHikariCP is starting.
2014-08-15 13:31:40.113 [main] DEBUG org.mybatis.spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration
2014-08-15 13:31:40.264 [HikariCP connection filler] DEBUG com.zaxxer.hikari.pool.HikariPool - Connection attempt to database springHikariCP failed: Access denied for user 'yanliang'@'192.168.203.1' (using password: YES)
java.sql.SQLException: Access denied for user 'yanliang'@'192.168.203.1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4689) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1304) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2486) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2519) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2304) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.26.jar:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_65]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_65]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_65]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_65]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:111) ~[mysql-connector-java-5.1.26.jar:na]
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:399) [HikariCP-java6-2.0.1.jar:na]
at com.zaxxer.hikari.pool.HikariPool.access$400(HikariPool.java:64) [HikariCP-java6-2.0.1.jar:na]
at com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:316) [HikariCP-java6-2.0.1.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
2014-08-15 13:31:40.478 [HikariCP connection filler] DEBUG com.zaxxer.hikari.pool.HikariPool - Connection attempt to database springHikariCP failed: Access denied for user 'yanliang'@'192.168.203.1' (using password: YES)
java.sql.SQLException: Access denied for user 'yanliang'@'192.168.203.1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4689) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1304) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2486) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2519) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2304) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.26.jar:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_65]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_65]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_65]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_65]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141) ~[mysql-connector-java-5.1.26.jar:na]
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:111) ~[mysql-connector-java-5.1.26.jar:na]
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:399) [HikariCP-java6-2.0.1.jar:na]
at com.zaxxer.hikari.pool.HikariPool.access$400(HikariPool.java:64) [HikariCP-java6-2.0.1.jar:na]
at com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:316) [HikariCP-java6-2.0.1.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]

@brettwooldridge
Copy link
Owner

The log shows you have the following datasource properties set (somewhere);

{user=yanliang, url=jdbc:mysql://192.168.203.130:3306/orders?
zeroDateTimeBehavior=round&useUnicode=true&characterEncoding=UTF-8, password=, 
prepStmtCacheSqlLimit=2048, useServerPrepStmts=true, cachePrepStmts=true, 
prepStmtCacheSize=250}

Which shows user=yanliang and password=.

@ghost
Copy link
Author

ghost commented Aug 15, 2014

I think to find why 。

I have a jdbc.properties,
jdbcUrl=jdbc:mysql://192.168.203.130:3306/orders
username=root
password=root

in spring Configuration file ,write this
${jdbcUrl}
${username}
${password}

this key is username , change username to db.username . everthing is ok .

thinks

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant