2 Replies Latest reply on Feb 1, 2005 5:57 AM by Felix Sima

    ERROR : Connection null. Apparently wrong driver class speci

    Felix Sima Newbie

      Hello.

      I'm trying to deploy a simple war into JBoss 3.2.x, mainly for learning more about authentication and autorization. I set up the application policy like :

      <application-policy name="JWM">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="dsJndiName">java:/JWM</module-option>
      <module-option name="principalsQuery">
      select password from users where username=?
      </module-option>
      <module-option name="rolesQuery">
      select rolename,'Roles' from user_roles where username=?
      </module-option>
      </login-module>

      </application-policy>

      and added the following mysql-ds.xml in deploy subdirectory :


      <local-tx-datasource>
      <jndi-name>JWM</jndi-name>
      <connection-url>
      jdbc:mysql://127.0.0.1:3306/jwm
      </connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>webclient</user-name>
      < password>p< /password>
      </local-tx-datasource>


      After a successful login I get the following error :

      23:46:52,462 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql://127.0.0.1:3306/jwm)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:504)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:214)
      ......

      I put the latest driver for mySQL in WEB-INF/lib, so I really think is not a problem with the driver.
      From command line I can connect to the DB using the given username/password without problems.

      Can anyone, please, help me solving this problem.

      Thank you,
      Felix