3 Replies Latest reply on Aug 3, 2003 3:04 PM by svaret

    MySQL wrong driver specified

    svaret Newbie

      Hi all,

      My application (web app) uses MySQL as a database. I am also using form-based authentication so that the web-container will authenticate the user. I use DatabaseServerLoginModule to retrieve users, roles and passwords.

      This works fine almost all of the time. Sometimes though I get this error text in the console window:

      org.jboss.util.NestedSQLException: Apparently wrong driver class specified for U
      RL: class: org.gjt.mm.mysql.Driver, url: jdbc:mysql://localhost/betservant; - ne
      sted throwable: (org.jboss.resource.JBossResourceException: Apparently wrong dri
      ver class specified for URL: class: org.gjt.mm.mysql.Driver, url: jdbc:mysql://l
      ocalhost/betservant)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
      erDataSource.java:106)
      at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPasswor
      d(DatabaseServerLoginModule.java:96)
      at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(Usernam
      ePasswordLoginModule.java:143)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:664)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
      29)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
      :596)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:523)
      at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecur
      ityManager.java:462)
      at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecur
      ityManager.java:417)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityMa
      nager.java:244)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityMa
      nager.java:219)
      at org.jboss.jetty.security.JBossUserRealm$JBossUserPrincipal.isAuthenti
      cated(JBossUserRealm.java:92)
      at org.jboss.jetty.security.JBossUserRealm$JBossUserPrincipal.authentica
      te(JBossUserRealm.java:154)
      at org.jboss.jetty.security.JBossUserRealm.authenticate(JBossUserRealm.j
      ava:323)
      at org.mortbay.jetty.servlet.FormAuthenticator.authenticated(FormAuthent
      icator.java:106)
      at org.mortbay.jetty.servlet.ServletHttpContext.jSecurityCheck(ServletHt
      tpContext.java:121)
      at org.mortbay.jetty.servlet.ServletHttpContext.checkSecurityConstraints
      (ServletHttpContext.java:137)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
      onHandler.java:235)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
      58)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
      Context.java:507)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      at org.jboss.jetty.Jetty.service(Jetty.java:460)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
      201)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
      Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver cl
      ass specified for URL: class: org.gjt.mm.mysql.Driver, url: jdbc:mysql://localho
      st/betservant
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.g
      etDriver(LocalManagedConnectionFactory.java:284)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
      reateManagedConnection(LocalManagedConnectionFactory.java:146)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
      eateConnection(InternalManagedConnectionPool.java:352)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge
      tConnection(InternalManagedConnectionPool.java:151)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePo
      ol.getConnection(JBossManagedConnectionPool.java:648)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage
      dConnection(BaseConnectionManager2.java:413)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
      nnection(TxConnectionManager.java:331)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
      onnection(BaseConnectionManager2.java:488)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
      nManagerProxy.allocateConnection(BaseConnectionManager2.java:798)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
      erDataSource.java:102)
      ... 35 more

      Any clues?

      Best regards

      Lasse