1 Reply Latest reply on Oct 6, 2005 4:08 PM by Steven Ostrowski

    execption from OracleValidConnectionChecker

    Christian Sell Newbie


      we added the OracleValidConnectionChecker to our datasource configuration, and are now seeing exceptions like the following in our logs:

      java.lang.IllegalArgumentException: object is not an instance of declaring class
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:54)

      obviously, this is a classloader issue that manifestst itself in the fact that the oracle driver class which is loaded through the loadClass invocation in the constructor of OracleValidConnectionChecker (and from which the Method object is created) is not the same as the one from which the actual connection is instantiated at runtime. We modified the source to add logging statements, and saw that the class names are in fact identical.

      We modified the source again, so that the loadClass statement reads:


      Now the problem is fixed for us, but we would like to verify if there is a better solution, as this problem should be affecting more people than just us..

      Christian Sell