HikariPool - Connection attempt to database AppPool failed: ORA-01017

2,019 views
Skip to first unread message

Cristian Andrés Bolcatto

unread,
Sep 29, 2014, 11:28:15 AM9/29/14
to hika...@googlegroups.com

I have 12 webapp using the same Oracle DB, but different users/pass to access.

For this reason, I have configured the JNDI in tomcat without user/pass, like this 

tomcat-6/conf/server.xml:
<Resource
 
name="jdbc/appPool"
 
auth="Container"
 
factory="com.zaxxer.hikari.HikariJNDIFactory"
 
type="javax.sql.DataSource"
 
dataSourceClassName="oracle.jdbc.pool.OracleDataSource"
 
dataSource.implicitCachingEnabled="true"
 
maximumPoolSize="10"
 
registerMbeans="true"
 
poolName="AppPool"
 
dataSource.url="jdbc:oracle:thin:@IP:1521:DB_NAME"/>

I pass the user/pass from the webapps.
Everything works fine, but I've noticed that when I put the logging in DEBUG mode I get the following exception repeatedly (continuously) with HikariCP-java6-2.0.1

DEBUG com.zaxxer.hikari.pool.HikariPool - Connection attempt to database AppPool failed: ORA-01017: nombre de usuario/contraseña no válidos; conexión denegada
java
.sql.SQLException: ORA-01017: nombre de usuario/contraseña no válidos; conexión denegada
at oracle
.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) ~[ojdbc6_11.2.0.1.jar:11.2.0.1.0]
 
...
 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]
 
...



I wonder if this attempt to connection to the DB may have an impact on performance or in the operation of the pool ? Or is it preferable to define different JNDI pools with the user/pass ?

I have windows 2003 server, tomcat 6.0.41, jdk 7, and about 300 users. So far I have used the pool on 1 webapp, but I want to use the pool for all webapps.

¿Is too small the number of maximumPoolSize ? ¿Do I have to used a larger number, such as 50?  I don't know much about monitoring tools, thats why I ask you.

Thanks for all,

PD: sorry my English, I speak Spanish :-)

Brett Wooldridge

unread,
Sep 29, 2014, 8:28:05 PM9/29/14
to hika...@googlegroups.com
First, I would set initializationFailFast=true and also enable debug logging for HikariCP.  I am not sure how auth="Container" works ... I am not sure whether HikariCP supports it or not.  Anyway, try the first two items and report what you find.

Brett

Cristian Andrés Bolcatto

unread,
Oct 3, 2014, 8:04:58 AM10/3/14
to hika...@googlegroups.com
Hi Brett, thanks for the quickly respond :-)

I used auth="Container" based on the example of your wiki page
Setting initializationFailFast="true", makes the webapp doesn't work at all. I get the RuntimeException: Fail-fast during pool initialization.

This is the log output:

DEBUG com.zaxxer.hikari.HikariConfig - HikariCP pool AppPool configuration:
DEBUG com
.zaxxer.hikari.HikariConfig - autoCommit......................true
DEBUG com
.zaxxer.hikari.HikariConfig - catalog.........................
DEBUG com
.zaxxer.hikari.HikariConfig - connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@1a81d2b
DEBUG com
.zaxxer.hikari.HikariConfig - connectionCustomizerClassName...
DEBUG com
.zaxxer.hikari.HikariConfig - connectionInitSql...............
DEBUG com
.zaxxer.hikari.HikariConfig - connectionTestQuery.............
DEBUG com
.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
DEBUG com
.zaxxer.hikari.HikariConfig - dataSource......................
DEBUG com
.zaxxer.hikari.HikariConfig - dataSourceClassName.............oracle.jdbc.pool.OracleDataSource
DEBUG com
.zaxxer.hikari.HikariConfig - dataSourceJNDI..................
DEBUG com
.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>, url=jdbc:oracle:thin:@IP:1521:DB_NAME, implicitCachingEnabled=true}
DEBUG com
.zaxxer.hikari.HikariConfig - driverClassName.................
DEBUG com
.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
DEBUG com
.zaxxer.hikari.HikariConfig - initializationFailFast..........true
DEBUG com
.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
DEBUG com
.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............true
DEBUG com
.zaxxer.hikari.HikariConfig - jdbcUrl.........................
DEBUG com
.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
DEBUG com
.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
DEBUG com
.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
DEBUG com
.zaxxer.hikari.HikariConfig - metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker
DEBUG com
.zaxxer.hikari.HikariConfig - minimumIdle.....................10
DEBUG com
.zaxxer.hikari.HikariConfig - password........................<masked>
DEBUG com
.zaxxer.hikari.HikariConfig - poolName........................AppPool
DEBUG com
.zaxxer.hikari.HikariConfig - readOnly........................false
DEBUG com
.zaxxer.hikari.HikariConfig - recordMetrics...................false
DEBUG com
.zaxxer.hikari.HikariConfig - registerMbeans..................true
DEBUG com
.zaxxer.hikari.HikariConfig - threadFactory...................
DEBUG com
.zaxxer.hikari.HikariConfig - transactionIsolation............-1
DEBUG com
.zaxxer.hikari.HikariConfig - username........................
INFO  com
.zaxxer.hikari.HikariDataSource - HikariCP pool AppPool is starting.

ERROR com
.zaxxer.hikari.pool.HikariMBeanElf - You cannot use the same HikariConfig for separate pool instances.


DEBUG com
.zaxxer.hikari.pool.HikariPool - Connection attempt to database AppPool failed: ORA-01017: nombre de usuario/contraseña no válidos; conexión denegada
java
.sql.SQLException: ORA-01017: nombre de usuario/contraseña no válidos; conexión denegada
...
at com
.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:399) [HikariCP-java6-2.0.1.jar:na]

 at com
.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:466) [HikariCP-java6-2.0.1.jar:na]
 at com
.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:145) [HikariCP-java6-2.0.1.jar:na]
 at com
.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:102) [HikariCP-java6-2.0.1.jar:na]
 at com
.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80) [HikariCP-java6-2.0.1.jar:na]
 at com
.zaxxer.hikari.HikariJNDIFactory.createDataSource(HikariJNDIFactory.java:76) [HikariCP-java6-2.0.1.jar:na]
 at com
.zaxxer.hikari.HikariJNDIFactory.getObjectInstance(HikariJNDIFactory.java:67) [HikariCP-java6-2.0.1.jar:na]
...

org
.apache.naming.NamingContext lookup
ADVERTENCIA
: Excepción inesperada resolviendo referencia
java
.lang.RuntimeException: Fail-fast during pool initialization
 at com
.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:467)
 at com
.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:145)
 at com
.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:102)
 at com
.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:80)
 at com
.zaxxer.hikari.HikariJNDIFactory.createDataSource(HikariJNDIFactory.java:76)
 at com
.zaxxer.hikari.HikariJNDIFactory.getObjectInstance(HikariJNDIFactory.java:67)
 at org
.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
....

org
.apache.catalina.core.NamingContextListener addResource
ADVERTENCIA
: No pude registrar en JMX: javax.naming.NamingException: Fail-fast during pool initialization

Brett Wooldridge

unread,
Oct 4, 2014, 2:28:21 AM10/4/14
to hika...@googlegroups.com
Even though the example in the wiki has auth="Container", there is still a username/password configured in the pool.  With tomcat, I think you have to set the username and password properties like this:

username="${database.username}" password="${database.password}"
See this stackoverflow answer.  I'm really not that familiar with tomcat configuration -- been years since I used it.  You'll be better off asking these kinds of questions on stackoverflow, IMHO.

Reply all
Reply to author
Forward
0 new messages