22 Replies Latest reply on May 11, 2011 10:27 PM by shedorius

    Cannot create JDBC driver of class '' for connect URL 'null'

    shedorius
      Hello,

      I installed GeoPortal  but still having the problem when I connect me:

      Cannot create JDBC driver of class '' for connect URL 'null'

      How can I to do !?
        • Re: Cannot create JDBC driver of class '' for connect URL 'null'
          CReece-esristaff
          Most likely there is a problem with your JNDI configuration file in the \Tomcat\conf\Catalina\localhost\geoportal.xml file.  But there could be other issues.

          What Geoportal version are you using?
          What Tomcat are you using?
          Do you have the right JDBC connector installed?

          Please send a copy of the contents of your geoportal.xml file.

          -Clive
          • Re: Cannot create JDBC driver of class '' for connect URL 'null'
            shedorius
            I downloaded geoportal-1.1.zip, I use tomcat6 and Yes I have the rights.


            <Context docBase="geocarto54" path="/geocarto54" debug="0" reloadable="true" crossContext="true">
                <Resource name="jdbc/gpt" auth="Container" type="javax.sql.DataSource"
                          driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
                          url="jdbc:sqlserver://CARTOSQL:1433;databaseName=carto54"
                          user="admin"
                          password="admin"
                          maxActive="20"
                          maxIdle="10"
                          maxWait="-1" />
                 
            </Context>


            Z:\tomcat6\webapps\geocarto54

            My database is carto54, server is CARTOSQL
            I download sqljdbc4.jar,  I copy the database jdbc driver whitin tomcat6\lib
            • Re: Cannot create JDBC driver of class '' for connect URL 'null'
              CReece-esristaff
              I don't see any obvious errors in the JDBC connection strings.  It still seems like a jdbc connection issue.  Can I ask you to
              1/ stop Tomcat 
              2/ Clear out the Tomcat log file directory (tomcat6\logs) either deleting or backing up the old log files
              3/ Start Tomcat
              4/ Wait till the gpt log file stabilizes after start up.
              5/ Open the gpt log file and inspect the error messages

              We need to determine if geoportal is making the connection to your database and getting denied at login, or whether it is able to connect to the database at all (or other).
              • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                shedorius
                ATTENTION: [SYNCHRONIZER] Error fetching next task
                org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host CARTOSQL, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.)
                at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
                at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
                at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
                at com.esri.gpt.framework.sql.DatabaseReference.openJndiConnection(Unknown Source)
                at com.esri.gpt.framework.sql.DatabaseReference.openConnection(Unknown Source)
                at com.esri.gpt.framework.sql.ManagedConnection.<init>(Unknown Source)
                at com.esri.gpt.framework.sql.ManagedConnections.returnConnection(Unknown Source)
                at com.esri.gpt.framework.sql.ConnectionBroker.returnConnection(Unknown Source)
                at com.esri.gpt.framework.sql.BaseDao.returnConnection(Unknown Source)
                at com.esri.gpt.catalog.harvest.jobs.HjGetNextRequest.execute(Unknown Source)
                at com.esri.gpt.control.webharvest.engine.TaskQueue.next(Unknown Source)
                at com.esri.gpt.control.webharvest.engine.Worker.next(Unknown Source)
                at com.esri.gpt.control.webharvest.engine.Worker.execute(Unknown Source)
                at com.esri.gpt.control.webharvest.engine.WorkerBase.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
                Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host CARTOSQL, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
                at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
                at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
                at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
                at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
                at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
                ... 14 more

                I don't understand all, can you help me please with this errors ?
                thank you
                • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                  CReece-esristaff
                  The most important message is "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host CARTOSQL, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.)"

                  The geoportal web app cannot communicate with your database on port 1433 ("The TCP/IP connection to the host CARTOSQL, port 1433 has failed. Error: Connection refused"). 

                  Assuming you are not running the SQL Server as a named instance, it appears that port 1433 may not be active for database connections on your database machine.  Check the SQL Server Configuration manager > SQL Server Network Configuration > Protocols for MSSQLSERVER (name of your database instance) > TCP/IP > Properties:
                  check ... Protocol is Enabled (=Yes)?

                  Or something (firewall?) is blocking the Tomcat communication with your database server.
                  • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                    CReece-esristaff
                    Please post back for the group if you were able to correct the JDBC issue
                    • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                      cecilio
                      Please post back for the group if you were able to correct the JDBC issue


                      I used a dymanic port as listed by the IP Address for my SQL instance ... Not sure if this was the right thing to do long term but it worked for me...

                      I clicked on Start then right clicked on My computer clicked on Manage expanded Services and Applications expanded SQL Server Configuration Manager clicked on SQL Server Network Configurations double clicked on my instance double clicked on TCP/IP ( Made sure it was enabled) clicked on the IP Addresses Tab used theIPALL TCP Dynamic Port listed ....

                      -Cecilio
                      • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                        shedorius
                        I have to change the port (1431) in SQL Server and geoportal.xml but I always have the same error

                        2 mai 2011 16:19:39 com.esri.gpt.control.webharvest.engine.TaskQueue next
                        ATTENTION: [SYNCHRONIZER] Error fetching next task
                        org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host CARTOSQL, port 1431 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.)
                         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
                         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
                         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
                         at com.esri.gpt.framework.sql.DatabaseReference.openJndiConnection(Unknown Source)
                         at com.esri.gpt.framework.sql.DatabaseReference.openConnection(Unknown Source)
                         at com.esri.gpt.framework.sql.ManagedConnection.<init>(Unknown Source)
                         at com.esri.gpt.framework.sql.ManagedConnections.returnConnection(Unknown Source)
                         at com.esri.gpt.framework.sql.ConnectionBroker.returnConnection(Unknown Source)
                         at com.esri.gpt.framework.sql.BaseDao.returnConnection(Unknown Source)
                         at com.esri.gpt.catalog.harvest.jobs.HjGetNextRequest.execute(Unknown Source)
                         at com.esri.gpt.control.webharvest.engine.TaskQueue.next(Unknown Source)
                         at com.esri.gpt.control.webharvest.engine.Worker.next(Unknown Source)
                         at com.esri.gpt.control.webharvest.engine.Worker.execute(Unknown Source)
                         at com.esri.gpt.control.webharvest.engine.WorkerBase.run(Unknown Source)
                         at java.lang.Thread.run(Unknown Source)
                        Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host CARTOSQL, port 1431 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
                         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
                         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
                         at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
                         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
                         at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
                         at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
                         at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
                         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
                         at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
                         ... 14 more
                        


                        My file geoportal.xml


                        <!-- Context configuration file for the Geoportal Web App -->
                        <Context docBase="geocarto54" path="/geocarto54" debug="0" reloadable="true" crossContext="true">
                            <Resource name="jdbc/gpt" auth="Container" type="javax.sql.DataSource"
                                      driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
                                      url="jdbc:sqlserver://CARTOSQL:1431;databaseName=carto54"
                                      user="admincarto54"
                                      password="xxxxxxxxx"
                                      maxActive="20"
                                      maxIdle="10"
                                      maxWait="-1" />
                             
                        </Context>


                        My database is carto54, server is cartosql
                        Z:\tomcat6\webapps\geocarto54
                        • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                          CReece-esristaff
                          You are getting 'connection refused'.  The error message is telling us that port 1433 is not set up on CARTOSQL to accept SQL Server connections from other machines.
                          • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                            shedorius
                            Thanks you, but now I have not the choice. I owe  to use odbc connection.

                            <!-- Context configuration file for the Geoportal Web App -->
                            <Context docBase="geoportal" path="/geoportal" debug="0" reloadable="true" crossContext="true">
                                <Resource name="jdbc/gpt" auth="Container" type="javax.sql.DataSource"
                                          driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
                                          url="jdbc:odbc:geoportal"
                                          user="admincarto54"
                                          password="xxxxxxxxxx"
                                          maxActive="20"
                                          maxIdle="10"
                                          maxWait="-1" />
                                 
                            </Context>


                            I created odbc system connection. His name is geoportal

                            Now, I have this error :

                            Cannot create PoolableConnectionFactory ([Microsoft][Gestionnaire de pilotes ODBC] Source de données introuvable et nom de pilote non spécifié)
                            • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                              CReece-esristaff
                              You are swimming in uncharted waters trying to use ODBC.  I would strongly recommend you stick to a JDBC driver and JDBC url connection.  Another tool to try (with the goal of getting the JDBC driver/url combination correct for your system) is DbVisualizer.  It would allow you to choose a driver and quickly test different connection strings.  Still, I think the primary focus needs to be determining which TCP port your SQLServer database machine is configured to accept outside connections.
                              • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                shedorius
                                The problem is that I can not have access firewall, nor cnfiguration sql server.
                                The persons of this service are in vacancy. I can only to use ODBC
                                • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                  shedorius
                                  I tryed Dbvizualizer and with this software, I can connect me with tcp port 1354.
                                  But with geoportal, this error appear :


                                  Cannot create PoolableConnectionFactory (�?chec de l'ouverture de session de l'utilisateur ''. L'utilisateur n'est pas associé à une connexion SQL Server approuvée.)

                                  I use exactly the same user, password, database, driver ... I don't understand why it work with dbvizualizer but not SQL Server ...




                                  I would strongly recommend you stick to a JDBC driver and JDBC url connection. Another tool to try (with the goal of getting the JDBC driver/url combination correct for your system) is DbVisualizer. It would allow you to choose a driver and quickly test different connection strings. Still, I think the primary focus needs to be determining which TCP port your SQLServer database machine is configured to accept outside connections.
                                  • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                    CReece-esristaff
                                    I tryed Dbvizualizer and with this software, I can connect me with tcp port 1354.
                                    But with geoportal, this error appear :

                                    Cannot create PoolableConnectionFactory (�?chec de l'ouverture de session de l'utilisateur ''. L'utilisateur n'est pas associé à une connexion SQL Server approuvée.)

                                    I use exactly the same user, password, database, driver ... I don't understand why it work with dbvizualizer but not SQL Server ...


                                    You are using dBVisualizer from the Tomcat machine?
                                    With dBVisualizer you are pointing to the same database driver that is in Tomcat/lib?
                                    Then I would next look through Tomcat/lib and Tomcat/webapps/geoportal/WEB-INF/lib and make sure you don't have a 2nd database driver that might be conflicting.
                                    • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                      CReece-esristaff
                                      One more thing:  I just translated the French error message to English:  "The user logon failed ". The user is not associated with a trusted SQL Server connection."

                                      This would indicate that the username logon is not allowed/configured to remotely log in to your SQL Server.
                                      • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                        shedorius
                                        I use dbVisualizer from the tomcat machine and I point to the same database driver that is in Tomcat/lib. I don't now if I have a 2nd database driver that might be conflicting.



                                        With dBVisualizer you are pointing to the same database driver that is in Tomcat/lib?
                                        Then I would next look through Tomcat/lib and Tomcat/webapps/geoportal/WEB-INF/lib and make sure you don't have a 2nd database driver that might be conflicting.
                                        • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                          shedorius
                                          I use dbVisualizer from the tomcat machine and I point to the same database driver that is in Tomcat/lib. I don't now if I have a 2nd database driver that might be conflicting.

                                          [URL=http://www.hostingpics.net/viewer.php?id=213890Sanstitre2.png][/URL]

                                          [URL=http://www.hostingpics.net/viewer.php?id=970522Sanstitre.png][/URL]

                                          This would indicate that the username logon is not allowed/configured to remotely log in to your SQL Server.


                                          With dbVisualizer, I use the same user and password. And It's OK.
                                          • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                            shedorius
                                            I noticed that SQL server receives no request when I connect me with the geoportal
                                            • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                              CReece-esristaff
                                              Let's go back and check that your geoportal webapp context and the JNDI deployment descriptor file are the same.
                                              Your geoportal webapp context is geocarto54.  Correct?
                                              Can you make sure that the JNDI deployment descriptor placed in config/Catalina/localhost is using the same name, namely geocarto54.xml?
                                              • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                                CReece-esristaff
                                                Thank you, It' OK


                                                Does that mean it is working for you now?
                                                • Re: Cannot create JDBC driver of class '' for connect URL 'null'
                                                  shedorius
                                                  It's working for me, thank you