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

8059
22
04-20-2011 06:29 AM
sebastiengeorge
New Contributor
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 !?
0 Kudos
22 Replies
CliveReece
Esri Contributor
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
0 Kudos
sebastiengeorge
New Contributor
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
0 Kudos
CliveReece
Esri Contributor
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).
0 Kudos
sebastiengeorge
New Contributor
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
0 Kudos
CliveReece
Esri Contributor
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.
0 Kudos
CliveReece
Esri Contributor
Please post back for the group if you were able to correct the JDBC issue
0 Kudos
CecilioMartinez
New Contributor II
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
0 Kudos
sebastiengeorge
New Contributor
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
0 Kudos
CliveReece
Esri Contributor
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.
0 Kudos