2 Replies Latest reply: Jul 29, 2011 11:00 AM by Jesper Pedersen RSS

Cannot configure valid-connection-checker, causes ClassNotFoundException

Takayoshi Kimura Novice

I'm trying to implement JBJCA-634 and hit an issue.

 

Support query timeout for check-valid-connection-sql

https://issues.jboss.org/browse/JBJCA-634

 

When I configured valid-connection-checker with NullValidConnectionChecker for testing purpose, I got this exception:

 

12:01:35,859 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (JBossConnectionValidator) Exception trying to create connection checker (disabling):: java.lang.ClassNotFoundException: org.jboss.jca.adapters.jdbc.extensions.novendor.NullValidConnectionChecker from [Module "org.jboss.ironjacamar.impl:main" from local module loader @12b7eea (roots: /home/nekop/usr/src/as7/build/target/jboss-as-7.1.0.Alpha1-SNAPSHOT/modules)]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:1034)
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:449)
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.getInvalidConnections(BaseWrapperManagedConnectionFactory.java:918)
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.validateConnections(SemaphoreArrayListManagedConnectionPool.java:800) [ironjacamar-core-impl-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.jca.core.connectionmanager.pool.validator.ConnectionValidator$JBossConnectionValidator.run(ConnectionValidator.java:269) [ironjacamar-core-impl-1.0.0.Final.jar:1.0.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_22]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_22]
    at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]

 

And here is my datasource config:

 

<datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS" spy="true">
  <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
  <driver>h2</driver>
  <pool>
    <min-pool-size>2</min-pool-size>
    <max-pool-size>10</max-pool-size>
    <prefill>true</prefill>
  </pool>
  <security>
    <user-name>sa</user-name>
    <password>sa</password>
  </security>
  <validation>
    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.novendor.NullValidConnectionChecker"/>
<!--
    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.CheckValidConnectionSQL">
      <config-property name="sql">SELECT 1</config-property>
      <config-property name="queryTimeout">20</config-property>
    </valid-connection-checker>
-->
    <validate-on-match>true</validate-on-match>
    <background-validation>true</background-validation>
    <background-validation-minutes>1</background-validation-minutes>
  </validation>
  <timeout></timeout>
  <statement></statement>
</datasource>

 

I've tested this with both AS7 Final and AS7 upstream and got same result.

 

Is this a config issue or a known bug?