1 Reply Latest reply on Jun 4, 2012 4:46 PM by Horst Leitenmueller

    driver-class makes no difference

    jepper Newbie



      I want to set up p6spy, but jboss is not using the pass thru driver it appears.


      My question is:      Is <driver-class> effectively ignored but it's presence required?




      jboss 6.1.0 final

      mysql 5.5

      Both running on the same windows XP machine.


      CLASSPATH: D:\opt\jboss\jboss-6.1.0.Final\server\all\conf;D:\opt\jboss\jboss-6.1.0.Final\bin\run.jar





      It seems I can enter any random string in the <driver-class> tag. It makes no difference. I start jboss with a database with no tables. New jboss tables are created as expected, despite driver-class not being meaningful. If I delete the tag however, jboss complains and cannot speak to the database.


















      mysql> show tables;


      | Tables_in_jbossdb |


      | hilosequences     |

      | timers            |

        • 1. Re: driver-class makes no difference
          Horst Leitenmueller Newbie



          i possible have a answer for your problem, because i have the same problem on a jboss 5.1.0.GA


          to use actual p6spy you have todo 2 things:


          1. add set in spy.properties   useprefix to true
          2. add in -ds.xml to the connection-url  the prefix "p6spy:"jdbc:mysql...  (without quotes)


          problem behind if you are interessted is the loading mechanism of

          LocalManagedConnectionFactory.getDriver(final String url)


          which is not checking the driver-class entered only if real loaded for the first time but afterwards only the url is checked !


          // Check if the driver is already loaded, if not then try to load it


                if (isDriverLoadedForURL(url))


                   return driver;

                } // end of if ()



          i hope the answer helps,


          br horst