9 Replies Latest reply on Mar 12, 2012 9:04 AM by Tomislav Mihaldinec

    java.sql.SQLException: No suitable driver found

    Tomislav Mihaldinec Newbie

      Hi,

       

      can somebody help me with this error.

      i tried to find by searching the net and still the same error.

       

      so, im trying to connect to oracle DB and i receive this error whe i try to post soap request

       

      2012-03-08 17:30:09,089 [http--10.243.181.252-8080-1] ERROR - [4FCB9F] RadiusSessionTable.getNewRadiusSessiontableEntry(): DB fault

      java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:Admin/pasw0rd@database:1639:TRADH

              at java.sql.DriverManager.getConnection(DriverManager.java:602)

              at java.sql.DriverManager.getConnection(DriverManager.java:185)

              at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75)

              at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)

              at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)

              at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:180)

              at java.sql.DriverManager.getConnection(DriverManager.java:582)

              at java.sql.DriverManager.getConnection(DriverManager.java:207)

       

      so, basically this url is constructed fine

      im using Class.forName

       

      Class.forName(jdbcClassName);

          String jdbcUrl;

          String jdbcUrl;

          if (props.getProperty(getKeyForProp(poolInstanceName, "jdbcUrl")) != null)

          {

            jdbcUrl = getValueForProp(props, poolInstanceName, "jdbcUrl");

          }

          else {

            checkExistence(props, getKeyForProp(poolInstanceName, "uid"));

            checkExistence(props, getKeyForProp(poolInstanceName, "passwd"));

            checkExistence(props, getKeyForProp(poolInstanceName, "host"));

            checkExistence(props, getKeyForProp(poolInstanceName, "port"));

            checkExistence(props, getKeyForProp(poolInstanceName, "sid"));

            String jdbcUrl;

            if (jdbcClassName.indexOf("mysql") != -1)

              jdbcUrl =

                "jdbc:mysql://" +

                getValueForProp(props, poolInstanceName, "host") +

                ":" +

                getValueForProp(props, poolInstanceName, "port") +

                "/" +

                getValueForProp(props, poolInstanceName, "sid") +

                "?" +

                "user=" +

                getValueForProp(props, poolInstanceName, "uid") +

                "&" +

                "password=" +

                getValueForProp(props, poolInstanceName, "passwd");

            else {

              jdbcUrl =

                "jdbc:oracle:thin:" +

                getValueForProp(props, poolInstanceName, "uid") +

                "/" +

                getValueForProp(props, poolInstanceName, "passwd") +

                "@" +

                getValueForProp(props, poolInstanceName, "host") +

                ":" +

                getValueForProp(props, poolInstanceName, "port") +

                ":" +

                getValueForProp(props, poolInstanceName, "sid");

            }

       

       

      it might be that this is classloading problem but i cannot find where.

      ist there any way to see loaded classes and from where are loaded

       

      my jboss-deployment-structure.xml is in attachment

       

       

      same code works on Websphere 7

       

      thank you

      tomislav